@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.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -0
  3. package/package.json +77 -0
  4. package/src/client/clipboard.ts +7 -0
  5. package/src/client/focus.ts +17 -0
  6. package/src/client/index.ts +3 -0
  7. package/src/client/scroll.ts +15 -0
  8. package/src/components/actions/ActionListItem/ActionListItem.astro +78 -0
  9. package/src/components/actions/ActionListItem/ActionListItem.css +43 -0
  10. package/src/components/actions/Button/Button.astro +100 -0
  11. package/src/components/actions/Button/Button.css +165 -0
  12. package/src/components/actions/CardAction/CardAction.astro +97 -0
  13. package/src/components/actions/CardAction/CardAction.css +188 -0
  14. package/src/components/actions/MediaTrigger/MediaTrigger.astro +55 -0
  15. package/src/components/actions/MediaTrigger/MediaTrigger.css +175 -0
  16. package/src/components/actions/ScrollToTop/ScrollToTop.astro +36 -0
  17. package/src/components/actions/ScrollToTop/ScrollToTop.css +19 -0
  18. package/src/components/actions/ScrollToTop/scrollToTopController.ts +32 -0
  19. package/src/components/content/CardBody/CardBody.astro +31 -0
  20. package/src/components/content/CardBody/CardBody.css +74 -0
  21. package/src/components/content/CardFooter/CardFooter.astro +58 -0
  22. package/src/components/content/CardFooter/CardFooter.css +102 -0
  23. package/src/components/content/CardHeader/CardHeader.astro +96 -0
  24. package/src/components/content/CardHeader/CardHeader.css +164 -0
  25. package/src/components/content/CardLink/CardLink.astro +138 -0
  26. package/src/components/content/CardLink/CardLink.css +362 -0
  27. package/src/components/content/CodeBlock/CodeBlock.astro +102 -0
  28. package/src/components/content/CodeBlock/CodeBlock.css +85 -0
  29. package/src/components/content/CodeBlock/codeBlockController.ts +60 -0
  30. package/src/components/content/CodeBlock/contracts.ts +8 -0
  31. package/src/components/content/InlineDefinition/InlineDefinition.astro +31 -0
  32. package/src/components/content/InlineDefinition/InlineDefinition.css +9 -0
  33. package/src/components/content/MarkdownContent/MarkdownContent.astro +32 -0
  34. package/src/components/content/MarkdownContent/MarkdownContent.css +358 -0
  35. package/src/components/content/MarkdownContent/MarkdownInline.astro +44 -0
  36. package/src/components/content/MarkdownContent/MarkdownNode.astro +280 -0
  37. package/src/components/content/MarkdownContent/MarkdownSymbol.astro +47 -0
  38. package/src/components/content/MarkdownContent/contracts.ts +181 -0
  39. package/src/components/data-display/BadgeList/BadgeList.astro +54 -0
  40. package/src/components/data-display/BadgeList/BadgeList.css +29 -0
  41. package/src/components/data-display/IconList/IconList.astro +64 -0
  42. package/src/components/data-display/IconList/IconList.css +55 -0
  43. package/src/components/data-display/MetricTile/MetricTile.astro +68 -0
  44. package/src/components/data-display/MetricTile/MetricTile.css +103 -0
  45. package/src/components/data-display/MetricTile/MetricTileContent.astro +70 -0
  46. package/src/components/data-display/MetricTile/metricTileController.ts +9 -0
  47. package/src/components/data-display/Tag/Tag.astro +67 -0
  48. package/src/components/data-display/Tag/Tag.css +134 -0
  49. package/src/components/data-display/Tag/TagAffix.astro +33 -0
  50. package/src/components/data-display/TextPair/TextPair.astro +63 -0
  51. package/src/components/data-display/TextPair/TextPair.css +99 -0
  52. package/src/components/feedback/Spinner/Spinner.astro +32 -0
  53. package/src/components/feedback/Spinner/Spinner.css +37 -0
  54. package/src/components/feedback/Tooltip/Tooltip.astro +66 -0
  55. package/src/components/feedback/Tooltip/Tooltip.css +67 -0
  56. package/src/components/feedback/Tooltip/tooltipController.ts +371 -0
  57. package/src/components/forms/FieldError/FieldError.astro +31 -0
  58. package/src/components/forms/FieldError/FieldError.css +12 -0
  59. package/src/components/forms/FieldError/fieldErrorState.ts +21 -0
  60. package/src/components/forms/FieldLabel/FieldLabel.astro +32 -0
  61. package/src/components/forms/FieldLabel/FieldLabel.css +17 -0
  62. package/src/components/forms/TextInput/TextInput.astro +79 -0
  63. package/src/components/forms/TextInput/TextInput.css +121 -0
  64. package/src/components/forms/TextInput/textInputController.ts +53 -0
  65. package/src/components/icons/ArrowDownIcon.astro +26 -0
  66. package/src/components/icons/ArrowLeftIcon.astro +26 -0
  67. package/src/components/icons/ArrowRightIcon.astro +26 -0
  68. package/src/components/icons/ArrowUpDownIcon.astro +26 -0
  69. package/src/components/icons/ArrowUpIcon.astro +26 -0
  70. package/src/components/icons/BulletIcon.astro +21 -0
  71. package/src/components/icons/BurnIcon.astro +24 -0
  72. package/src/components/icons/CircleSymbolIcon.css +66 -0
  73. package/src/components/icons/ClearIcon.astro +28 -0
  74. package/src/components/icons/CloseIcon.astro +21 -0
  75. package/src/components/icons/CopyIcon.astro +30 -0
  76. package/src/components/icons/CurrencyIcon.css +9 -0
  77. package/src/components/icons/DayIcon.astro +33 -0
  78. package/src/components/icons/DollarIcon.astro +28 -0
  79. package/src/components/icons/DownloadIcon.astro +22 -0
  80. package/src/components/icons/EnterFullscreenIcon.astro +22 -0
  81. package/src/components/icons/EqualIcon.astro +25 -0
  82. package/src/components/icons/ExitFullscreenIcon.astro +22 -0
  83. package/src/components/icons/ExternalLinkIcon.astro +22 -0
  84. package/src/components/icons/FieldIcon.astro +28 -0
  85. package/src/components/icons/GrassIcon.astro +29 -0
  86. package/src/components/icons/InfoIcon.astro +24 -0
  87. package/src/components/icons/MinusIcon.astro +21 -0
  88. package/src/components/icons/MountainIcon.astro +31 -0
  89. package/src/components/icons/NightIcon.astro +32 -0
  90. package/src/components/icons/PlayIcon.astro +22 -0
  91. package/src/components/icons/PlusIcon.astro +21 -0
  92. package/src/components/icons/PoisonIcon.astro +24 -0
  93. package/src/components/icons/RibbonIcon.astro +25 -0
  94. package/src/components/icons/SlashIcon.astro +22 -0
  95. package/src/components/icons/SlowIcon.astro +25 -0
  96. package/src/components/icons/StarIcon.astro +28 -0
  97. package/src/components/icons/StunIcon.astro +22 -0
  98. package/src/components/icons/TableSortIcon.astro +34 -0
  99. package/src/components/icons/WaterIcon.astro +30 -0
  100. package/src/components/index.ts +83 -0
  101. package/src/components/media/CanvasFrame/CanvasFrame.astro +130 -0
  102. package/src/components/media/CanvasFrame/CanvasFrame.css +59 -0
  103. package/src/components/media/CanvasFrame/canvasFrameController.ts +104 -0
  104. package/src/components/media/EmbedFrame/EmbedFrame.astro +147 -0
  105. package/src/components/media/EmbedFrame/EmbedFrame.css +51 -0
  106. package/src/components/media/EmbedFrame/embedFrameController.ts +66 -0
  107. package/src/components/media/MediaFrame/MediaFrame.astro +34 -0
  108. package/src/components/media/MediaFrame/MediaFrame.css +66 -0
  109. package/src/components/navigation/Breadcrumbs/Breadcrumbs.astro +55 -0
  110. package/src/components/navigation/Breadcrumbs/Breadcrumbs.css +89 -0
  111. package/src/components/navigation/DesktopNavigation.astro +92 -0
  112. package/src/components/navigation/DesktopNavigation.css +99 -0
  113. package/src/components/navigation/Header.astro +73 -0
  114. package/src/components/navigation/Header.css +20 -0
  115. package/src/components/navigation/MobileNavigation.astro +124 -0
  116. package/src/components/navigation/MobileNavigation.css +177 -0
  117. package/src/components/navigation/NavigationBrand.astro +63 -0
  118. package/src/components/navigation/NavigationBrand.css +52 -0
  119. package/src/components/navigation/NavigationControl.css +166 -0
  120. package/src/components/navigation/NavigationItemContent.astro +24 -0
  121. package/src/components/navigation/NavigationLink.astro +121 -0
  122. package/src/components/navigation/NavigationLinks.astro +27 -0
  123. package/src/components/navigation/NavigationMenuList.astro +37 -0
  124. package/src/components/navigation/NavigationMenuList.css +6 -0
  125. package/src/components/navigation/SkipLink/SkipLink.astro +18 -0
  126. package/src/components/navigation/SkipLink/SkipLink.css +26 -0
  127. package/src/components/navigation/SubNavigation/SubNavigation.astro +124 -0
  128. package/src/components/navigation/SubNavigation/SubNavigation.css +211 -0
  129. package/src/components/navigation/mobileNavigationController.ts +122 -0
  130. package/src/components/navigation/navigationState.ts +35 -0
  131. package/src/components/navigation/navigationTypes.ts +18 -0
  132. package/src/components/seo/SeoHead.astro +194 -0
  133. package/src/components/widgetTypes.ts +3 -0
  134. package/src/composition/Grid/Grid.astro +82 -0
  135. package/src/composition/Grid/Grid.css +314 -0
  136. package/src/composition/GridItem/GridItem.astro +50 -0
  137. package/src/composition/GridItem/GridItem.css +95 -0
  138. package/src/composition/Inline/Inline.astro +48 -0
  139. package/src/composition/Inline/Inline.css +65 -0
  140. package/src/composition/Stack/Stack.astro +37 -0
  141. package/src/composition/Stack/Stack.css +31 -0
  142. package/src/composition/SurfaceGroup/SurfaceGroup.astro +44 -0
  143. package/src/composition/SurfaceGroup/SurfaceGroup.css +76 -0
  144. package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +89 -0
  145. package/src/composition/index.ts +6 -0
  146. package/src/config/index.ts +2 -0
  147. package/src/config/pageMeta.ts +55 -0
  148. package/src/config/siteConfig.ts +90 -0
  149. package/src/data/collectionValidation.ts +61 -0
  150. package/src/data/index.ts +1 -0
  151. package/src/display/contracts.ts +284 -0
  152. package/src/display/index.ts +1 -0
  153. package/src/index.ts +6 -0
  154. package/src/layouts/BaseLayout.astro +74 -0
  155. package/src/layouts/PageSurface.astro +15 -0
  156. package/src/layouts/PageSurface.css +24 -0
  157. package/src/layouts/index.ts +2 -0
  158. package/src/patterns/CircuitPuzzle/CircuitPuzzle.astro +93 -0
  159. package/src/patterns/CircuitPuzzle/CircuitPuzzle.css +118 -0
  160. package/src/patterns/CircuitPuzzle/circuitPuzzleController.ts +205 -0
  161. package/src/patterns/CircuitPuzzle/contracts.ts +42 -0
  162. package/src/patterns/Combobox/Combobox.astro +462 -0
  163. package/src/patterns/Combobox/Combobox.css +403 -0
  164. package/src/patterns/Combobox/comboboxController.ts +788 -0
  165. package/src/patterns/Combobox/contracts.ts +18 -0
  166. package/src/patterns/Dropdown/Dropdown.astro +127 -0
  167. package/src/patterns/Dropdown/Dropdown.css +100 -0
  168. package/src/patterns/Dropdown/dropdownController.ts +157 -0
  169. package/src/patterns/Fullscreen/FullscreenControl.astro +103 -0
  170. package/src/patterns/Fullscreen/FullscreenControl.css +49 -0
  171. package/src/patterns/Fullscreen/fullscreenController.ts +73 -0
  172. package/src/patterns/GlitchOverlay/GlitchOverlay.astro +50 -0
  173. package/src/patterns/GlitchOverlay/GlitchOverlay.css +234 -0
  174. package/src/patterns/GlitchOverlay/glitchOverlayController.ts +152 -0
  175. package/src/patterns/GuidedFlow/GuidedFlow.astro +60 -0
  176. package/src/patterns/GuidedFlow/GuidedFlow.css +82 -0
  177. package/src/patterns/GuidedFlow/contracts.ts +3 -0
  178. package/src/patterns/GuidedFlow/guidedFlowController.ts +49 -0
  179. package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.astro +217 -0
  180. package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.css +383 -0
  181. package/src/patterns/MagneticFieldPuzzle/contracts.ts +81 -0
  182. package/src/patterns/MagneticFieldPuzzle/magneticFieldPuzzleController.ts +802 -0
  183. package/src/patterns/MagneticFieldPuzzle/simulation.ts +244 -0
  184. package/src/patterns/MapViewport/MapViewport.astro +296 -0
  185. package/src/patterns/MapViewport/MapViewport.css +257 -0
  186. package/src/patterns/MapViewport/contracts.ts +79 -0
  187. package/src/patterns/MapViewport/geometry.ts +80 -0
  188. package/src/patterns/MapViewport/mapViewportController.ts +636 -0
  189. package/src/patterns/Modal/Modal.astro +64 -0
  190. package/src/patterns/Modal/Modal.css +87 -0
  191. package/src/patterns/Modal/ModalClose.astro +37 -0
  192. package/src/patterns/Modal/ModalOpen.astro +36 -0
  193. package/src/patterns/Modal/modalController.ts +118 -0
  194. package/src/patterns/PuzzleGrid/PuzzleGrid.astro +22 -0
  195. package/src/patterns/PuzzleGrid/PuzzleGrid.css +149 -0
  196. package/src/patterns/PuzzleGrid/contracts.ts +2 -0
  197. package/src/patterns/PuzzleGrid/selectionDismissal.ts +27 -0
  198. package/src/patterns/PuzzleGrid/state.ts +25 -0
  199. package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.astro +65 -0
  200. package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.css +35 -0
  201. package/src/patterns/SpriteProjectilePreview/contracts.ts +33 -0
  202. package/src/patterns/SpriteProjectilePreview/spriteProjectilePreviewController.ts +586 -0
  203. package/src/patterns/StageFlow/StageFlow.astro +57 -0
  204. package/src/patterns/StageFlow/StageFlow.css +54 -0
  205. package/src/patterns/StageFlow/StageFlowAlternative.astro +23 -0
  206. package/src/patterns/StageFlow/StageFlowArrow.astro +22 -0
  207. package/src/patterns/StageFlow/StageFlowConnector.astro +7 -0
  208. package/src/patterns/StageFlow/StageFlowConnector.css +4 -0
  209. package/src/patterns/StageFlow/StageFlowStage.astro +51 -0
  210. package/src/patterns/StageFlow/StageFlowStage.css +106 -0
  211. package/src/patterns/StageFlow/StageFlowStep.astro +24 -0
  212. package/src/patterns/StageFlow/StageFlowStep.css +19 -0
  213. package/src/patterns/StageFlow/StageFlowSymbol.css +28 -0
  214. package/src/patterns/Table/Table.astro +176 -0
  215. package/src/patterns/Table/Table.css +70 -0
  216. package/src/patterns/Table/TableBody.astro +185 -0
  217. package/src/patterns/Table/TableBody.css +262 -0
  218. package/src/patterns/Table/TableCell.astro +59 -0
  219. package/src/patterns/Table/TableCell.css +99 -0
  220. package/src/patterns/Table/TableCellValue.astro +86 -0
  221. package/src/patterns/Table/TableFooter.astro +32 -0
  222. package/src/patterns/Table/TableFooter.css +31 -0
  223. package/src/patterns/Table/TableHeader.astro +118 -0
  224. package/src/patterns/Table/TableHeader.css +209 -0
  225. package/src/patterns/Table/TablePagination.astro +70 -0
  226. package/src/patterns/Table/TablePagination.css +133 -0
  227. package/src/patterns/Table/TableSkeleton.astro +36 -0
  228. package/src/patterns/Table/TableSkeleton.css +81 -0
  229. package/src/patterns/Table/tableCellController.ts +11 -0
  230. package/src/patterns/Table/tableFilterController.ts +206 -0
  231. package/src/patterns/Table/tableHeaderOverflowController.ts +105 -0
  232. package/src/patterns/Table/tableLayout.ts +113 -0
  233. package/src/patterns/Table/tableProgressiveController.ts +319 -0
  234. package/src/patterns/Table/tableRowNavigationController.ts +91 -0
  235. package/src/patterns/Table/tableScrollController.ts +192 -0
  236. package/src/patterns/Table/tableSortController.ts +272 -0
  237. package/src/patterns/index.ts +46 -0
  238. package/src/primitives/index.ts +4 -0
  239. package/src/primitives/layout/Separator/Separator.astro +29 -0
  240. package/src/primitives/layout/Separator/Separator.css +20 -0
  241. package/src/primitives/media/AmbientAudio/AmbientAudio.astro +28 -0
  242. package/src/primitives/media/Media/Media.astro +122 -0
  243. package/src/primitives/media/Media/Media.css +161 -0
  244. package/src/primitives/text/TextBlock/TextBlock.astro +46 -0
  245. package/src/primitives/text/TextBlock/TextBlock.css +21 -0
  246. package/src/seo/StaticRedirect.astro +32 -0
  247. package/src/seo/index.ts +6 -0
  248. package/src/seo/pageSeo.ts +99 -0
  249. package/src/seo/robots.ts +16 -0
  250. package/src/seo/sitemap.ts +38 -0
  251. package/src/seo/structuredData.ts +133 -0
  252. package/src/seo/url.ts +64 -0
  253. package/src/styles/base.css +148 -0
  254. package/src/styles/interaction.css +108 -0
  255. package/src/styles/style.css +93 -0
  256. package/src/styles/tokens.css +256 -0
  257. package/src/theme/contracts.ts +7 -0
  258. package/src/theme/index.ts +1 -0
  259. package/tsconfig.json +20 -0
