@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,314 @@
1
+ .grid-container {
2
+ container-type: inline-size;
3
+ min-width: 0;
4
+ }
5
+
6
+ .grid {
7
+ display: grid;
8
+ min-width: 0;
9
+ align-items: var(--grid-align-items);
10
+ gap: var(--grid-gap);
11
+ justify-items: var(--grid-justify-items);
12
+ }
13
+
14
+ .grid[data-gap='none'] {
15
+ --grid-gap: 0;
16
+ }
17
+
18
+ .grid[data-gap='xs'] {
19
+ --grid-gap: var(--nox-space-2);
20
+ }
21
+
22
+ .grid[data-gap='sm'] {
23
+ --grid-gap: var(--nox-space-3);
24
+ }
25
+
26
+ .grid[data-gap='md'] {
27
+ --grid-gap: var(--nox-space-4);
28
+ }
29
+
30
+ .grid[data-gap='lg'] {
31
+ --grid-gap: var(--nox-space-5);
32
+ }
33
+
34
+ .grid[data-gap='xl'] {
35
+ --grid-gap: var(--nox-space-6);
36
+ }
37
+
38
+ .grid[data-layout='auto'] {
39
+ grid-template-columns: repeat(
40
+ auto-fit,
41
+ minmax(min(100%, var(--grid-min-track-width)), 1fr)
42
+ );
43
+ }
44
+
45
+ .grid[data-layout='fixed'] {
46
+ grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
47
+ }
48
+
49
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='2']
50
+ > :last-child:nth-child(2n + 1) {
51
+ grid-column: span 2;
52
+ }
53
+
54
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='3'] {
55
+ grid-template-columns: repeat(6, minmax(0, 1fr));
56
+ }
57
+
58
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='3'] > * {
59
+ grid-column: span 2;
60
+ }
61
+
62
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='3']
63
+ > :last-child:nth-child(3n + 1) {
64
+ grid-column: span 6;
65
+ }
66
+
67
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='3']:has(
68
+ > :last-child:nth-child(3n + 2)
69
+ )
70
+ > :nth-last-child(-n + 2) {
71
+ grid-column: span 3;
72
+ }
73
+
74
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='4'] {
75
+ grid-template-columns: repeat(12, minmax(0, 1fr));
76
+ }
77
+
78
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='4'] > * {
79
+ grid-column: span 3;
80
+ }
81
+
82
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='4']
83
+ > :last-child:nth-child(4n + 1) {
84
+ grid-column: span 12;
85
+ }
86
+
87
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='4']:has(
88
+ > :last-child:nth-child(4n + 2)
89
+ )
90
+ > :nth-last-child(-n + 2) {
91
+ grid-column: span 6;
92
+ }
93
+
94
+ .grid[data-layout='fixed'][data-last-row='fill'][data-columns='4']:has(
95
+ > :last-child:nth-child(4n + 3)
96
+ )
97
+ > :nth-last-child(-n + 3) {
98
+ grid-column: span 4;
99
+ }
100
+
101
+ .grid[data-layout='content-sidebar'] {
102
+ grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
103
+ }
104
+
105
+ .grid[data-rows] {
106
+ grid-template-rows: repeat(var(--grid-rows), minmax(0, 1fr));
107
+ }
108
+
109
+ @container (width < 24rem) {
110
+ .grid:is(
111
+ [data-layout='fixed'],
112
+ [data-layout='content-sidebar']
113
+ )[data-collapse-at='sm'] {
114
+ grid-template-columns: 1fr;
115
+ }
116
+
117
+ .grid:is(
118
+ [data-layout='fixed'],
119
+ [data-layout='content-sidebar']
120
+ )[data-collapse-at='sm']
121
+ > [data-composition='grid-item'][data-sizing='fill-track'] {
122
+ --grid-item-fill-track-contain: none;
123
+ --grid-item-fill-track-content-block-size: auto;
124
+ --grid-item-fill-track-content-inset: auto;
125
+ --grid-item-fill-track-content-position: static;
126
+ --grid-item-fill-track-overflow: visible;
127
+ }
128
+
129
+ .grid:is(
130
+ [data-layout='fixed'],
131
+ [data-layout='content-sidebar']
132
+ )[data-collapse-at='sm']
133
+ > [data-composition='grid-item'][data-position='sticky'] {
134
+ position: static;
135
+ padding-block-end: 0;
136
+ max-block-size: none;
137
+ overflow: visible;
138
+ }
139
+
140
+ .grid:is(
141
+ [data-layout='fixed'],
142
+ [data-layout='content-sidebar']
143
+ )[data-collapse-at='sm']
144
+ > [data-composition='grid-item'][data-collapse-order='first'] {
145
+ order: -1;
146
+ }
147
+
148
+ .grid:is(
149
+ [data-layout='fixed'],
150
+ [data-layout='content-sidebar']
151
+ )[data-collapse-at='sm']
152
+ > [data-composition='grid-item'][data-collapse-order='last'] {
153
+ order: 1;
154
+ }
155
+ }
156
+
157
+ @container (width < 36rem) {
158
+ .grid:is(
159
+ [data-layout='fixed'],
160
+ [data-layout='content-sidebar']
161
+ )[data-collapse-at='md'] {
162
+ grid-template-columns: 1fr;
163
+ }
164
+
165
+ .grid:is(
166
+ [data-layout='fixed'],
167
+ [data-layout='content-sidebar']
168
+ )[data-collapse-at='md']
169
+ > [data-composition='grid-item'][data-sizing='fill-track'] {
170
+ --grid-item-fill-track-contain: none;
171
+ --grid-item-fill-track-content-block-size: auto;
172
+ --grid-item-fill-track-content-inset: auto;
173
+ --grid-item-fill-track-content-position: static;
174
+ --grid-item-fill-track-overflow: visible;
175
+ }
176
+
177
+ .grid:is(
178
+ [data-layout='fixed'],
179
+ [data-layout='content-sidebar']
180
+ )[data-collapse-at='md']
181
+ > [data-composition='grid-item'][data-position='sticky'] {
182
+ position: static;
183
+ padding-block-end: 0;
184
+ max-block-size: none;
185
+ overflow: visible;
186
+ }
187
+
188
+ .grid:is(
189
+ [data-layout='fixed'],
190
+ [data-layout='content-sidebar']
191
+ )[data-collapse-at='md']
192
+ > [data-composition='grid-item'][data-collapse-order='first'] {
193
+ order: -1;
194
+ }
195
+
196
+ .grid:is(
197
+ [data-layout='fixed'],
198
+ [data-layout='content-sidebar']
199
+ )[data-collapse-at='md']
200
+ > [data-composition='grid-item'][data-collapse-order='last'] {
201
+ order: 1;
202
+ }
203
+ }
204
+
205
+ @container (width < 44rem) {
206
+ .grid:is(
207
+ [data-layout='fixed'],
208
+ [data-layout='content-sidebar']
209
+ )[data-collapse-at='lg'] {
210
+ grid-template-columns: 1fr;
211
+ }
212
+
213
+ .grid:is(
214
+ [data-layout='fixed'],
215
+ [data-layout='content-sidebar']
216
+ )[data-collapse-at='lg']
217
+ > [data-composition='grid-item'][data-sizing='fill-track'] {
218
+ --grid-item-fill-track-contain: none;
219
+ --grid-item-fill-track-content-block-size: auto;
220
+ --grid-item-fill-track-content-inset: auto;
221
+ --grid-item-fill-track-content-position: static;
222
+ --grid-item-fill-track-overflow: visible;
223
+ }
224
+
225
+ .grid:is(
226
+ [data-layout='fixed'],
227
+ [data-layout='content-sidebar']
228
+ )[data-collapse-at='lg']
229
+ > [data-composition='grid-item'][data-position='sticky'] {
230
+ position: static;
231
+ padding-block-end: 0;
232
+ max-block-size: none;
233
+ overflow: visible;
234
+ }
235
+
236
+ .grid:is(
237
+ [data-layout='fixed'],
238
+ [data-layout='content-sidebar']
239
+ )[data-collapse-at='lg']
240
+ > [data-composition='grid-item'][data-collapse-order='first'] {
241
+ order: -1;
242
+ }
243
+
244
+ .grid:is(
245
+ [data-layout='fixed'],
246
+ [data-layout='content-sidebar']
247
+ )[data-collapse-at='lg']
248
+ > [data-composition='grid-item'][data-collapse-order='last'] {
249
+ order: 1;
250
+ }
251
+ }
252
+
253
+ @container (width < 54rem) {
254
+ .grid:is(
255
+ [data-layout='fixed'],
256
+ [data-layout='content-sidebar']
257
+ )[data-collapse-at='xl'] {
258
+ grid-template-columns: 1fr;
259
+ }
260
+
261
+ .grid:is(
262
+ [data-layout='fixed'],
263
+ [data-layout='content-sidebar']
264
+ )[data-collapse-at='xl']
265
+ > [data-composition='grid-item'][data-sizing='fill-track'] {
266
+ --grid-item-fill-track-contain: none;
267
+ --grid-item-fill-track-content-block-size: auto;
268
+ --grid-item-fill-track-content-inset: auto;
269
+ --grid-item-fill-track-content-position: static;
270
+ --grid-item-fill-track-overflow: visible;
271
+ }
272
+
273
+ .grid:is(
274
+ [data-layout='fixed'],
275
+ [data-layout='content-sidebar']
276
+ )[data-collapse-at='xl']
277
+ > [data-composition='grid-item'][data-position='sticky'] {
278
+ position: static;
279
+ padding-block-end: 0;
280
+ max-block-size: none;
281
+ overflow: visible;
282
+ }
283
+
284
+ .grid:is(
285
+ [data-layout='fixed'],
286
+ [data-layout='content-sidebar']
287
+ )[data-collapse-at='xl']
288
+ > [data-composition='grid-item'][data-collapse-order='first'] {
289
+ order: -1;
290
+ }
291
+
292
+ .grid:is(
293
+ [data-layout='fixed'],
294
+ [data-layout='content-sidebar']
295
+ )[data-collapse-at='xl']
296
+ > [data-composition='grid-item'][data-collapse-order='last'] {
297
+ order: 1;
298
+ }
299
+ }
300
+
301
+ @container (width < 24rem) {
302
+ .grid[data-compact-columns] {
303
+ grid-template-columns: repeat(var(--grid-compact-columns), minmax(0, 1fr));
304
+ }
305
+
306
+ .grid[data-last-row='fill'][data-compact-columns] > * {
307
+ grid-column: auto;
308
+ }
309
+
310
+ .grid[data-last-row='fill'][data-compact-columns='2']
311
+ > :last-child:nth-child(2n + 1) {
312
+ grid-column: span 2;
313
+ }
314
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+
4
+ type GridItemAlignment = 'auto' | 'start' | 'center' | 'end' | 'stretch';
5
+ type GridItemCollapseOrder = 'first' | 'last' | 'preserve';
6
+ type GridItemSpan = 1 | 2 | 3 | 4;
7
+ type GridItemSizing = 'auto' | 'fill-track';
8
+ type GridItemPosition = 'static' | 'sticky';
9
+ type GridItemElement = 'div' | 'li';
10
+ type GridItemAttributes = HTMLAttributes<'div'> & HTMLAttributes<'li'>;
11
+
12
+ type Props = Omit<GridItemAttributes, 'class' | 'style'> & {
13
+ as?: GridItemElement;
14
+ alignSelf?: GridItemAlignment;
15
+ class?: string;
16
+ collapseOrder?: GridItemCollapseOrder;
17
+ justifySelf?: GridItemAlignment;
18
+ position?: GridItemPosition;
19
+ sizing?: GridItemSizing;
20
+ span?: GridItemSpan;
21
+ };
22
+
23
+ const {
24
+ as: Element = 'div',
25
+ alignSelf = 'auto',
26
+ class: className,
27
+ collapseOrder = 'preserve',
28
+ justifySelf = 'auto',
29
+ position = 'static',
30
+ sizing = 'auto',
31
+ span = 1,
32
+ ...attrs
33
+ }: Props = Astro.props;
34
+ ---
35
+
36
+ <Element
37
+ {...attrs}
38
+ class:list={['grid-item', className]}
39
+ data-composition="grid-item"
40
+ data-align-self={alignSelf}
41
+ data-collapse-order={collapseOrder}
42
+ data-justify-self={justifySelf}
43
+ data-position={position}
44
+ data-sizing={sizing}
45
+ data-span={span}
46
+ >
47
+ <div class="grid-item__content">
48
+ <slot />
49
+ </div>
50
+ </Element>
@@ -0,0 +1,95 @@
1
+ .grid-item {
2
+ box-sizing: border-box;
3
+ min-width: 0;
4
+ min-height: 0;
5
+ }
6
+
7
+ .grid-item__content {
8
+ min-width: 0;
9
+ min-height: 0;
10
+ }
11
+
12
+ .grid-item[data-align-self='start'] {
13
+ align-self: start;
14
+ }
15
+
16
+ .grid-item[data-align-self='center'] {
17
+ align-self: center;
18
+ }
19
+
20
+ .grid-item[data-align-self='end'] {
21
+ align-self: end;
22
+ }
23
+
24
+ .grid-item[data-align-self='stretch'] {
25
+ align-self: stretch;
26
+ }
27
+
28
+ .grid-item[data-justify-self='start'] {
29
+ justify-self: start;
30
+ }
31
+
32
+ .grid-item[data-justify-self='center'] {
33
+ justify-self: center;
34
+ }
35
+
36
+ .grid-item[data-justify-self='end'] {
37
+ justify-self: end;
38
+ }
39
+
40
+ .grid-item[data-justify-self='stretch'] {
41
+ justify-self: stretch;
42
+ }
43
+
44
+ .grid-item[data-position='sticky'] {
45
+ position: sticky;
46
+ z-index: 1;
47
+ top: var(--nox-layout-gap);
48
+ padding-block-end: var(--nox-border-width);
49
+ max-block-size: calc(
50
+ 100vh - var(--nox-site-header-height) - var(--nox-layout-gap) * 2
51
+ );
52
+ max-block-size: calc(
53
+ 100dvh - var(--nox-site-header-height) - var(--nox-layout-gap) * 2
54
+ );
55
+ align-self: start;
56
+ overflow-x: hidden;
57
+ overflow-y: auto;
58
+ }
59
+
60
+ .grid-item[data-span='2'] {
61
+ grid-column: span 2;
62
+ }
63
+
64
+ .grid-item[data-span='3'] {
65
+ grid-column: span 3;
66
+ }
67
+
68
+ .grid-item[data-span='4'] {
69
+ grid-column: span 4;
70
+ }
71
+
72
+ .grid-item[data-sizing='fill-track'] {
73
+ --grid-item-fill-track-contain: size layout;
74
+ --grid-item-fill-track-content-block-size: 100%;
75
+ --grid-item-fill-track-content-inset: 0;
76
+ --grid-item-fill-track-content-position: absolute;
77
+ --grid-item-fill-track-overflow: hidden;
78
+
79
+ position: relative;
80
+ inline-size: 100%;
81
+ min-inline-size: 0;
82
+ min-block-size: 0;
83
+ overflow: var(--grid-item-fill-track-overflow);
84
+ contain: var(--grid-item-fill-track-contain);
85
+ }
86
+
87
+ .grid-item[data-sizing='fill-track'] > .grid-item__content {
88
+ position: var(--grid-item-fill-track-content-position);
89
+ inset: var(--grid-item-fill-track-content-inset);
90
+ display: grid;
91
+ inline-size: 100%;
92
+ block-size: var(--grid-item-fill-track-content-block-size);
93
+ min-inline-size: 0;
94
+ min-block-size: 0;
95
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import type { Tone } from '../../theme/contracts';
4
+
5
+ type InlineElement = 'div' | 'span' | 'section' | 'nav';
6
+ type InlineAlign = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
7
+ type InlineJustify = 'start' | 'center' | 'end' | 'between';
8
+ type InlineGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ type InlineAttributes = HTMLAttributes<'div'> &
10
+ HTMLAttributes<'span'> &
11
+ HTMLAttributes<'section'> &
12
+ HTMLAttributes<'nav'>;
13
+
14
+ type Props = InlineAttributes & {
15
+ as?: InlineElement;
16
+ align?: InlineAlign;
17
+ gap?: InlineGap;
18
+ justify?: InlineJustify;
19
+ tone?: Tone;
20
+ wrap?: boolean;
21
+ };
22
+
23
+ const {
24
+ align = 'stretch',
25
+ as: Element = 'div',
26
+ class: className,
27
+ 'data-tone': dataTone,
28
+ gap = 'none',
29
+ justify = 'start',
30
+ tone,
31
+ wrap = false,
32
+ ...attrs
33
+ }: Props = Astro.props;
34
+ const resolvedTone = tone ?? dataTone;
35
+ ---
36
+
37
+ <Element
38
+ {...attrs}
39
+ class:list={['inline', className]}
40
+ data-align={align}
41
+ data-composition="inline"
42
+ data-gap={gap}
43
+ data-justify={justify}
44
+ data-tone={resolvedTone}
45
+ data-wrap={wrap ? true : undefined}
46
+ >
47
+ <slot />
48
+ </Element>
@@ -0,0 +1,65 @@
1
+ .inline {
2
+ display: flex;
3
+ min-width: 0;
4
+ min-height: 0;
5
+ align-items: stretch;
6
+ justify-content: flex-start;
7
+ flex-wrap: nowrap;
8
+ gap: var(--inline-gap);
9
+ }
10
+
11
+ .inline[data-align='start'] {
12
+ align-items: flex-start;
13
+ }
14
+
15
+ .inline[data-align='center'] {
16
+ align-items: center;
17
+ }
18
+
19
+ .inline[data-align='end'] {
20
+ align-items: flex-end;
21
+ }
22
+
23
+ .inline[data-align='baseline'] {
24
+ align-items: baseline;
25
+ }
26
+
27
+ .inline[data-justify='center'] {
28
+ justify-content: center;
29
+ }
30
+
31
+ .inline[data-justify='end'] {
32
+ justify-content: flex-end;
33
+ }
34
+
35
+ .inline[data-justify='between'] {
36
+ justify-content: space-between;
37
+ }
38
+
39
+ .inline[data-wrap] {
40
+ flex-wrap: wrap;
41
+ }
42
+
43
+ .inline[data-gap='none'] {
44
+ --inline-gap: 0;
45
+ }
46
+
47
+ .inline[data-gap='xs'] {
48
+ --inline-gap: var(--nox-space-2);
49
+ }
50
+
51
+ .inline[data-gap='sm'] {
52
+ --inline-gap: var(--nox-space-3);
53
+ }
54
+
55
+ .inline[data-gap='md'] {
56
+ --inline-gap: var(--nox-space-4);
57
+ }
58
+
59
+ .inline[data-gap='lg'] {
60
+ --inline-gap: var(--nox-space-5);
61
+ }
62
+
63
+ .inline[data-gap='xl'] {
64
+ --inline-gap: var(--nox-space-6);
65
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import type { Tone } from '../../theme/contracts';
4
+
5
+ type StackElement = 'div' | 'form' | 'section' | 'nav';
6
+ type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
+ type StackAttributes = HTMLAttributes<'div'> &
8
+ HTMLAttributes<'form'> &
9
+ HTMLAttributes<'section'> &
10
+ HTMLAttributes<'nav'>;
11
+
12
+ type Props = StackAttributes & {
13
+ as?: StackElement;
14
+ gap?: StackGap;
15
+ tone?: Tone;
16
+ };
17
+
18
+ const {
19
+ as: Element = 'div',
20
+ class: className,
21
+ 'data-tone': dataTone,
22
+ gap = 'md',
23
+ tone,
24
+ ...attrs
25
+ }: Props = Astro.props;
26
+ const resolvedTone = tone ?? dataTone;
27
+ ---
28
+
29
+ <Element
30
+ {...attrs}
31
+ class:list={['stack', className]}
32
+ data-composition="stack"
33
+ data-gap={gap}
34
+ data-tone={resolvedTone}
35
+ >
36
+ <slot />
37
+ </Element>
@@ -0,0 +1,31 @@
1
+ .stack {
2
+ display: grid;
3
+ min-width: 0;
4
+ min-height: 0;
5
+ align-content: start;
6
+ gap: var(--stack-gap);
7
+ }
8
+
9
+ .stack[data-gap='none'] {
10
+ --stack-gap: 0;
11
+ }
12
+
13
+ .stack[data-gap='xs'] {
14
+ --stack-gap: var(--nox-space-2);
15
+ }
16
+
17
+ .stack[data-gap='sm'] {
18
+ --stack-gap: var(--nox-space-3);
19
+ }
20
+
21
+ .stack[data-gap='md'] {
22
+ --stack-gap: var(--nox-space-4);
23
+ }
24
+
25
+ .stack[data-gap='lg'] {
26
+ --stack-gap: var(--nox-space-5);
27
+ }
28
+
29
+ .stack[data-gap='xl'] {
30
+ --stack-gap: var(--nox-space-6);
31
+ }
@@ -0,0 +1,44 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import type { Tone } from '../../theme/contracts';
4
+
5
+ type SurfaceGroupElement = 'div' | 'section' | 'nav';
6
+ type SurfaceGroupAttributes = HTMLAttributes<'div'> &
7
+ HTMLAttributes<'section'> &
8
+ HTMLAttributes<'nav'>;
9
+
10
+ type Props = SurfaceGroupAttributes & {
11
+ as?: SurfaceGroupElement;
12
+ tone?: Tone;
13
+ };
14
+
15
+ const {
16
+ as: Element = 'div',
17
+ class: className,
18
+ 'data-tone': dataTone,
19
+ tone,
20
+ ...attrs
21
+ }: Props = Astro.props;
22
+ const resolvedTone = tone ?? dataTone;
23
+ ---
24
+
25
+ <Element
26
+ {...attrs}
27
+ class:list={['surface-group', className]}
28
+ data-composition="surface-group"
29
+ data-tone={resolvedTone}
30
+ >
31
+ <slot />
32
+ </Element>
33
+
34
+ <script>
35
+ import { initStickySurfaceGroup } from './stickySurfaceGroupController';
36
+
37
+ for (const root of document.querySelectorAll(
38
+ '.surface-group:has(> [data-sticky-surface]):not([data-sticky-initialized])',
39
+ )) {
40
+ if (root instanceof HTMLElement) {
41
+ initStickySurfaceGroup(root);
42
+ }
43
+ }
44
+ </script>