@astronox/core 0.1.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/LICENSE +21 -0
- package/README.md +66 -0
- package/package.json +77 -0
- package/src/client/clipboard.ts +7 -0
- package/src/client/focus.ts +17 -0
- package/src/client/index.ts +3 -0
- package/src/client/scroll.ts +15 -0
- package/src/components/actions/ActionListItem/ActionListItem.astro +78 -0
- package/src/components/actions/ActionListItem/ActionListItem.css +43 -0
- package/src/components/actions/Button/Button.astro +100 -0
- package/src/components/actions/Button/Button.css +165 -0
- package/src/components/actions/CardAction/CardAction.astro +97 -0
- package/src/components/actions/CardAction/CardAction.css +188 -0
- package/src/components/actions/MediaTrigger/MediaTrigger.astro +55 -0
- package/src/components/actions/MediaTrigger/MediaTrigger.css +175 -0
- package/src/components/actions/ScrollToTop/ScrollToTop.astro +36 -0
- package/src/components/actions/ScrollToTop/ScrollToTop.css +19 -0
- package/src/components/actions/ScrollToTop/scrollToTopController.ts +32 -0
- package/src/components/content/CardBody/CardBody.astro +31 -0
- package/src/components/content/CardBody/CardBody.css +74 -0
- package/src/components/content/CardFooter/CardFooter.astro +58 -0
- package/src/components/content/CardFooter/CardFooter.css +102 -0
- package/src/components/content/CardHeader/CardHeader.astro +96 -0
- package/src/components/content/CardHeader/CardHeader.css +164 -0
- package/src/components/content/CardLink/CardLink.astro +138 -0
- package/src/components/content/CardLink/CardLink.css +362 -0
- package/src/components/content/CodeBlock/CodeBlock.astro +102 -0
- package/src/components/content/CodeBlock/CodeBlock.css +85 -0
- package/src/components/content/CodeBlock/codeBlockController.ts +60 -0
- package/src/components/content/CodeBlock/contracts.ts +8 -0
- package/src/components/content/InlineDefinition/InlineDefinition.astro +31 -0
- package/src/components/content/InlineDefinition/InlineDefinition.css +9 -0
- package/src/components/content/MarkdownContent/MarkdownContent.astro +32 -0
- package/src/components/content/MarkdownContent/MarkdownContent.css +358 -0
- package/src/components/content/MarkdownContent/MarkdownInline.astro +44 -0
- package/src/components/content/MarkdownContent/MarkdownNode.astro +280 -0
- package/src/components/content/MarkdownContent/MarkdownSymbol.astro +47 -0
- package/src/components/content/MarkdownContent/contracts.ts +181 -0
- package/src/components/data-display/BadgeList/BadgeList.astro +54 -0
- package/src/components/data-display/BadgeList/BadgeList.css +29 -0
- package/src/components/data-display/IconList/IconList.astro +64 -0
- package/src/components/data-display/IconList/IconList.css +55 -0
- package/src/components/data-display/MetricTile/MetricTile.astro +68 -0
- package/src/components/data-display/MetricTile/MetricTile.css +103 -0
- package/src/components/data-display/MetricTile/MetricTileContent.astro +70 -0
- package/src/components/data-display/MetricTile/metricTileController.ts +9 -0
- package/src/components/data-display/Tag/Tag.astro +67 -0
- package/src/components/data-display/Tag/Tag.css +134 -0
- package/src/components/data-display/Tag/TagAffix.astro +33 -0
- package/src/components/data-display/TextPair/TextPair.astro +63 -0
- package/src/components/data-display/TextPair/TextPair.css +99 -0
- package/src/components/feedback/Spinner/Spinner.astro +32 -0
- package/src/components/feedback/Spinner/Spinner.css +37 -0
- package/src/components/feedback/Tooltip/Tooltip.astro +66 -0
- package/src/components/feedback/Tooltip/Tooltip.css +67 -0
- package/src/components/feedback/Tooltip/tooltipController.ts +371 -0
- package/src/components/forms/FieldError/FieldError.astro +31 -0
- package/src/components/forms/FieldError/FieldError.css +12 -0
- package/src/components/forms/FieldError/fieldErrorState.ts +21 -0
- package/src/components/forms/FieldLabel/FieldLabel.astro +32 -0
- package/src/components/forms/FieldLabel/FieldLabel.css +17 -0
- package/src/components/forms/TextInput/TextInput.astro +79 -0
- package/src/components/forms/TextInput/TextInput.css +121 -0
- package/src/components/forms/TextInput/textInputController.ts +53 -0
- package/src/components/icons/ArrowDownIcon.astro +26 -0
- package/src/components/icons/ArrowLeftIcon.astro +26 -0
- package/src/components/icons/ArrowRightIcon.astro +26 -0
- package/src/components/icons/ArrowUpDownIcon.astro +26 -0
- package/src/components/icons/ArrowUpIcon.astro +26 -0
- package/src/components/icons/BulletIcon.astro +21 -0
- package/src/components/icons/BurnIcon.astro +24 -0
- package/src/components/icons/CircleSymbolIcon.css +66 -0
- package/src/components/icons/ClearIcon.astro +28 -0
- package/src/components/icons/CloseIcon.astro +21 -0
- package/src/components/icons/CopyIcon.astro +30 -0
- package/src/components/icons/CurrencyIcon.css +9 -0
- package/src/components/icons/DayIcon.astro +33 -0
- package/src/components/icons/DollarIcon.astro +28 -0
- package/src/components/icons/DownloadIcon.astro +22 -0
- package/src/components/icons/EnterFullscreenIcon.astro +22 -0
- package/src/components/icons/EqualIcon.astro +25 -0
- package/src/components/icons/ExitFullscreenIcon.astro +22 -0
- package/src/components/icons/ExternalLinkIcon.astro +22 -0
- package/src/components/icons/FieldIcon.astro +28 -0
- package/src/components/icons/GrassIcon.astro +29 -0
- package/src/components/icons/InfoIcon.astro +24 -0
- package/src/components/icons/MinusIcon.astro +21 -0
- package/src/components/icons/MountainIcon.astro +31 -0
- package/src/components/icons/NightIcon.astro +32 -0
- package/src/components/icons/PlayIcon.astro +22 -0
- package/src/components/icons/PlusIcon.astro +21 -0
- package/src/components/icons/PoisonIcon.astro +24 -0
- package/src/components/icons/RibbonIcon.astro +25 -0
- package/src/components/icons/SlashIcon.astro +22 -0
- package/src/components/icons/SlowIcon.astro +25 -0
- package/src/components/icons/StarIcon.astro +28 -0
- package/src/components/icons/StunIcon.astro +22 -0
- package/src/components/icons/TableSortIcon.astro +34 -0
- package/src/components/icons/WaterIcon.astro +30 -0
- package/src/components/index.ts +83 -0
- package/src/components/media/CanvasFrame/CanvasFrame.astro +130 -0
- package/src/components/media/CanvasFrame/CanvasFrame.css +59 -0
- package/src/components/media/CanvasFrame/canvasFrameController.ts +104 -0
- package/src/components/media/EmbedFrame/EmbedFrame.astro +147 -0
- package/src/components/media/EmbedFrame/EmbedFrame.css +51 -0
- package/src/components/media/EmbedFrame/embedFrameController.ts +66 -0
- package/src/components/media/MediaFrame/MediaFrame.astro +34 -0
- package/src/components/media/MediaFrame/MediaFrame.css +66 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.astro +55 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.css +89 -0
- package/src/components/navigation/DesktopNavigation.astro +92 -0
- package/src/components/navigation/DesktopNavigation.css +99 -0
- package/src/components/navigation/Header.astro +73 -0
- package/src/components/navigation/Header.css +20 -0
- package/src/components/navigation/MobileNavigation.astro +124 -0
- package/src/components/navigation/MobileNavigation.css +177 -0
- package/src/components/navigation/NavigationBrand.astro +63 -0
- package/src/components/navigation/NavigationBrand.css +52 -0
- package/src/components/navigation/NavigationControl.css +166 -0
- package/src/components/navigation/NavigationItemContent.astro +24 -0
- package/src/components/navigation/NavigationLink.astro +121 -0
- package/src/components/navigation/NavigationLinks.astro +27 -0
- package/src/components/navigation/NavigationMenuList.astro +37 -0
- package/src/components/navigation/NavigationMenuList.css +6 -0
- package/src/components/navigation/SkipLink/SkipLink.astro +18 -0
- package/src/components/navigation/SkipLink/SkipLink.css +26 -0
- package/src/components/navigation/SubNavigation/SubNavigation.astro +124 -0
- package/src/components/navigation/SubNavigation/SubNavigation.css +211 -0
- package/src/components/navigation/mobileNavigationController.ts +122 -0
- package/src/components/navigation/navigationState.ts +35 -0
- package/src/components/navigation/navigationTypes.ts +18 -0
- package/src/components/seo/SeoHead.astro +194 -0
- package/src/components/widgetTypes.ts +3 -0
- package/src/composition/Grid/Grid.astro +82 -0
- package/src/composition/Grid/Grid.css +314 -0
- package/src/composition/GridItem/GridItem.astro +50 -0
- package/src/composition/GridItem/GridItem.css +95 -0
- package/src/composition/Inline/Inline.astro +48 -0
- package/src/composition/Inline/Inline.css +65 -0
- package/src/composition/Stack/Stack.astro +37 -0
- package/src/composition/Stack/Stack.css +31 -0
- package/src/composition/SurfaceGroup/SurfaceGroup.astro +44 -0
- package/src/composition/SurfaceGroup/SurfaceGroup.css +76 -0
- package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +89 -0
- package/src/composition/index.ts +6 -0
- package/src/config/index.ts +2 -0
- package/src/config/pageMeta.ts +55 -0
- package/src/config/siteConfig.ts +90 -0
- package/src/data/collectionValidation.ts +61 -0
- package/src/data/index.ts +1 -0
- package/src/display/contracts.ts +284 -0
- package/src/display/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/layouts/BaseLayout.astro +74 -0
- package/src/layouts/PageSurface.astro +15 -0
- package/src/layouts/PageSurface.css +24 -0
- package/src/layouts/index.ts +2 -0
- package/src/patterns/CircuitPuzzle/CircuitPuzzle.astro +93 -0
- package/src/patterns/CircuitPuzzle/CircuitPuzzle.css +118 -0
- package/src/patterns/CircuitPuzzle/circuitPuzzleController.ts +205 -0
- package/src/patterns/CircuitPuzzle/contracts.ts +42 -0
- package/src/patterns/Combobox/Combobox.astro +462 -0
- package/src/patterns/Combobox/Combobox.css +403 -0
- package/src/patterns/Combobox/comboboxController.ts +788 -0
- package/src/patterns/Combobox/contracts.ts +18 -0
- package/src/patterns/Dropdown/Dropdown.astro +127 -0
- package/src/patterns/Dropdown/Dropdown.css +100 -0
- package/src/patterns/Dropdown/dropdownController.ts +157 -0
- package/src/patterns/Fullscreen/FullscreenControl.astro +103 -0
- package/src/patterns/Fullscreen/FullscreenControl.css +49 -0
- package/src/patterns/Fullscreen/fullscreenController.ts +73 -0
- package/src/patterns/GlitchOverlay/GlitchOverlay.astro +50 -0
- package/src/patterns/GlitchOverlay/GlitchOverlay.css +234 -0
- package/src/patterns/GlitchOverlay/glitchOverlayController.ts +152 -0
- package/src/patterns/GuidedFlow/GuidedFlow.astro +60 -0
- package/src/patterns/GuidedFlow/GuidedFlow.css +82 -0
- package/src/patterns/GuidedFlow/contracts.ts +3 -0
- package/src/patterns/GuidedFlow/guidedFlowController.ts +49 -0
- package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.astro +217 -0
- package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.css +383 -0
- package/src/patterns/MagneticFieldPuzzle/contracts.ts +81 -0
- package/src/patterns/MagneticFieldPuzzle/magneticFieldPuzzleController.ts +802 -0
- package/src/patterns/MagneticFieldPuzzle/simulation.ts +244 -0
- package/src/patterns/MapViewport/MapViewport.astro +296 -0
- package/src/patterns/MapViewport/MapViewport.css +257 -0
- package/src/patterns/MapViewport/contracts.ts +79 -0
- package/src/patterns/MapViewport/geometry.ts +80 -0
- package/src/patterns/MapViewport/mapViewportController.ts +636 -0
- package/src/patterns/Modal/Modal.astro +64 -0
- package/src/patterns/Modal/Modal.css +87 -0
- package/src/patterns/Modal/ModalClose.astro +37 -0
- package/src/patterns/Modal/ModalOpen.astro +36 -0
- package/src/patterns/Modal/modalController.ts +118 -0
- package/src/patterns/PuzzleGrid/PuzzleGrid.astro +22 -0
- package/src/patterns/PuzzleGrid/PuzzleGrid.css +149 -0
- package/src/patterns/PuzzleGrid/contracts.ts +2 -0
- package/src/patterns/PuzzleGrid/selectionDismissal.ts +27 -0
- package/src/patterns/PuzzleGrid/state.ts +25 -0
- package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.astro +65 -0
- package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.css +35 -0
- package/src/patterns/SpriteProjectilePreview/contracts.ts +33 -0
- package/src/patterns/SpriteProjectilePreview/spriteProjectilePreviewController.ts +586 -0
- package/src/patterns/StageFlow/StageFlow.astro +57 -0
- package/src/patterns/StageFlow/StageFlow.css +54 -0
- package/src/patterns/StageFlow/StageFlowAlternative.astro +23 -0
- package/src/patterns/StageFlow/StageFlowArrow.astro +22 -0
- package/src/patterns/StageFlow/StageFlowConnector.astro +7 -0
- package/src/patterns/StageFlow/StageFlowConnector.css +4 -0
- package/src/patterns/StageFlow/StageFlowStage.astro +51 -0
- package/src/patterns/StageFlow/StageFlowStage.css +106 -0
- package/src/patterns/StageFlow/StageFlowStep.astro +24 -0
- package/src/patterns/StageFlow/StageFlowStep.css +19 -0
- package/src/patterns/StageFlow/StageFlowSymbol.css +28 -0
- package/src/patterns/Table/Table.astro +176 -0
- package/src/patterns/Table/Table.css +70 -0
- package/src/patterns/Table/TableBody.astro +185 -0
- package/src/patterns/Table/TableBody.css +262 -0
- package/src/patterns/Table/TableCell.astro +59 -0
- package/src/patterns/Table/TableCell.css +99 -0
- package/src/patterns/Table/TableCellValue.astro +86 -0
- package/src/patterns/Table/TableFooter.astro +32 -0
- package/src/patterns/Table/TableFooter.css +31 -0
- package/src/patterns/Table/TableHeader.astro +118 -0
- package/src/patterns/Table/TableHeader.css +209 -0
- package/src/patterns/Table/TablePagination.astro +70 -0
- package/src/patterns/Table/TablePagination.css +133 -0
- package/src/patterns/Table/TableSkeleton.astro +36 -0
- package/src/patterns/Table/TableSkeleton.css +81 -0
- package/src/patterns/Table/tableCellController.ts +11 -0
- package/src/patterns/Table/tableFilterController.ts +206 -0
- package/src/patterns/Table/tableHeaderOverflowController.ts +105 -0
- package/src/patterns/Table/tableLayout.ts +113 -0
- package/src/patterns/Table/tableProgressiveController.ts +319 -0
- package/src/patterns/Table/tableRowNavigationController.ts +91 -0
- package/src/patterns/Table/tableScrollController.ts +192 -0
- package/src/patterns/Table/tableSortController.ts +272 -0
- package/src/patterns/index.ts +46 -0
- package/src/primitives/index.ts +4 -0
- package/src/primitives/layout/Separator/Separator.astro +29 -0
- package/src/primitives/layout/Separator/Separator.css +20 -0
- package/src/primitives/media/AmbientAudio/AmbientAudio.astro +28 -0
- package/src/primitives/media/Media/Media.astro +122 -0
- package/src/primitives/media/Media/Media.css +161 -0
- package/src/primitives/text/TextBlock/TextBlock.astro +46 -0
- package/src/primitives/text/TextBlock/TextBlock.css +21 -0
- package/src/seo/StaticRedirect.astro +32 -0
- package/src/seo/index.ts +6 -0
- package/src/seo/pageSeo.ts +99 -0
- package/src/seo/robots.ts +16 -0
- package/src/seo/sitemap.ts +38 -0
- package/src/seo/structuredData.ts +133 -0
- package/src/seo/url.ts +64 -0
- package/src/styles/base.css +148 -0
- package/src/styles/interaction.css +108 -0
- package/src/styles/style.css +93 -0
- package/src/styles/tokens.css +256 -0
- package/src/theme/contracts.ts +7 -0
- package/src/theme/index.ts +1 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.site-nav__desktop {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.site-nav__dropdown-link {
|
|
6
|
+
border-radius: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media (width >= 72rem) {
|
|
10
|
+
.site-nav__desktop {
|
|
11
|
+
--site-nav-track-block-size: var(
|
|
12
|
+
--site-header-desktop-track-block-size,
|
|
13
|
+
calc(var(--nox-site-header-height) - var(--nox-border-width))
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
display: grid;
|
|
17
|
+
width: var(--nox-page-width);
|
|
18
|
+
block-size: var(--site-nav-track-block-size);
|
|
19
|
+
margin: 0 auto;
|
|
20
|
+
grid-template-columns:
|
|
21
|
+
minmax(0, 1fr) max-content
|
|
22
|
+
minmax(0, 1fr);
|
|
23
|
+
grid-template-rows: minmax(0, 1fr);
|
|
24
|
+
align-items: stretch;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.site-nav__side {
|
|
28
|
+
display: flex;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
min-height: 0;
|
|
31
|
+
block-size: 100%;
|
|
32
|
+
align-items: stretch;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.site-nav__group {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex: 1 1 0;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
min-height: 0;
|
|
40
|
+
block-size: 100%;
|
|
41
|
+
align-items: stretch;
|
|
42
|
+
gap: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.site-nav__group .dropdown {
|
|
46
|
+
align-self: stretch;
|
|
47
|
+
block-size: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.site-nav__group--left {
|
|
51
|
+
justify-content: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.site-nav__group--right {
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.site-nav__brand--desktop {
|
|
59
|
+
--site-nav-brand-block: var(--site-nav-track-block-size);
|
|
60
|
+
--site-nav-brand-inline: max-content;
|
|
61
|
+
|
|
62
|
+
block-size: 100%;
|
|
63
|
+
max-inline-size: min(26rem, 42vw);
|
|
64
|
+
justify-self: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.site-nav__action {
|
|
68
|
+
z-index: 3;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex: 0 0 auto;
|
|
71
|
+
align-items: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.site-nav__action--start {
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.site-nav__action--end {
|
|
79
|
+
justify-content: flex-end;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.site-nav__action > * {
|
|
83
|
+
min-width: 5.75rem;
|
|
84
|
+
border-radius: var(--nox-radius-md);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.site-nav__action
|
|
88
|
+
> .dropdown[data-dropdown-trigger-appearance='bar'] {
|
|
89
|
+
min-width: 0;
|
|
90
|
+
block-size: 100%;
|
|
91
|
+
border-radius: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.site-nav__action
|
|
95
|
+
.dropdown:not([data-dropdown-trigger-appearance='bar'])
|
|
96
|
+
> [data-dropdown-trigger] {
|
|
97
|
+
inline-size: 100%;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { SiteIdentity } from '../../config/siteConfig';
|
|
4
|
+
import type { MobileNavigationLabels } from './navigationTypes';
|
|
5
|
+
import type { NavigationItem } from '../../display/contracts';
|
|
6
|
+
import type { Tone } from '../../theme/contracts';
|
|
7
|
+
import DesktopNavigation from './DesktopNavigation.astro';
|
|
8
|
+
import MobileNavigation from './MobileNavigation.astro';
|
|
9
|
+
|
|
10
|
+
type Props = HTMLAttributes<'header'> & {
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
currentPath: string;
|
|
13
|
+
homeHref: string;
|
|
14
|
+
homeLabel: string;
|
|
15
|
+
identity: SiteIdentity;
|
|
16
|
+
leftItems?: readonly NavigationItem[];
|
|
17
|
+
menu: MobileNavigationLabels;
|
|
18
|
+
rightItems?: readonly NavigationItem[];
|
|
19
|
+
sticky?: boolean;
|
|
20
|
+
tone?: Tone;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
ariaLabel,
|
|
25
|
+
class: className,
|
|
26
|
+
currentPath,
|
|
27
|
+
'data-tone': dataTone,
|
|
28
|
+
homeHref,
|
|
29
|
+
homeLabel,
|
|
30
|
+
identity,
|
|
31
|
+
leftItems = [],
|
|
32
|
+
menu,
|
|
33
|
+
rightItems = [],
|
|
34
|
+
sticky = false,
|
|
35
|
+
tone,
|
|
36
|
+
...attrs
|
|
37
|
+
} = Astro.props;
|
|
38
|
+
const resolvedTone = tone ?? dataTone;
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<header
|
|
42
|
+
{...attrs}
|
|
43
|
+
class:list={['site-header', className]}
|
|
44
|
+
data-site-header
|
|
45
|
+
data-site-header-sticky={sticky ? true : undefined}
|
|
46
|
+
data-tone={resolvedTone}
|
|
47
|
+
>
|
|
48
|
+
<nav class="site-nav" aria-label={ariaLabel}>
|
|
49
|
+
<MobileNavigation
|
|
50
|
+
identity={identity}
|
|
51
|
+
homeHref={homeHref}
|
|
52
|
+
homeLabel={homeLabel}
|
|
53
|
+
leftItems={leftItems}
|
|
54
|
+
menu={menu}
|
|
55
|
+
rightItems={rightItems}
|
|
56
|
+
currentPath={currentPath}
|
|
57
|
+
>
|
|
58
|
+
<slot name="mobile-actions" slot="actions" />
|
|
59
|
+
</MobileNavigation>
|
|
60
|
+
|
|
61
|
+
<DesktopNavigation
|
|
62
|
+
identity={identity}
|
|
63
|
+
homeHref={homeHref}
|
|
64
|
+
homeLabel={homeLabel}
|
|
65
|
+
leftItems={leftItems}
|
|
66
|
+
rightItems={rightItems}
|
|
67
|
+
currentPath={currentPath}
|
|
68
|
+
>
|
|
69
|
+
<slot name="desktop-leading-actions" slot="leading-actions" />
|
|
70
|
+
<slot name="desktop-actions" slot="actions" />
|
|
71
|
+
</DesktopNavigation>
|
|
72
|
+
</nav>
|
|
73
|
+
</header>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.site-header {
|
|
2
|
+
--site-header-border-width: var(--nox-border-width);
|
|
3
|
+
--site-header-desktop-track-block-size: calc(
|
|
4
|
+
var(--nox-site-header-height) - var(--site-header-border-width)
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
z-index: 50;
|
|
8
|
+
top: 0;
|
|
9
|
+
border-bottom: var(--site-header-border-width) solid var(--nox-border);
|
|
10
|
+
background: color-mix(in srgb, var(--nox-surface) 94%, transparent);
|
|
11
|
+
backdrop-filter: blur(14px);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.site-header[data-site-header-sticky] {
|
|
15
|
+
position: sticky;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.site-nav {
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SiteIdentity } from '../../config/siteConfig';
|
|
3
|
+
import type { NavigationItem } from '../../display/contracts';
|
|
4
|
+
import type { MobileNavigationLabels } from './navigationTypes';
|
|
5
|
+
import NavigationBrand from './NavigationBrand.astro';
|
|
6
|
+
import NavigationLink from './NavigationLink.astro';
|
|
7
|
+
import { isNavigationGroupItem } from './navigationState';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
currentPath: string;
|
|
11
|
+
homeHref: string;
|
|
12
|
+
homeLabel: string;
|
|
13
|
+
identity: SiteIdentity;
|
|
14
|
+
leftItems: readonly NavigationItem[];
|
|
15
|
+
menu: MobileNavigationLabels;
|
|
16
|
+
rightItems: readonly NavigationItem[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type MobileNavigationGroup = {
|
|
20
|
+
items: readonly NavigationItem[];
|
|
21
|
+
label?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
currentPath,
|
|
26
|
+
homeHref,
|
|
27
|
+
homeLabel,
|
|
28
|
+
identity,
|
|
29
|
+
leftItems,
|
|
30
|
+
menu,
|
|
31
|
+
rightItems,
|
|
32
|
+
} = Astro.props;
|
|
33
|
+
const panelId = 'site-nav-mobile-panel';
|
|
34
|
+
const closeLabel = menu.closeLabel ?? menu.openLabel;
|
|
35
|
+
const mobileGroups: MobileNavigationGroup[] = [
|
|
36
|
+
{
|
|
37
|
+
items: leftItems,
|
|
38
|
+
},
|
|
39
|
+
...rightItems.map((item) =>
|
|
40
|
+
isNavigationGroupItem(item)
|
|
41
|
+
? {
|
|
42
|
+
label: item.label,
|
|
43
|
+
items: item.items,
|
|
44
|
+
}
|
|
45
|
+
: {
|
|
46
|
+
items: [item],
|
|
47
|
+
},
|
|
48
|
+
),
|
|
49
|
+
];
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
<div class="site-nav__mobile" data-mobile-navigation>
|
|
53
|
+
<div class="site-nav__mobile-bar">
|
|
54
|
+
<button
|
|
55
|
+
class="site-nav__menu-button"
|
|
56
|
+
type="button"
|
|
57
|
+
aria-label={menu.openLabel}
|
|
58
|
+
aria-controls={panelId}
|
|
59
|
+
aria-expanded="false"
|
|
60
|
+
data-mobile-navigation-trigger
|
|
61
|
+
data-mobile-navigation-open-label={menu.openLabel}
|
|
62
|
+
data-mobile-navigation-close-label={closeLabel}
|
|
63
|
+
>
|
|
64
|
+
<span class="site-nav__menu-icon" aria-hidden="true">
|
|
65
|
+
<span class="site-nav__menu-line"></span>
|
|
66
|
+
<span class="site-nav__menu-line"></span>
|
|
67
|
+
<span class="site-nav__menu-line"></span>
|
|
68
|
+
</span>
|
|
69
|
+
</button>
|
|
70
|
+
|
|
71
|
+
<NavigationBrand
|
|
72
|
+
identity={identity}
|
|
73
|
+
href={homeHref}
|
|
74
|
+
label={homeLabel}
|
|
75
|
+
class="site-nav__brand--mobile"
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
<div class="site-nav__mobile-action">
|
|
79
|
+
<slot name="actions" />
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div
|
|
84
|
+
class="site-nav__mobile-panel"
|
|
85
|
+
id={panelId}
|
|
86
|
+
hidden
|
|
87
|
+
data-mobile-navigation-panel
|
|
88
|
+
>
|
|
89
|
+
<ul class="site-nav__mobile-list">
|
|
90
|
+
{
|
|
91
|
+
mobileGroups.map((group) => (
|
|
92
|
+
<>
|
|
93
|
+
{group.label ? (
|
|
94
|
+
<li class="site-nav__mobile-group-label">
|
|
95
|
+
<span>{group.label}</span>
|
|
96
|
+
</li>
|
|
97
|
+
) : null}
|
|
98
|
+
{group.items.map((item) => (
|
|
99
|
+
<li>
|
|
100
|
+
<NavigationLink
|
|
101
|
+
item={item}
|
|
102
|
+
currentPath={currentPath}
|
|
103
|
+
accent="start"
|
|
104
|
+
appearance="menu"
|
|
105
|
+
class="site-nav__mobile-link"
|
|
106
|
+
/>
|
|
107
|
+
</li>
|
|
108
|
+
))}
|
|
109
|
+
</>
|
|
110
|
+
))
|
|
111
|
+
}
|
|
112
|
+
</ul>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<script>
|
|
117
|
+
import { initMobileNavigation } from './mobileNavigationController';
|
|
118
|
+
|
|
119
|
+
for (const root of document.querySelectorAll('[data-mobile-navigation]')) {
|
|
120
|
+
if (root instanceof HTMLElement) {
|
|
121
|
+
initMobileNavigation(root);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</script>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
.site-nav__mobile {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.site-nav__mobile-bar {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
10
|
+
align-items: center;
|
|
11
|
+
width: var(--nox-page-width);
|
|
12
|
+
min-height: var(--nox-site-header-compact-height);
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
gap: clamp(var(--nox-space-1), 2vw, var(--nox-space-3));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.site-nav__menu-button {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
width: 2.5rem;
|
|
20
|
+
height: 2.5rem;
|
|
21
|
+
flex: 0 0 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
padding: var(--nox-space-2);
|
|
26
|
+
gap: 0.28rem;
|
|
27
|
+
border: var(--nox-border-width) solid var(--nox-border);
|
|
28
|
+
border-radius: var(--nox-radius-md);
|
|
29
|
+
background: var(--nox-surface);
|
|
30
|
+
color: var(--nox-text);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.site-nav__menu-icon {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: grid;
|
|
37
|
+
width: 1.35rem;
|
|
38
|
+
height: 1rem;
|
|
39
|
+
place-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.site-nav__menu-line {
|
|
43
|
+
position: absolute;
|
|
44
|
+
width: 1.35rem;
|
|
45
|
+
height: 0.15rem;
|
|
46
|
+
border-radius: var(--nox-radius-pill);
|
|
47
|
+
background: currentColor;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.site-nav__menu-line:nth-child(1) {
|
|
51
|
+
transform: translateY(-0.38rem);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.site-nav__menu-line:nth-child(3) {
|
|
55
|
+
transform: translateY(0.38rem);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.site-nav__mobile[data-mobile-navigation-open]
|
|
59
|
+
.site-nav__menu-line:nth-child(1) {
|
|
60
|
+
transform: rotate(45deg);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.site-nav__mobile[data-mobile-navigation-open]
|
|
64
|
+
.site-nav__menu-line:nth-child(2) {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.site-nav__mobile[data-mobile-navigation-open]
|
|
69
|
+
.site-nav__menu-line:nth-child(3) {
|
|
70
|
+
transform: rotate(-45deg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.site-nav__brand--mobile {
|
|
74
|
+
z-index: 1;
|
|
75
|
+
justify-self: stretch;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.site-nav__mobile-action {
|
|
79
|
+
z-index: 2;
|
|
80
|
+
justify-self: end;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.site-nav__mobile-action > * {
|
|
84
|
+
min-width: 4.75rem;
|
|
85
|
+
border-radius: var(--nox-radius-md);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.site-nav__mobile-action
|
|
89
|
+
> .dropdown[data-dropdown-trigger-appearance='bar'] {
|
|
90
|
+
min-width: 0;
|
|
91
|
+
block-size: var(--nox-site-header-compact-height);
|
|
92
|
+
border-radius: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.site-nav__mobile-action
|
|
96
|
+
.dropdown:not([data-dropdown-trigger-appearance='bar'])
|
|
97
|
+
> [data-dropdown-trigger] {
|
|
98
|
+
inline-size: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.site-nav__mobile-panel {
|
|
102
|
+
position: absolute;
|
|
103
|
+
z-index: 2;
|
|
104
|
+
inset-inline: 0;
|
|
105
|
+
top: 100%;
|
|
106
|
+
width: 100%;
|
|
107
|
+
max-height: calc(100vh - var(--nox-site-header-compact-height));
|
|
108
|
+
max-height: calc(100dvh - var(--nox-site-header-compact-height));
|
|
109
|
+
overflow-x: hidden;
|
|
110
|
+
overflow-y: auto;
|
|
111
|
+
padding: var(--nox-space-3);
|
|
112
|
+
border-top: 3px solid var(--nox-link-active);
|
|
113
|
+
border-bottom: var(--nox-border-width) solid var(--nox-border);
|
|
114
|
+
border-end-start-radius: var(--nox-radius-md);
|
|
115
|
+
border-end-end-radius: var(--nox-radius-md);
|
|
116
|
+
background: var(--nox-surface);
|
|
117
|
+
box-shadow: var(--nox-shadow-surface);
|
|
118
|
+
overscroll-behavior: contain;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.site-nav__mobile-panel[hidden] {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.site-nav__mobile-list {
|
|
126
|
+
display: grid;
|
|
127
|
+
width: 100%;
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding: 0;
|
|
130
|
+
gap: var(--nox-space-1);
|
|
131
|
+
list-style: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.site-nav__mobile-link {
|
|
135
|
+
min-height: 3.125rem;
|
|
136
|
+
padding-block: 0;
|
|
137
|
+
border-radius: var(--nox-radius-sm);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.site-nav__mobile-group-label {
|
|
141
|
+
display: flex;
|
|
142
|
+
min-height: 1.5rem;
|
|
143
|
+
align-items: flex-end;
|
|
144
|
+
margin-top: var(--nox-space-2);
|
|
145
|
+
padding: var(--nox-space-2) var(--nox-space-4) 0;
|
|
146
|
+
color: var(--nox-text-subtle);
|
|
147
|
+
font-size: var(--nox-font-size-xs);
|
|
148
|
+
font-weight: var(--nox-font-weight-strong);
|
|
149
|
+
letter-spacing: var(--nox-letter-spacing-wider);
|
|
150
|
+
line-height: 1;
|
|
151
|
+
text-transform: uppercase;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
html[data-mobile-navigation-open],
|
|
155
|
+
html[data-mobile-navigation-open] body {
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media (width >= 72rem) {
|
|
160
|
+
.site-nav__mobile {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@media (hover: hover) {
|
|
166
|
+
.site-nav__menu-button:hover {
|
|
167
|
+
background: var(--nox-surface-muted);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
172
|
+
.site-nav__menu-line {
|
|
173
|
+
transition:
|
|
174
|
+
opacity var(--nox-motion-duration-sm) var(--nox-motion-easing-standard),
|
|
175
|
+
transform var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { SiteIdentity } from '../../config/siteConfig';
|
|
4
|
+
import type { Tone } from '../../theme/contracts';
|
|
5
|
+
import Media from '../../primitives/media/Media/Media.astro';
|
|
6
|
+
|
|
7
|
+
type Props = Omit<HTMLAttributes<'a'>, 'href'> & {
|
|
8
|
+
identity: SiteIdentity;
|
|
9
|
+
class?: string;
|
|
10
|
+
'data-tone'?: Tone;
|
|
11
|
+
href: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
class: className,
|
|
17
|
+
'data-tone': dataTone,
|
|
18
|
+
href,
|
|
19
|
+
identity,
|
|
20
|
+
label,
|
|
21
|
+
...attrs
|
|
22
|
+
}: Props = Astro.props;
|
|
23
|
+
const logo = identity.logo;
|
|
24
|
+
const logoAspectRatio = logo ? `${logo.width} / ${logo.height}` : undefined;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<a
|
|
28
|
+
{...attrs}
|
|
29
|
+
class:list={['site-nav__brand', className]}
|
|
30
|
+
href={href}
|
|
31
|
+
aria-label={label}
|
|
32
|
+
data-tone={dataTone}
|
|
33
|
+
>
|
|
34
|
+
{
|
|
35
|
+
logo ? (
|
|
36
|
+
<div
|
|
37
|
+
class="site-nav__brand-logo-frame"
|
|
38
|
+
style={`--site-nav-brand-logo-aspect-ratio: ${logoAspectRatio};`}
|
|
39
|
+
>
|
|
40
|
+
<Media
|
|
41
|
+
class="site-nav__brand-logo"
|
|
42
|
+
media={{
|
|
43
|
+
src: logo.src,
|
|
44
|
+
alt: logo.alt,
|
|
45
|
+
width: logo.width,
|
|
46
|
+
height: logo.height,
|
|
47
|
+
loading: 'eager',
|
|
48
|
+
decoding: 'sync',
|
|
49
|
+
fetchPriority: 'high',
|
|
50
|
+
}}
|
|
51
|
+
fit="contain"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
) : (
|
|
55
|
+
<>
|
|
56
|
+
<span class="site-nav__brand-name">{identity.name}</span>
|
|
57
|
+
{identity.shortName ? (
|
|
58
|
+
<span class="site-nav__brand-detail">{identity.shortName}</span>
|
|
59
|
+
) : null}
|
|
60
|
+
</>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
</a>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.site-nav__brand {
|
|
2
|
+
--site-nav-brand-block: var(--nox-site-header-height);
|
|
3
|
+
--site-nav-brand-inline: min(26rem, 42vw);
|
|
4
|
+
--site-nav-brand-image-scale: 58%;
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
width: var(--site-nav-brand-inline);
|
|
10
|
+
block-size: var(--site-nav-brand-block);
|
|
11
|
+
min-width: 0;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
color: var(--nox-text);
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.site-nav__brand-logo-frame {
|
|
18
|
+
display: grid;
|
|
19
|
+
block-size: var(--site-nav-brand-image-scale);
|
|
20
|
+
max-inline-size: 100%;
|
|
21
|
+
aspect-ratio: var(--site-nav-brand-logo-aspect-ratio);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.site-nav__brand-logo-frame [data-widget='media'] {
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
block-size: 100%;
|
|
27
|
+
--media-object-inline-size: auto;
|
|
28
|
+
--media-object-block-size: auto;
|
|
29
|
+
--media-object-max-inline-size: 100%;
|
|
30
|
+
--media-object-max-block-size: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.site-nav__brand--mobile {
|
|
34
|
+
--site-nav-brand-block: var(--nox-site-header-compact-height);
|
|
35
|
+
--site-nav-brand-inline: 100%;
|
|
36
|
+
--site-nav-brand-image-scale: 56%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.site-nav__brand-name {
|
|
40
|
+
font-size: var(--nox-font-size-md);
|
|
41
|
+
font-weight: var(--nox-font-weight-strong);
|
|
42
|
+
line-height: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.site-nav__brand-detail {
|
|
46
|
+
color: var(--nox-text-muted);
|
|
47
|
+
font-size: var(--nox-font-size-xs);
|
|
48
|
+
font-weight: var(--nox-font-weight-strong);
|
|
49
|
+
letter-spacing: var(--nox-letter-spacing-wider);
|
|
50
|
+
line-height: 1;
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
}
|