@@ -0,0 +1,211 @@
1
+ .sub-navigation {
2
+ --surface-border-width: var(--nox-border-width);
3
+ --surface-border-color: var(--nox-border);
4
+ --surface-radius: var(--nox-radius-md);
5
+ --surface-background: color-mix(in srgb, var(--nox-surface) 58%, transparent);
6
+ --sub-navigation-border-color: var(--surface-border-color);
7
+ --sub-navigation-size: var(--nox-section-block-size);
8
+ --sub-navigation-track-size: calc(
9
+ var(--sub-navigation-size) + var(--surface-border-width)
10
+ );
11
+
12
+ container-type: inline-size;
13
+ min-width: 0;
14
+ overflow-x: clip;
15
+ overflow-y: hidden;
16
+ border: var(--surface-border-width) solid var(--sub-navigation-border-color);
17
+ border-block-end-width: 0;
18
+ border-radius: var(--surface-radius);
19
+ background: var(--surface-background);
20
+ box-shadow: inset 0 calc(var(--surface-border-width) * -1) 0
21
+ var(--sub-navigation-border-color);
22
+ }
23
+
24
+ .sub-navigation__list {
25
+ display: grid;
26
+ grid-auto-columns: minmax(0, 1fr);
27
+ grid-auto-flow: column;
28
+ inline-size: 100%;
29
+ min-width: 0;
30
+ min-block-size: var(--sub-navigation-track-size);
31
+ margin: 0;
32
+ padding: 0;
33
+ gap: 0;
34
+ list-style: none;
35
+ }
36
+
37
+ .sub-navigation__item {
38
+ position: relative;
39
+ display: flex;
40
+ min-width: 0;
41
+ }
42
+
43
+ .sub-navigation__item + .sub-navigation__item::before {
44
+ position: absolute;
45
+ inset-block: 0;
46
+ inset-inline-start: 0;
47
+ inline-size: var(--surface-border-width);
48
+ background: var(--sub-navigation-border-color);
49
+ content: '';
50
+ pointer-events: none;
51
+ z-index: 1;
52
+ }
53
+
54
+ .sub-navigation__link {
55
+ position: relative;
56
+ display: inline-grid;
57
+ box-sizing: border-box;
58
+ inline-size: 100%;
59
+ min-width: 0;
60
+ min-block-size: var(--sub-navigation-track-size);
61
+ place-items: center;
62
+ padding: var(--nox-space-2) var(--nox-space-3);
63
+ border: 0;
64
+ border-radius: 0;
65
+ background: transparent;
66
+ color: var(--nox-text-muted);
67
+ font-weight: var(--nox-font-weight-strong);
68
+ line-height: 1;
69
+ text-align: center;
70
+ text-decoration: none;
71
+ -webkit-tap-highlight-color: transparent;
72
+ }
73
+
74
+ .sub-navigation__link::after {
75
+ position: absolute;
76
+ inset-inline: 0;
77
+ inset-block-end: 0;
78
+ height: 3px;
79
+ border-radius: 0;
80
+ background: var(--nox-tone-text);
81
+ content: '';
82
+ opacity: 0;
83
+ pointer-events: none;
84
+ z-index: 1;
85
+ }
86
+
87
+ .sub-navigation__link[data-active] {
88
+ background: var(--nox-tone-background);
89
+ color: var(--nox-tone-text);
90
+ }
91
+
92
+ .sub-navigation__link[data-active]::after {
93
+ opacity: 1;
94
+ }
95
+
96
+ .sub-navigation__link[aria-disabled='true'] {
97
+ color: var(--nox-text-disabled);
98
+ cursor: not-allowed;
99
+ }
100
+
101
+ .sub-navigation__link[data-has-visual] {
102
+ grid-template-rows: auto auto;
103
+ align-content: start;
104
+ row-gap: calc(var(--nox-space-1) / 2);
105
+ block-size: var(--sub-navigation-track-size);
106
+ padding: 0;
107
+ }
108
+
109
+ .sub-navigation__visual {
110
+ display: inline-grid;
111
+ grid-row: 1;
112
+ inline-size: 2.5rem;
113
+ block-size: 2.5rem;
114
+ place-items: center;
115
+ color: currentColor;
116
+ }
117
+
118
+ .sub-navigation__visual--media {
119
+ inline-size: 2.5rem;
120
+ block-size: 2.5rem;
121
+ }
122
+
123
+ .sub-navigation__visual svg {
124
+ display: block;
125
+ inline-size: 100%;
126
+ block-size: 100%;
127
+ }
128
+
129
+ .sub-navigation__image {
130
+ --media-object-inline-size: auto;
131
+ --media-object-block-size: auto;
132
+ --media-object-max-inline-size: 100%;
133
+ --media-object-max-block-size: 100%;
134
+
135
+ inline-size: 100%;
136
+ block-size: 100%;
137
+ }
138
+
139
+ .sub-navigation__label {
140
+ min-width: 0;
141
+ overflow-wrap: anywhere;
142
+ }
143
+
144
+ .sub-navigation__label--with-visual {
145
+ max-inline-size: 100%;
146
+ overflow: hidden;
147
+ padding-inline: var(--nox-space-1);
148
+ font-size: var(--nox-font-size-xs);
149
+ line-height: 1;
150
+ text-overflow: ellipsis;
151
+ text-transform: uppercase;
152
+ white-space: nowrap;
153
+ }
154
+
155
+ .sub-navigation__link:focus-visible {
156
+ outline: var(--nox-focus-ring-width) solid var(--nox-tone-focus-ring);
157
+ outline-offset: calc(var(--nox-focus-ring-width) * -1);
158
+ }
159
+
160
+ @media (hover: hover) and (pointer: fine) {
161
+ .sub-navigation__link[href]:hover {
162
+ background: var(--nox-surface-muted);
163
+ color: var(--nox-tone-text);
164
+ }
165
+
166
+ .sub-navigation__link[href]:hover::after {
167
+ opacity: 0.55;
168
+ }
169
+
170
+ .sub-navigation__link[href][data-active]:hover::after {
171
+ opacity: 1;
172
+ }
173
+ }
174
+
175
+ @media (prefers-reduced-motion: no-preference) {
176
+ .sub-navigation__link,
177
+ .sub-navigation__link::after {
178
+ transition:
179
+ background-color var(--nox-motion-duration-sm)
180
+ var(--nox-motion-easing-standard),
181
+ color var(--nox-motion-duration-sm) var(--nox-motion-easing-standard),
182
+ opacity var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
183
+ }
184
+ }
185
+
186
+ @container (width < 32rem) {
187
+ .sub-navigation__list {
188
+ --sub-navigation-size: var(--nox-section-compact-block-size);
189
+ }
190
+
191
+ .sub-navigation__link[data-has-visual] {
192
+ grid-template-rows: minmax(0, 1fr) 3px;
193
+ align-content: stretch;
194
+ row-gap: 0;
195
+ }
196
+
197
+ .sub-navigation__visual--media {
198
+ inline-size: 100%;
199
+ block-size: 100%;
200
+ }
201
+
202
+ .sub-navigation__label--with-visual {
203
+ position: absolute;
204
+ overflow: hidden;
205
+ width: 1px;
206
+ height: 1px;
207
+ padding: 0;
208
+ clip: rect(0 0 0 0);
209
+ white-space: nowrap;
210
+ }
211
+ }
@@ -0,0 +1,122 @@
1
+ const desktopMediaQuery = '(min-width: 72rem)';
2
+ const openAttribute = 'data-mobile-navigation-open';
3
+ const initializedAttribute = 'data-mobile-navigation-initialized';
4
+ const noop = (): void => undefined;
5
+
6
+ export function initMobileNavigation(root: HTMLElement): () => void {
7
+ if (root.getAttribute(initializedAttribute) === 'true') {
8
+ return noop;
9
+ }
10
+
11
+ const trigger = root.querySelector<HTMLElement>(
12
+ '[data-mobile-navigation-trigger]',
13
+ );
14
+ const panel = root.querySelector<HTMLElement>(
15
+ '[data-mobile-navigation-panel]',
16
+ );
17
+
18
+ if (!trigger || !panel) {
19
+ return noop;
20
+ }
21
+
22
+ root.setAttribute(initializedAttribute, 'true');
23
+
24
+ const desktopMedia = window.matchMedia(desktopMediaQuery);
25
+ const openLabel = trigger.dataset.mobileNavigationOpenLabel ?? '';
26
+ const closeLabel = trigger.dataset.mobileNavigationCloseLabel || openLabel;
27
+ let isOpen = !panel.hidden;
28
+
29
+ const setOpen = (nextOpen: boolean, restoreFocus = false): void => {
30
+ isOpen = nextOpen && !desktopMedia.matches;
31
+ trigger.setAttribute('aria-expanded', String(isOpen));
32
+ trigger.setAttribute('aria-label', isOpen ? closeLabel : openLabel);
33
+ panel.hidden = !isOpen;
34
+ root.toggleAttribute(openAttribute, isOpen);
35
+ document.documentElement.toggleAttribute(openAttribute, isOpen);
36
+
37
+ if (restoreFocus) {
38
+ trigger.focus();
39
+ }
40
+ };
41
+
42
+ const open = (): void => {
43
+ if (isOpen || desktopMedia.matches) {
44
+ return;
45
+ }
46
+
47
+ setOpen(true);
48
+ };
49
+
50
+ const close = (restoreFocus = true): void => {
51
+ if (!isOpen) {
52
+ return;
53
+ }
54
+
55
+ setOpen(false, restoreFocus);
56
+ };
57
+
58
+ const toggle = (): void => {
59
+ if (isOpen) {
60
+ close(true);
61
+ return;
62
+ }
63
+
64
+ open();
65
+ };
66
+
67
+ const handleTriggerClick = (): void => {
68
+ toggle();
69
+ };
70
+
71
+ const handleDocumentKeydown = (event: KeyboardEvent): void => {
72
+ if (event.key === 'Escape') {
73
+ close(true);
74
+ }
75
+ };
76
+
77
+ const handleDocumentClick = (event: MouseEvent): void => {
78
+ const target = event.target;
79
+
80
+ if (isOpen && target instanceof Node && !root.contains(target)) {
81
+ close(false);
82
+ }
83
+ };
84
+
85
+ const handlePanelClick = (event: MouseEvent): void => {
86
+ const target = event.target;
87
+
88
+ if (!(target instanceof Element)) {
89
+ return;
90
+ }
91
+
92
+ const link = target.closest('a[href]');
93
+
94
+ if (link && panel.contains(link)) {
95
+ close(true);
96
+ }
97
+ };
98
+
99
+ const handleDesktopMediaChange = (): void => {
100
+ if (desktopMedia.matches) {
101
+ close(false);
102
+ }
103
+ };
104
+
105
+ setOpen(isOpen);
106
+
107
+ trigger.addEventListener('click', handleTriggerClick);
108
+ panel.addEventListener('click', handlePanelClick);
109
+ document.addEventListener('click', handleDocumentClick);
110
+ document.addEventListener('keydown', handleDocumentKeydown);
111
+ desktopMedia.addEventListener('change', handleDesktopMediaChange);
112
+
113
+ return () => {
114
+ setOpen(false);
115
+ trigger.removeEventListener('click', handleTriggerClick);
116
+ panel.removeEventListener('click', handlePanelClick);
117
+ document.removeEventListener('click', handleDocumentClick);
118
+ document.removeEventListener('keydown', handleDocumentKeydown);
119
+ desktopMedia.removeEventListener('change', handleDesktopMediaChange);
120
+ root.removeAttribute(initializedAttribute);
121
+ };
122
+ }
@@ -0,0 +1,35 @@
1
+ import type {
2
+ NavigationGroupItem,
3
+ NavigationItem,
4
+ } from '../../display/contracts';
5
+ import { normalizePathname } from '../../seo/url';
6
+
7
+ export const normalizePath = normalizePathname;
8
+
9
+ export const isNavigationGroupItem = (
10
+ item: NavigationItem,
11
+ ): item is NavigationGroupItem => item.items !== undefined;
12
+
13
+ export const isNavigationItemActive = (
14
+ item: NavigationItem,
15
+ currentPath: string,
16
+ ): boolean => {
17
+ if (item.active !== undefined) {
18
+ return item.active;
19
+ }
20
+
21
+ if (!item.href || item.disabled || item.href.includes('#')) {
22
+ return false;
23
+ }
24
+
25
+ const activePath = normalizePath(currentPath);
26
+ const itemPaths = (item.activePaths ?? [item.href]).map(normalizePath);
27
+
28
+ return itemPaths.some((itemPath) => {
29
+ if (item.activeMatch === 'prefix' && itemPath !== '/') {
30
+ return activePath === itemPath || activePath.startsWith(`${itemPath}/`);
31
+ }
32
+
33
+ return itemPath === activePath;
34
+ });
35
+ };
@@ -0,0 +1,18 @@
1
+ import type { AstroComponent } from '../widgetTypes';
2
+ import type { DisplayMedia } from '../../display/contracts';
3
+
4
+ export type MobileNavigationLabels = {
5
+ closeLabel?: string;
6
+ openLabel: string;
7
+ };
8
+
9
+ type SubNavigationVisual =
10
+ | { icon?: AstroComponent; media?: never }
11
+ | { icon?: never; media: DisplayMedia };
12
+
13
+ export type SubNavigationItem = SubNavigationVisual & {
14
+ active?: boolean;
15
+ disabled?: boolean;
16
+ href: string;
17
+ label: string;
18
+ };
@@ -0,0 +1,194 @@
1
+ ---
2
+ import type { PageMeta } from '../../config/pageMeta';
3
+ import type { SiteConfig } from '../../config/siteConfig';
4
+ import type { BreadcrumbItem } from '../../display/contracts';
5
+ import { resolvePageSeo } from '../../seo/pageSeo';
6
+ import {
7
+ createBreadcrumbListJsonLd,
8
+ createArticleJsonLd,
9
+ createWebPageJsonLd,
10
+ createWebSiteJsonLd,
11
+ serializeJsonLd,
12
+ type JsonLdNode,
13
+ } from '../../seo/structuredData';
14
+
15
+ type Props = {
16
+ meta: PageMeta;
17
+ site: SiteConfig;
18
+ pathname: string;
19
+ breadcrumbs?: readonly BreadcrumbItem[];
20
+ structuredData?: readonly JsonLdNode[];
21
+ };
22
+
23
+ const {
24
+ breadcrumbs = [],
25
+ meta,
26
+ pathname,
27
+ site,
28
+ structuredData = [],
29
+ } = Astro.props;
30
+
31
+ const seo = resolvePageSeo({
32
+ meta,
33
+ pathname,
34
+ site,
35
+ });
36
+ const isDefaultRoot =
37
+ seo.lang === site.defaultMeta.lang &&
38
+ new URL(seo.canonicalUrl).pathname === '/';
39
+ const primaryStructuredData =
40
+ seo.seoType === 'article' && seo.datePublished
41
+ ? createArticleJsonLd({
42
+ site,
43
+ datePublished: seo.datePublished,
44
+ description: seo.description,
45
+ headline: seo.documentTitle,
46
+ lang: seo.lang,
47
+ url: seo.canonicalUrl,
48
+ })
49
+ : createWebPageJsonLd({
50
+ description: seo.description,
51
+ lang: seo.lang,
52
+ name: seo.documentTitle,
53
+ site,
54
+ type: seo.seoType === 'collection-page' ? 'CollectionPage' : 'WebPage',
55
+ url: seo.canonicalUrl,
56
+ });
57
+ const jsonLdNodes = [
58
+ ...(isDefaultRoot ? [createWebSiteJsonLd(site)] : []),
59
+ primaryStructuredData,
60
+ ...(breadcrumbs.length > 0
61
+ ? [
62
+ createBreadcrumbListJsonLd({
63
+ breadcrumbs,
64
+ siteUrl: site.seo.siteUrl,
65
+ }),
66
+ ]
67
+ : []),
68
+ ...structuredData,
69
+ ];
70
+ ---
71
+
72
+ <title>{seo.documentTitle}</title>
73
+ {
74
+ site.seo.icons?.map((icon) => (
75
+ <link
76
+ rel="icon"
77
+ href={icon.href}
78
+ type={icon.type}
79
+ sizes={icon.sizes}
80
+ />
81
+ ))
82
+ }
83
+ {
84
+ site.seo.appleTouchIcon ? (
85
+ <link
86
+ rel="apple-touch-icon"
87
+ href={site.seo.appleTouchIcon.href}
88
+ sizes={site.seo.appleTouchIcon.sizes}
89
+ />
90
+ ) : null
91
+ }
92
+ {
93
+ site.seo.webManifest ? (
94
+ <link rel="manifest" href={site.seo.webManifest} />
95
+ ) : null
96
+ }
97
+ {
98
+ site.seo.themeColors?.map((themeColor) => (
99
+ <meta
100
+ name="theme-color"
101
+ content={themeColor.color}
102
+ media={themeColor.media}
103
+ />
104
+ ))
105
+ }
106
+ <meta name="application-name" content={site.identity.name} />
107
+ <meta name="apple-mobile-web-app-title" content={site.identity.name} />
108
+ {seo.description ? <meta name="description" content={seo.description} /> : null}
109
+ {seo.robots ? <meta name="robots" content={seo.robots} /> : null}
110
+ <link rel="canonical" href={seo.canonicalUrl} />
111
+ {
112
+ seo.alternates.map((alternate) => (
113
+ <link rel="alternate" hreflang={alternate.lang} href={alternate.href} />
114
+ ))
115
+ }
116
+
117
+ <meta property="og:site_name" content={site.identity.name} />
118
+ <meta property="og:type" content={seo.openGraphType} />
119
+ <meta property="og:title" content={seo.documentTitle} />
120
+ {
121
+ seo.description ? (
122
+ <meta property="og:description" content={seo.description} />
123
+ ) : null
124
+ }
125
+ <meta property="og:url" content={seo.canonicalUrl} />
126
+ <meta property="og:locale" content={seo.openGraphLocale} />
127
+ {
128
+ seo.openGraphLocaleAlternates.map((locale) => (
129
+ <meta property="og:locale:alternate" content={locale} />
130
+ ))
131
+ }
132
+ {
133
+ seo.datePublished && seo.openGraphType === 'article' ? (
134
+ <meta property="article:published_time" content={seo.datePublished} />
135
+ ) : null
136
+ }
137
+ {
138
+ seo.socialImageUrl ? (
139
+ <meta property="og:image" content={seo.socialImageUrl} />
140
+ ) : null
141
+ }
142
+ {
143
+ seo.socialImageUrl?.startsWith('https://') ? (
144
+ <meta property="og:image:secure_url" content={seo.socialImageUrl} />
145
+ ) : null
146
+ }
147
+ {
148
+ seo.socialImageAlt ? (
149
+ <meta property="og:image:alt" content={seo.socialImageAlt} />
150
+ ) : null
151
+ }
152
+ {
153
+ seo.socialImageType ? (
154
+ <meta property="og:image:type" content={seo.socialImageType} />
155
+ ) : null
156
+ }
157
+ {
158
+ seo.socialImageWidth ? (
159
+ <meta property="og:image:width" content={String(seo.socialImageWidth)} />
160
+ ) : null
161
+ }
162
+ {
163
+ seo.socialImageHeight ? (
164
+ <meta property="og:image:height" content={String(seo.socialImageHeight)} />
165
+ ) : null
166
+ }
167
+
168
+ <meta name="twitter:card" content={seo.twitterCard} />
169
+ <meta name="twitter:title" content={seo.documentTitle} />
170
+ {
171
+ seo.description ? (
172
+ <meta name="twitter:description" content={seo.description} />
173
+ ) : null
174
+ }
175
+ {
176
+ seo.socialImageUrl ? (
177
+ <meta name="twitter:image" content={seo.socialImageUrl} />
178
+ ) : null
179
+ }
180
+ {
181
+ seo.socialImageAlt ? (
182
+ <meta name="twitter:image:alt" content={seo.socialImageAlt} />
183
+ ) : null
184
+ }
185
+
186
+ {
187
+ jsonLdNodes.map((node) => (
188
+ <script
189
+ is:inline
190
+ type="application/ld+json"
191
+ set:html={serializeJsonLd(node)}
192
+ />
193
+ ))
194
+ }
@@ -0,0 +1,3 @@
1
+ export type AstroComponent = (props: Record<string, unknown>) => unknown;
2
+
3
+ export type HeadingLevel = 1 | 2 | 3 | 4;
@@ -0,0 +1,82 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+
4
+ type GridGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type GridColumns = 1 | 2 | 3 | 4 | 'content-sidebar';
6
+ type GridRows = 1 | 2 | 3 | 4;
7
+ type GridItemAlignment = 'start' | 'center' | 'end' | 'stretch';
8
+ type GridCollapseAt = 'none' | 'sm' | 'md' | 'lg' | 'xl';
9
+ type GridLastRow = 'preserve' | 'fill';
10
+
11
+ type Props = Omit<HTMLAttributes<'div'>, 'class' | 'style'> & {
12
+ as?: 'div' | 'section' | 'ul' | 'ol';
13
+ alignItems?: GridItemAlignment;
14
+ collapseAt?: GridCollapseAt;
15
+ class?: string;
16
+ compactColumns?: 1 | 2 | 3 | 4;
17
+ gap?: GridGap;
18
+ columns?: GridColumns;
19
+ justifyItems?: GridItemAlignment;
20
+ lastRow?: GridLastRow;
21
+ minTrackWidth?: string;
22
+ rows?: GridRows;
23
+ };
24
+
25
+ const {
26
+ as: Element = 'div',
27
+ alignItems = 'stretch',
28
+ collapseAt = 'md',
29
+ class: className,
30
+ compactColumns,
31
+ gap = 'md',
32
+ columns,
33
+ justifyItems = 'stretch',
34
+ lastRow = 'preserve',
35
+ minTrackWidth = '16rem',
36
+ rows,
37
+ ...attrs
38
+ }: Props = Astro.props;
39
+ const layout =
40
+ columns === 'content-sidebar'
41
+ ? 'content-sidebar'
42
+ : columns
43
+ ? 'fixed'
44
+ : 'auto';
45
+ const collapseMode = columns ? collapseAt : 'none';
46
+ const gridVariables = {
47
+ ...(typeof columns === 'number'
48
+ ? { '--grid-columns': String(columns) }
49
+ : columns
50
+ ? {}
51
+ : { '--grid-min-track-width': minTrackWidth }),
52
+ ...(compactColumns
53
+ ? { '--grid-compact-columns': String(compactColumns) }
54
+ : {}),
55
+ ...(rows ? { '--grid-rows': String(rows) } : {}),
56
+ '--grid-align-items': alignItems,
57
+ '--grid-justify-items': justifyItems,
58
+ };
59
+ const gridStyle = Object.entries(gridVariables)
60
+ .map(([property, value]) => `${property}: ${value};`)
61
+ .join(' ');
62
+ ---
63
+
64
+ <div class="grid-container">
65
+ <Element
66
+ {...attrs}
67
+ class:list={['grid', className]}
68
+ data-composition="grid"
69
+ data-align-items={alignItems}
70
+ data-collapse-at={collapseMode}
71
+ data-compact-columns={compactColumns}
72
+ data-columns={typeof columns === 'number' ? columns : undefined}
73
+ data-gap={gap}
74
+ data-justify-items={justifyItems}
75
+ data-layout={layout}
76
+ data-last-row={lastRow}
77
+ data-rows={rows}
78
+ style={gridStyle}
79
+ >
80
+ <slot />
81
+ </Element>
82
+ </div>