matrix-design-system 1.1.1 → 2.0.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 +40 -1
- package/dist/index.d.mts +5 -6
- package/dist/organism/footer/footer.d.mts +9 -10
- package/dist/organism/footer/footer.mjs +75 -151
- package/dist/organism/footer/index.d.mts +3 -3
- package/dist/organism/footer/use-footer-store.d.mts +0 -8
- package/dist/organism/footer/use-footer-store.mjs +13 -31
- package/dist/organism/menu/index.d.mts +2 -3
- package/dist/organism/menu/menu.d.mts +20 -19
- package/dist/organism/menu/menu.mjs +128 -266
- package/dist/organism/menu/use-menu-store.mjs +67 -232
- package/package.json +15 -15
- package/dist/organism/menu/use-menu-store.d.mts +0 -21
package/README.md
CHANGED
|
@@ -77,13 +77,52 @@ import NextImage from "next/image";
|
|
|
77
77
|
|
|
78
78
|
<InternalLink to="/blog" linkComponent={NextLink}>Blog</InternalLink>
|
|
79
79
|
<ImageGlow src={photo} alt="" imageComponent={NextImage} />
|
|
80
|
-
<Menu currentPath={usePathname()}
|
|
80
|
+
<Menu currentPath={usePathname()} entries={entries} linkComponent={NextLink} />
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Without them you get a real `<a>` and a real `<img>` — `PlainImage` reproduces `next/image`'s
|
|
84
84
|
`fill`, placeholder and lazy-loading behaviour — so the components work anywhere, just without
|
|
85
85
|
client-side routing or image optimisation.
|
|
86
86
|
|
|
87
|
+
## Navigation is injected
|
|
88
|
+
|
|
89
|
+
`Menu` and `Footer` know nothing about your site: you hand them the navigation.
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
const entries: MenuEntry[] = [
|
|
93
|
+
{ label: "Home", to: "/" },
|
|
94
|
+
{
|
|
95
|
+
label: "Blog",
|
|
96
|
+
groups: [
|
|
97
|
+
{ label: "Posts", items: [{ label: "Latest posts", to: "/blog", onClick: trackBlog }] },
|
|
98
|
+
{ label: "Elsewhere", items: [{ label: "Docs", to: "https://example.com", external: true }] },
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
<Menu currentPath={pathname} entries={entries} pinnedOnPaths={["/chat"]} linkComponent={NextLink} />
|
|
104
|
+
<Footer author="Jane" links={[{ label: "Home", to: "/" }]} contactHref="/contact" socialLinks={social} />
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
An entry is either a link (`MenuLink`) or a dropdown of grouped links (`MenuDropdown`, told apart by its
|
|
108
|
+
`groups`). A link is marked selected when its `to` equals `currentPath`, or when `currentPath` starts with one of
|
|
109
|
+
its optional `activePathPrefixes` (for a detail route that lives outside the link's own path, e.g. an "Authors"
|
|
110
|
+
link to `/blog/authors` with `activePathPrefixes: ["/blog/author/"]`); external links never are, and a dropdown
|
|
111
|
+
holding a selected link is highlighted too. A link's
|
|
112
|
+
`onClick` is where tracking goes, and the mobile panel closes on click by itself. The menu hides on scroll
|
|
113
|
+
except on `pinnedOnPaths`.
|
|
114
|
+
|
|
115
|
+
### Migrating from 1.x
|
|
116
|
+
|
|
117
|
+
- `Menu`: `navHrefs` and `tracking` are gone. Build a `MenuEntry[]` (labels and hrefs included) and pass it as
|
|
118
|
+
`entries`; each former `onTrack*` callback becomes the `onClick` of its link. The chat path that used to be
|
|
119
|
+
hardcoded is now `pinnedOnPaths={[chatPath]}`. The Authors link that used to stay selected on author pages is
|
|
120
|
+
now `{ label: "Authors", to: "/blog/authors", activePathPrefixes: ["/blog/author/"] }`.
|
|
121
|
+
- `Footer`: `navHrefs` and `navTracking` are gone. Pass `links` (`{ label, to, onClick? }`, Home included) and
|
|
122
|
+
`contactHref`. `socialTracking` is unchanged.
|
|
123
|
+
- The exported types `MenuNavHrefs`, `MenuTrackingCallbacks`, `FooterNavHrefs` and `FooterNavTrackingCallbacks`
|
|
124
|
+
are removed; `MenuEntry`, `MenuLink`, `MenuGroup`, `MenuDropdown` and `FooterLink` replace them.
|
|
125
|
+
|
|
87
126
|
## No provider required
|
|
88
127
|
|
|
89
128
|
There is no theme or context provider to wrap anything in. Components read their styling from CSS
|
package/dist/index.d.mts
CHANGED
|
@@ -109,10 +109,10 @@ import "./molecules/video/self-hosted-video/index.mjs";
|
|
|
109
109
|
import { Youtube } from "./molecules/video/youtube/youtube.mjs";
|
|
110
110
|
import "./molecules/video/youtube/index.mjs";
|
|
111
111
|
import { CookieConsentBanner } from "./organism/cookie-consent-banner/cookie-consent-banner.mjs";
|
|
112
|
-
import {
|
|
112
|
+
import { FooterSocialTrackingCallbacks } from "./organism/footer/use-footer-store.mjs";
|
|
113
113
|
import { SocialContactLinks, SocialContacts, SocialContactsProps } from "./organism/social-contacts/social-contacts.mjs";
|
|
114
114
|
import "./organism/social-contacts/index.mjs";
|
|
115
|
-
import { Footer,
|
|
115
|
+
import { Footer, FooterLink, FooterProps } from "./organism/footer/footer.mjs";
|
|
116
116
|
import "./organism/footer/index.mjs";
|
|
117
117
|
import { BrandHeader, BrandHeaderProps } from "./organism/header/brand-header/brand-header.mjs";
|
|
118
118
|
import "./organism/header/brand-header/index.mjs";
|
|
@@ -121,9 +121,7 @@ import "./organism/image-carousel/index.mjs";
|
|
|
121
121
|
import { Lightbox } from "./organism/lightbox/lightbox.mjs";
|
|
122
122
|
import "./organism/lightbox/index.mjs";
|
|
123
123
|
import { LoadingBar } from "./organism/loading-bar/loading-bar.mjs";
|
|
124
|
-
import {
|
|
125
|
-
import { MenuTrackingCallbacks } from "./organism/menu/use-menu-store.mjs";
|
|
126
|
-
import { Menu, MenuNavHrefs, MenuProps } from "./organism/menu/menu.mjs";
|
|
124
|
+
import { Menu, MenuDropdown, MenuEntry, MenuGroup, MenuLink, MenuProps } from "./organism/menu/menu.mjs";
|
|
127
125
|
import "./organism/menu/index.mjs";
|
|
128
126
|
import { ProfileHero, ProfileHeroProps } from "./organism/profile-hero/profile-hero.mjs";
|
|
129
127
|
import "./organism/profile-hero/index.mjs";
|
|
@@ -141,6 +139,7 @@ import { useLockBodyScroll } from "./hooks/use-lock-body-scroll.mjs";
|
|
|
141
139
|
import { MATRIX_RAIN_DEFAULTS, MATRIX_RAIN_PRESETS, MatrixRainProps, MatrixRainSettings, matrixSettingsChangeEvent, readMatrixSettings, settingsToProps, writeMatrixSettings } from "./state/matrix-rain/matrix-settings.mjs";
|
|
142
140
|
import { useMatrixSettingsStore } from "./hooks/use-matrix-settings-store.mjs";
|
|
143
141
|
import { useMotionStore } from "./hooks/use-motion-store.mjs";
|
|
142
|
+
import { OsModifierKey, useOsModifierKey } from "./hooks/use-os-modifier-key.mjs";
|
|
144
143
|
import { useReadingProgress } from "./hooks/use-reading-progress.mjs";
|
|
145
144
|
import { useReducedMotions } from "./hooks/use-reduced-motions.mjs";
|
|
146
145
|
import { ScrollDirection, useScrollDirection } from "./hooks/use-scroll-direction.mjs";
|
|
@@ -150,4 +149,4 @@ import { CommandPaletteClose, CommandPaletteContext } from "./state/command-pale
|
|
|
150
149
|
import { closeCommandPalette, commandPaletteCloseEvent, commandPaletteOpenEvent, openCommandPalette } from "./state/command-palette/command-palette-events.mjs";
|
|
151
150
|
import { LightboxOpenDetail, lightboxOpenEvent, openLightbox } from "./state/lightbox/lightbox-events.mjs";
|
|
152
151
|
import { hasMotion, motionChangeEvent, writeMotion } from "./state/motion/motion.mjs";
|
|
153
|
-
export { Accordion, AnchorLink, BluePill, BluePillButton, BluePillLink, BrandHeader, type BrandHeaderProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, CallToActionExternalWithTracking, CallToActionInternalWithTracking, type CallToActionInternalWithTrackingProps, ChatIcon, Chip, type ChipProps, Close, CommandPaletteClose, CommandPaletteContext, CommandPaletteTrigger, ContentContainer, ContentProgressBar, ControlSlider, CookieConsentBanner, CopiedIcon, CopyErrorIcon, CopyIcon, Cursor, DropdownMenu, ErrorText, ExternalLink, FilterInput, type FilterInputProps, Footer, type
|
|
152
|
+
export { Accordion, AnchorLink, BluePill, BluePillButton, BluePillLink, BrandHeader, type BrandHeaderProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, CallToActionExternalWithTracking, CallToActionInternalWithTracking, type CallToActionInternalWithTrackingProps, ChatIcon, Chip, type ChipProps, Close, CommandPaletteClose, CommandPaletteContext, CommandPaletteTrigger, ContentContainer, ContentProgressBar, ControlSlider, CookieConsentBanner, CopiedIcon, CopyErrorIcon, CopyIcon, Cursor, DropdownMenu, ErrorText, ExternalLink, FilterInput, type FilterInputProps, Footer, type FooterLink, type FooterProps, type FooterSocialTrackingCallbacks, FormErrorSummary, type FormErrorSummaryProps, FormField, type FormFieldProps, FormSuccessMessage, type FormSuccessMessageProps, FormTextarea, type FormTextareaProps, GlassmorphismBackground, HamburgerMenu, ImageCarousel, type ImageCarouselProps, type ImageComponent, type ImageComponentProps, ImageGlow, type ImageGlowProps, type ImagePlaceholder, type ImageSource, InputField, InternalLink, type InternalLinkProps, Label, type LabelProps, Lightbox, LightboxImage, LightboxOpenDetail, type LinkComponent, type LinkComponentProps, Loader, LoadingBar, MATRIX_RAIN_DEFAULTS, MATRIX_RAIN_PRESETS, MatrixBackground, MatrixHeaderBackground, MatrixRain, MatrixRainProps, MatrixRainSettings, MatrixTerminal, Menu, type MenuDropdown, type MenuEntry, type MenuGroup, MenuItem, type MenuItemProps, type MenuLink, type MenuProps, MotionDiv, OsModifierKey, Overlay, type OverlayProps, type PageNavigationProps, PageTitle, PaginationNavigation, ParagraphTitleWithIcon, type PillProps, PlainImage, type PrefetchStrategy, ProfileHero, type ProfileHeroProps, ProfilePhoto, type ProfilePhotoProps, QuoteText, RedPill, RedPillButton, RedPillLink, RedPillNoReflection, RoundedIcon, ScrollDirection, SectionHeading, type SectionHeadingProps, type SegmentOption, SegmentedControl, SelfHostedVideo, SocialContact, type SocialContactLinks, type SocialContactProps, SocialContacts, type SocialContactsProps, StatCard, type StatCardProps, SuccessText, Switch, Tag, type TagProps, TerminalButton, type TerminalButtonProps, TerminalLine, TerminalListItem, type TerminalListItemProps, TerminalProgressBar, TerminalQuoteLine, Textarea, Youtube, closeCommandPalette, commandPaletteCloseEvent, commandPaletteOpenEvent, hasMotion, imageShimmerPlaceholder, lightboxOpenEvent, matrixSettingsChangeEvent, motionChangeEvent, openCommandPalette, openLightbox, readMatrixSettings, settingsToProps, useClipboardAvailable, useDeviceCapabilities, useGlassmorphism, useInView, useInViewList, useIsIOS, useLockBodyScroll, useMatrixSettingsStore, useMotionStore, useOsModifierKey, useReadingProgress, useReducedMotions, useScrollDirection, useTypewriter, useWebGpuSupported, writeMatrixSettings, writeMotion };
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { LinkComponent } from "../../atoms/links/anchor-link/anchor-link.mjs";
|
|
2
2
|
import "../../atoms/links/anchor-link/index.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { FooterSocialTrackingCallbacks } from "./use-footer-store.mjs";
|
|
4
4
|
import { SocialContactLinks } from "../social-contacts/social-contacts.mjs";
|
|
5
5
|
import "../social-contacts/index.mjs";
|
|
6
6
|
import { FC } from "react";
|
|
7
7
|
//#region src/organism/footer/footer.d.ts
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
archive: string;
|
|
13
|
-
tags: string;
|
|
14
|
-
contact: string;
|
|
8
|
+
export interface FooterLink {
|
|
9
|
+
label: string;
|
|
10
|
+
to: string;
|
|
11
|
+
onClick?: () => void;
|
|
15
12
|
}
|
|
16
13
|
export interface FooterProps {
|
|
17
14
|
linkComponent?: LinkComponent;
|
|
18
15
|
author: string;
|
|
19
|
-
|
|
16
|
+
/** The navigation links, in display order. */
|
|
17
|
+
links: FooterLink[];
|
|
18
|
+
/** Where the contact call to action of the social contacts leads. */
|
|
19
|
+
contactHref: string;
|
|
20
20
|
socialLinks: SocialContactLinks;
|
|
21
|
-
navTracking?: FooterNavTrackingCallbacks;
|
|
22
21
|
socialTracking?: FooterSocialTrackingCallbacks;
|
|
23
22
|
}
|
|
24
23
|
export declare const Footer: FC<FooterProps>;
|
|
@@ -7,125 +7,49 @@ import { c } from "react/compiler-runtime";
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/organism/footer/footer.tsx
|
|
9
9
|
const Footer = (t0) => {
|
|
10
|
-
const $ = c(
|
|
11
|
-
const { author,
|
|
12
|
-
const { effects } = useFooterStore(
|
|
13
|
-
const {
|
|
10
|
+
const $ = c(29);
|
|
11
|
+
const { author, links, contactHref, socialLinks, socialTracking, linkComponent } = t0;
|
|
12
|
+
const { effects } = useFooterStore(socialTracking);
|
|
13
|
+
const { onTrackGithub, onTrackLinkedin, onTrackContact, onTrackMedium, onTrackDevto, onTrackTwitter, onTrackFacebook, onTrackInstagram } = effects;
|
|
14
14
|
let t1;
|
|
15
|
-
if ($[0] !== linkComponent || $[1] !==
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
if ($[0] !== linkComponent || $[1] !== links) {
|
|
16
|
+
let t2;
|
|
17
|
+
if ($[3] !== linkComponent) {
|
|
18
|
+
t2 = (link) => /* @__PURE__ */ jsx(MenuItem, {
|
|
19
|
+
linkComponent,
|
|
20
|
+
to: link.to,
|
|
21
|
+
onClick: link.onClick,
|
|
22
|
+
selected: false,
|
|
23
|
+
children: link.label
|
|
24
|
+
}, link.label);
|
|
25
|
+
$[3] = linkComponent;
|
|
26
|
+
$[4] = t2;
|
|
27
|
+
} else t2 = $[4];
|
|
28
|
+
t1 = links.map(t2);
|
|
23
29
|
$[0] = linkComponent;
|
|
24
|
-
$[1] =
|
|
30
|
+
$[1] = links;
|
|
25
31
|
$[2] = t1;
|
|
26
32
|
} else t1 = $[2];
|
|
27
33
|
let t2;
|
|
28
|
-
if ($[
|
|
29
|
-
t2 = /* @__PURE__ */ jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onClick: onTrackBlog,
|
|
33
|
-
selected: false,
|
|
34
|
-
children: "Blog"
|
|
34
|
+
if ($[5] !== t1) {
|
|
35
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "grid w-full grid-cols-2 gap-3 px-5 py-7 sm:mx-auto sm:max-w-4xl sm:auto-cols-auto sm:grid-flow-col sm:grid-cols-none sm:justify-center",
|
|
37
|
+
children: t1
|
|
35
38
|
});
|
|
36
|
-
$[
|
|
37
|
-
$[4] = navHrefs.blog;
|
|
38
|
-
$[5] = onTrackBlog;
|
|
39
|
+
$[5] = t1;
|
|
39
40
|
$[6] = t2;
|
|
40
41
|
} else t2 = $[6];
|
|
41
42
|
let t3;
|
|
42
|
-
if ($[7]
|
|
43
|
-
t3 = /* @__PURE__ */ jsx(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onClick: onTrackArt,
|
|
47
|
-
selected: false,
|
|
48
|
-
children: "Art"
|
|
49
|
-
});
|
|
50
|
-
$[7] = linkComponent;
|
|
51
|
-
$[8] = navHrefs.art;
|
|
52
|
-
$[9] = onTrackArt;
|
|
53
|
-
$[10] = t3;
|
|
54
|
-
} else t3 = $[10];
|
|
43
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
44
|
+
t3 = /* @__PURE__ */ jsx("hr", {});
|
|
45
|
+
$[7] = t3;
|
|
46
|
+
} else t3 = $[7];
|
|
55
47
|
let t4;
|
|
56
|
-
if ($[
|
|
57
|
-
t4 = /* @__PURE__ */ jsx(
|
|
58
|
-
linkComponent,
|
|
59
|
-
to: navHrefs.aboutMe,
|
|
60
|
-
onClick: onTrackAboutMe,
|
|
61
|
-
selected: false,
|
|
62
|
-
children: "About Me"
|
|
63
|
-
});
|
|
64
|
-
$[11] = linkComponent;
|
|
65
|
-
$[12] = navHrefs.aboutMe;
|
|
66
|
-
$[13] = onTrackAboutMe;
|
|
67
|
-
$[14] = t4;
|
|
68
|
-
} else t4 = $[14];
|
|
69
|
-
let t5;
|
|
70
|
-
if ($[15] !== linkComponent || $[16] !== navHrefs.archive || $[17] !== onTrackArchive) {
|
|
71
|
-
t5 = /* @__PURE__ */ jsx(MenuItem, {
|
|
72
|
-
linkComponent,
|
|
73
|
-
to: navHrefs.archive,
|
|
74
|
-
onClick: onTrackArchive,
|
|
75
|
-
selected: false,
|
|
76
|
-
children: "Archive"
|
|
77
|
-
});
|
|
78
|
-
$[15] = linkComponent;
|
|
79
|
-
$[16] = navHrefs.archive;
|
|
80
|
-
$[17] = onTrackArchive;
|
|
81
|
-
$[18] = t5;
|
|
82
|
-
} else t5 = $[18];
|
|
83
|
-
let t6;
|
|
84
|
-
if ($[19] !== linkComponent || $[20] !== navHrefs.tags || $[21] !== onTrackTags) {
|
|
85
|
-
t6 = /* @__PURE__ */ jsx(MenuItem, {
|
|
86
|
-
linkComponent,
|
|
87
|
-
to: navHrefs.tags,
|
|
88
|
-
onClick: onTrackTags,
|
|
89
|
-
selected: false,
|
|
90
|
-
children: "Tags"
|
|
91
|
-
});
|
|
92
|
-
$[19] = linkComponent;
|
|
93
|
-
$[20] = navHrefs.tags;
|
|
94
|
-
$[21] = onTrackTags;
|
|
95
|
-
$[22] = t6;
|
|
96
|
-
} else t6 = $[22];
|
|
97
|
-
let t7;
|
|
98
|
-
if ($[23] !== t1 || $[24] !== t2 || $[25] !== t3 || $[26] !== t4 || $[27] !== t5 || $[28] !== t6) {
|
|
99
|
-
t7 = /* @__PURE__ */ jsxs("div", {
|
|
100
|
-
className: "grid w-full grid-cols-2 gap-3 px-5 py-7 sm:mx-auto sm:max-w-4xl sm:grid-cols-[repeat(6,auto)] sm:justify-center",
|
|
101
|
-
children: [
|
|
102
|
-
t1,
|
|
103
|
-
t2,
|
|
104
|
-
t3,
|
|
105
|
-
t4,
|
|
106
|
-
t5,
|
|
107
|
-
t6
|
|
108
|
-
]
|
|
109
|
-
});
|
|
110
|
-
$[23] = t1;
|
|
111
|
-
$[24] = t2;
|
|
112
|
-
$[25] = t3;
|
|
113
|
-
$[26] = t4;
|
|
114
|
-
$[27] = t5;
|
|
115
|
-
$[28] = t6;
|
|
116
|
-
$[29] = t7;
|
|
117
|
-
} else t7 = $[29];
|
|
118
|
-
let t8;
|
|
119
|
-
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
-
t8 = /* @__PURE__ */ jsx("hr", {});
|
|
121
|
-
$[30] = t8;
|
|
122
|
-
} else t8 = $[30];
|
|
123
|
-
let t9;
|
|
124
|
-
if ($[31] !== linkComponent || $[32] !== navHrefs.contact || $[33] !== onTrackContact || $[34] !== onTrackDevto || $[35] !== onTrackFacebook || $[36] !== onTrackGithub || $[37] !== onTrackInstagram || $[38] !== onTrackLinkedin || $[39] !== onTrackMedium || $[40] !== onTrackTwitter || $[41] !== socialLinks) {
|
|
125
|
-
t9 = /* @__PURE__ */ jsx(SocialContacts, {
|
|
48
|
+
if ($[8] !== contactHref || $[9] !== linkComponent || $[10] !== onTrackContact || $[11] !== onTrackDevto || $[12] !== onTrackFacebook || $[13] !== onTrackGithub || $[14] !== onTrackInstagram || $[15] !== onTrackLinkedin || $[16] !== onTrackMedium || $[17] !== onTrackTwitter || $[18] !== socialLinks) {
|
|
49
|
+
t4 = /* @__PURE__ */ jsx(SocialContacts, {
|
|
126
50
|
linkComponent,
|
|
127
51
|
links: socialLinks,
|
|
128
|
-
contactHref
|
|
52
|
+
contactHref,
|
|
129
53
|
onTrackGithub,
|
|
130
54
|
onTrackLinkedin,
|
|
131
55
|
onTrackContact,
|
|
@@ -135,59 +59,59 @@ const Footer = (t0) => {
|
|
|
135
59
|
onTrackFacebook,
|
|
136
60
|
onTrackInstagram
|
|
137
61
|
});
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
} else
|
|
151
|
-
const
|
|
152
|
-
let
|
|
153
|
-
if ($[
|
|
154
|
-
|
|
155
|
-
$[
|
|
156
|
-
} else
|
|
157
|
-
let
|
|
158
|
-
if ($[
|
|
159
|
-
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
} else
|
|
163
|
-
let
|
|
164
|
-
if ($[
|
|
165
|
-
|
|
62
|
+
$[8] = contactHref;
|
|
63
|
+
$[9] = linkComponent;
|
|
64
|
+
$[10] = onTrackContact;
|
|
65
|
+
$[11] = onTrackDevto;
|
|
66
|
+
$[12] = onTrackFacebook;
|
|
67
|
+
$[13] = onTrackGithub;
|
|
68
|
+
$[14] = onTrackInstagram;
|
|
69
|
+
$[15] = onTrackLinkedin;
|
|
70
|
+
$[16] = onTrackMedium;
|
|
71
|
+
$[17] = onTrackTwitter;
|
|
72
|
+
$[18] = socialLinks;
|
|
73
|
+
$[19] = t4;
|
|
74
|
+
} else t4 = $[19];
|
|
75
|
+
const t5 = `> Made with 💝 by ${author} 'Chicio'`;
|
|
76
|
+
let t6;
|
|
77
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
78
|
+
t6 = /* @__PURE__ */ jsx(Cursor, {});
|
|
79
|
+
$[20] = t6;
|
|
80
|
+
} else t6 = $[20];
|
|
81
|
+
let t7;
|
|
82
|
+
if ($[21] !== t5) {
|
|
83
|
+
t7 = /* @__PURE__ */ jsxs(TerminalLine, { children: [t5, t6] });
|
|
84
|
+
$[21] = t5;
|
|
85
|
+
$[22] = t7;
|
|
86
|
+
} else t7 = $[22];
|
|
87
|
+
let t8;
|
|
88
|
+
if ($[23] !== t4 || $[24] !== t7) {
|
|
89
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
166
90
|
className: "from-general-background-light to-primary-color-dark flex w-full flex-col items-center justify-center gap-3 bg-gradient-to-b px-4 py-6",
|
|
167
|
-
children: [
|
|
91
|
+
children: [t4, t7]
|
|
168
92
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else
|
|
173
|
-
let
|
|
174
|
-
if ($[
|
|
175
|
-
|
|
93
|
+
$[23] = t4;
|
|
94
|
+
$[24] = t7;
|
|
95
|
+
$[25] = t8;
|
|
96
|
+
} else t8 = $[25];
|
|
97
|
+
let t9;
|
|
98
|
+
if ($[26] !== t2 || $[27] !== t8) {
|
|
99
|
+
t9 = /* @__PURE__ */ jsx("footer", {
|
|
176
100
|
className: "bg-primary-dark border-t-accent relative w-full shrink-0 snap-start border-t-2 border-solid shadow-lg",
|
|
177
101
|
children: /* @__PURE__ */ jsxs("div", {
|
|
178
102
|
className: "flex w-full flex-col items-center",
|
|
179
103
|
children: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
104
|
+
t2,
|
|
105
|
+
t3,
|
|
106
|
+
t8
|
|
183
107
|
]
|
|
184
108
|
})
|
|
185
109
|
});
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else
|
|
190
|
-
return
|
|
110
|
+
$[26] = t2;
|
|
111
|
+
$[27] = t8;
|
|
112
|
+
$[28] = t9;
|
|
113
|
+
} else t9 = $[28];
|
|
114
|
+
return t9;
|
|
191
115
|
};
|
|
192
116
|
//#endregion
|
|
193
117
|
export { Footer };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Footer,
|
|
3
|
-
export { Footer, type
|
|
1
|
+
import { FooterSocialTrackingCallbacks } from "./use-footer-store.mjs";
|
|
2
|
+
import { Footer, FooterLink, FooterProps } from "./footer.mjs";
|
|
3
|
+
export { Footer, type FooterLink, type FooterProps, type FooterSocialTrackingCallbacks };
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import "matrix-component-store";
|
|
2
2
|
//#region src/organism/footer/use-footer-store.d.ts
|
|
3
|
-
export interface FooterNavTrackingCallbacks {
|
|
4
|
-
onTrackHome?: () => void;
|
|
5
|
-
onTrackBlog?: () => void;
|
|
6
|
-
onTrackArt?: () => void;
|
|
7
|
-
onTrackAboutMe?: () => void;
|
|
8
|
-
onTrackArchive?: () => void;
|
|
9
|
-
onTrackTags?: () => void;
|
|
10
|
-
}
|
|
11
3
|
export interface FooterSocialTrackingCallbacks {
|
|
12
4
|
onTrackGithub?: () => void;
|
|
13
5
|
onTrackLinkedin?: () => void;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
//#region src/organism/footer/use-footer-store.ts
|
|
4
|
-
const useFooterStore = (
|
|
5
|
-
const $ = c(
|
|
6
|
-
const onTrackHome = navTracking?.onTrackHome;
|
|
7
|
-
const onTrackBlog = navTracking?.onTrackBlog;
|
|
8
|
-
const onTrackArt = navTracking?.onTrackArt;
|
|
9
|
-
const onTrackAboutMe = navTracking?.onTrackAboutMe;
|
|
10
|
-
const onTrackArchive = navTracking?.onTrackArchive;
|
|
11
|
-
const onTrackTags = navTracking?.onTrackTags;
|
|
4
|
+
const useFooterStore = (socialTracking) => {
|
|
5
|
+
const $ = c(9);
|
|
12
6
|
const onTrackGithub = socialTracking?.onTrackGithub;
|
|
13
7
|
const onTrackLinkedin = socialTracking?.onTrackLinkedin;
|
|
14
8
|
const onTrackContact = socialTracking?.onTrackContact;
|
|
@@ -18,14 +12,8 @@ const useFooterStore = (navTracking, socialTracking) => {
|
|
|
18
12
|
const onTrackFacebook = socialTracking?.onTrackFacebook;
|
|
19
13
|
const onTrackInstagram = socialTracking?.onTrackInstagram;
|
|
20
14
|
let t0;
|
|
21
|
-
if ($[0] !==
|
|
15
|
+
if ($[0] !== onTrackContact || $[1] !== onTrackDevto || $[2] !== onTrackFacebook || $[3] !== onTrackGithub || $[4] !== onTrackInstagram || $[5] !== onTrackLinkedin || $[6] !== onTrackMedium || $[7] !== onTrackTwitter) {
|
|
22
16
|
t0 = { effects: {
|
|
23
|
-
onTrackHome,
|
|
24
|
-
onTrackBlog,
|
|
25
|
-
onTrackArt,
|
|
26
|
-
onTrackAboutMe,
|
|
27
|
-
onTrackArchive,
|
|
28
|
-
onTrackTags,
|
|
29
17
|
onTrackGithub,
|
|
30
18
|
onTrackLinkedin,
|
|
31
19
|
onTrackContact,
|
|
@@ -35,22 +23,16 @@ const useFooterStore = (navTracking, socialTracking) => {
|
|
|
35
23
|
onTrackFacebook,
|
|
36
24
|
onTrackInstagram
|
|
37
25
|
} };
|
|
38
|
-
$[0] =
|
|
39
|
-
$[1] =
|
|
40
|
-
$[2] =
|
|
41
|
-
$[3] =
|
|
42
|
-
$[4] =
|
|
43
|
-
$[5] =
|
|
44
|
-
$[6] =
|
|
45
|
-
$[7] =
|
|
46
|
-
$[8] =
|
|
47
|
-
|
|
48
|
-
$[10] = onTrackLinkedin;
|
|
49
|
-
$[11] = onTrackMedium;
|
|
50
|
-
$[12] = onTrackTags;
|
|
51
|
-
$[13] = onTrackTwitter;
|
|
52
|
-
$[14] = t0;
|
|
53
|
-
} else t0 = $[14];
|
|
26
|
+
$[0] = onTrackContact;
|
|
27
|
+
$[1] = onTrackDevto;
|
|
28
|
+
$[2] = onTrackFacebook;
|
|
29
|
+
$[3] = onTrackGithub;
|
|
30
|
+
$[4] = onTrackInstagram;
|
|
31
|
+
$[5] = onTrackLinkedin;
|
|
32
|
+
$[6] = onTrackMedium;
|
|
33
|
+
$[7] = onTrackTwitter;
|
|
34
|
+
$[8] = t0;
|
|
35
|
+
} else t0 = $[8];
|
|
54
36
|
return t0;
|
|
55
37
|
};
|
|
56
38
|
//#endregion
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { Menu, type MenuNavHrefs, type MenuProps, type MenuTrackingCallbacks };
|
|
1
|
+
import { Menu, MenuDropdown, MenuEntry, MenuGroup, MenuLink, MenuProps } from "./menu.mjs";
|
|
2
|
+
export { Menu, type MenuDropdown, type MenuEntry, type MenuGroup, type MenuLink, type MenuProps };
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { LinkComponent } from "../../atoms/links/anchor-link/anchor-link.mjs";
|
|
2
2
|
import "../../atoms/links/anchor-link/index.mjs";
|
|
3
|
-
import { MenuTrackingCallbacks } from "./use-menu-store.mjs";
|
|
4
3
|
import { FC } from "react";
|
|
5
4
|
//#region src/organism/menu/menu.d.ts
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
dsaRoadmap: string;
|
|
14
|
-
dsaExercises: string;
|
|
15
|
-
chat: string;
|
|
16
|
-
mcp: string;
|
|
17
|
-
easterEggHunt: string;
|
|
18
|
-
aboutMe: string;
|
|
19
|
-
art: string;
|
|
20
|
-
videogames: string;
|
|
21
|
-
contact: string;
|
|
5
|
+
export interface MenuLink {
|
|
6
|
+
label: string;
|
|
7
|
+
to: string;
|
|
8
|
+
external?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
/** Path prefixes that also mark this link selected (e.g. `/blog/author/`). */
|
|
11
|
+
activePathPrefixes?: string[];
|
|
22
12
|
}
|
|
13
|
+
export interface MenuGroup {
|
|
14
|
+
label: string;
|
|
15
|
+
items: MenuLink[];
|
|
16
|
+
}
|
|
17
|
+
export interface MenuDropdown {
|
|
18
|
+
label: string;
|
|
19
|
+
groups: MenuGroup[];
|
|
20
|
+
}
|
|
21
|
+
export type MenuEntry = MenuLink | MenuDropdown;
|
|
23
22
|
export interface MenuProps {
|
|
24
23
|
linkComponent?: LinkComponent;
|
|
25
24
|
/** The path currently being viewed, used to mark the active entry. Injected by the consumer's router. */
|
|
26
25
|
currentPath: string;
|
|
27
|
-
|
|
26
|
+
/** The navigation tree, in display order: top-level links and dropdowns of grouped links. */
|
|
27
|
+
entries: MenuEntry[];
|
|
28
|
+
/** Paths on which the menu never hides on scroll. */
|
|
29
|
+
pinnedOnPaths?: string[];
|
|
28
30
|
onPaletteTrigger?: () => void;
|
|
29
|
-
tracking?: MenuTrackingCallbacks;
|
|
30
31
|
}
|
|
31
32
|
export declare const Menu: FC<MenuProps>;
|
|
32
33
|
//#endregion
|