@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,188 @@
1
+ .card-action {
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: var(--nox-tone-background);
6
+ --card-action-size: var(--nox-section-responsive-block-size);
7
+ --card-action-icon-size: var(--nox-compact-media-responsive-size);
8
+ --card-action-hover-seed: var(--nox-tone-seed);
9
+
10
+ display: grid;
11
+ min-width: 0;
12
+ min-height: var(--card-action-size);
13
+ grid-template-columns: minmax(0, 1fr);
14
+ padding: 0;
15
+ overflow: clip;
16
+ border: var(--surface-border-width) solid var(--surface-border-color);
17
+ border-radius: var(--surface-radius);
18
+ background: var(--surface-background);
19
+ color: var(--nox-text);
20
+ font: inherit;
21
+ text-decoration: none;
22
+ cursor: pointer;
23
+ }
24
+
25
+ .card-action[data-has-visual] {
26
+ grid-template-columns: var(--card-action-size) minmax(0, 1fr);
27
+ }
28
+
29
+ .card-action[data-has-visual][data-card-action-visual-position='end'] {
30
+ grid-template-columns: minmax(0, 1fr) var(--card-action-size);
31
+ }
32
+
33
+ .card-action[data-card-action-hover-tone='info'] {
34
+ --card-action-hover-seed: var(--nox-source-tone-info);
35
+ }
36
+
37
+ .card-action[data-card-action-hover-tone='success'] {
38
+ --card-action-hover-seed: var(--nox-source-tone-success);
39
+ }
40
+
41
+ .card-action[data-card-action-hover-tone='warning'] {
42
+ --card-action-hover-seed: var(--nox-source-tone-warning);
43
+ }
44
+
45
+ .card-action[data-card-action-hover-tone='danger'] {
46
+ --card-action-hover-seed: var(--nox-source-tone-danger);
47
+ }
48
+
49
+ .card-action__visual {
50
+ grid-column: 1;
51
+ grid-row: 1;
52
+ display: grid;
53
+ min-width: 0;
54
+ min-height: var(--card-action-size);
55
+ place-items: center;
56
+ border-inline-end: var(--surface-border-width) solid
57
+ var(--surface-border-color);
58
+ background: var(--nox-tone-background-strong);
59
+ color: var(--nox-tone-color);
60
+ }
61
+
62
+ .card-action[data-card-action-visual-position='end']
63
+ .card-action__visual {
64
+ grid-column: 2;
65
+ border-inline-start: var(--surface-border-width) solid
66
+ var(--surface-border-color);
67
+ border-inline-end: 0;
68
+ }
69
+
70
+ .card-action__icon {
71
+ display: block;
72
+ inline-size: var(--card-action-icon-size);
73
+ block-size: var(--card-action-icon-size);
74
+ color: var(--nox-tone-color);
75
+ }
76
+
77
+ .card-action__media {
78
+ --media-object-inline-size: 100%;
79
+ --media-object-block-size: 100%;
80
+ --media-object-max-inline-size: var(--card-action-icon-size);
81
+ --media-object-max-block-size: var(--card-action-icon-size);
82
+
83
+ inline-size: var(--card-action-size);
84
+ block-size: var(--card-action-size);
85
+ }
86
+
87
+ .card-action__label {
88
+ display: grid;
89
+ min-width: 0;
90
+ min-height: var(--card-action-size);
91
+ place-items: center;
92
+ padding: var(--nox-space-3) var(--nox-space-5);
93
+ color: var(--nox-tone-text);
94
+ font-size: var(--nox-font-size-md);
95
+ font-weight: var(--nox-font-weight-strong);
96
+ line-height: var(--nox-line-height-tight);
97
+ text-align: center;
98
+ overflow-wrap: anywhere;
99
+ }
100
+
101
+ .card-action[data-card-action-label-treatment='heading']
102
+ .card-action__label {
103
+ font-size: var(--nox-font-size-lg);
104
+ letter-spacing: var(--nox-letter-spacing-wide);
105
+ text-transform: uppercase;
106
+ }
107
+
108
+ .card-action[data-has-visual] .card-action__label {
109
+ grid-column: 2;
110
+ grid-row: 1;
111
+ }
112
+
113
+ .card-action[data-card-action-visual-position='end']
114
+ .card-action__label {
115
+ grid-column: 1;
116
+ }
117
+
118
+ .card-action__label-full,
119
+ .card-action__label-compact {
120
+ min-width: 0;
121
+ }
122
+
123
+ .card-action__label-compact {
124
+ display: none;
125
+ }
126
+
127
+ .card-action:focus-visible {
128
+ outline: var(--nox-focus-ring-width) solid var(--nox-tone-focus-ring);
129
+ outline-offset: var(--nox-focus-ring-offset);
130
+ background: color-mix(
131
+ in srgb,
132
+ var(--card-action-hover-seed) 12%,
133
+ var(--nox-mix-light)
134
+ );
135
+ }
136
+
137
+ .card-action:disabled,
138
+ .card-action[aria-disabled='true'] {
139
+ opacity: 0.58;
140
+ cursor: not-allowed;
141
+ }
142
+
143
+ @media (hover: hover) and (pointer: fine) {
144
+ .card-action:hover:not(:disabled, [aria-disabled='true']) {
145
+ background: color-mix(
146
+ in srgb,
147
+ var(--card-action-hover-seed) 12%,
148
+ var(--nox-mix-light)
149
+ );
150
+ }
151
+ }
152
+
153
+ .card-action:active:not(:disabled, [aria-disabled='true']) {
154
+ background: color-mix(
155
+ in srgb,
156
+ var(--card-action-hover-seed) 18%,
157
+ var(--nox-mix-light)
158
+ );
159
+ }
160
+
161
+ @media (prefers-reduced-motion: no-preference) {
162
+ .card-action {
163
+ transition:
164
+ background-color var(--nox-motion-duration-sm)
165
+ var(--nox-motion-easing-standard),
166
+ transform var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
167
+ }
168
+
169
+ .card-action:active:not(:disabled, [aria-disabled='true']) {
170
+ transform: translateY(1px);
171
+ }
172
+ }
173
+
174
+ @media (width < 48rem) {
175
+ .card-action[data-card-action-compact-label]
176
+ .card-action__label-full {
177
+ display: none;
178
+ }
179
+
180
+ .card-action[data-card-action-compact-label]
181
+ .card-action__label-compact {
182
+ display: block;
183
+ }
184
+
185
+ .card-action__label {
186
+ padding-inline: var(--nox-space-3);
187
+ }
188
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import type { DisplayMedia } from '../../../display/contracts';
4
+ import type { Tone } from '../../../theme/contracts';
5
+ import Media from '../../../primitives/media/Media/Media.astro';
6
+
7
+ type Props = Omit<HTMLAttributes<'button'>, 'type'> & {
8
+ accentTone?: Tone;
9
+ label: string;
10
+ media: DisplayMedia;
11
+ tone?: Tone;
12
+ };
13
+
14
+ const {
15
+ accentTone,
16
+ class: className,
17
+ 'data-tone': dataTone,
18
+ label,
19
+ media,
20
+ tone,
21
+ ...attrs
22
+ }: Props = Astro.props;
23
+ const resolvedTone = tone ?? dataTone;
24
+ ---
25
+
26
+ <button
27
+ {...attrs}
28
+ class:list={['media-trigger', className]}
29
+ type="button"
30
+ aria-label={label}
31
+ data-tone={resolvedTone}
32
+ data-widget="media-trigger"
33
+ >
34
+ <Media
35
+ class="media-trigger__media"
36
+ media={media}
37
+ fit="contain"
38
+ size="fill"
39
+ data-tone={accentTone}
40
+ />
41
+ {
42
+ accentTone ? (
43
+ <span
44
+ class="media-trigger__sparkles"
45
+ data-tone={accentTone}
46
+ aria-hidden="true"
47
+ >
48
+ <span class="media-trigger__sparkle" />
49
+ <span class="media-trigger__sparkle" />
50
+ <span class="media-trigger__sparkle" />
51
+ <span class="media-trigger__sparkle" />
52
+ </span>
53
+ ) : null
54
+ }
55
+ </button>
@@ -0,0 +1,175 @@
1
+ .media-trigger {
2
+ position: relative;
3
+ display: grid;
4
+ inline-size: 100%;
5
+ block-size: 100%;
6
+ min-inline-size: 0;
7
+ min-block-size: 0;
8
+ padding: var(--nox-space-4);
9
+ place-items: center;
10
+ border: 0;
11
+ outline: 0;
12
+ background: transparent;
13
+ color: inherit;
14
+ font: inherit;
15
+ cursor: pointer;
16
+ isolation: isolate;
17
+ }
18
+
19
+ .media-trigger__media {
20
+ z-index: 1;
21
+ inline-size: 100%;
22
+ block-size: 100%;
23
+ filter: drop-shadow(
24
+ 0 0 var(--nox-space-1)
25
+ color-mix(in srgb, var(--nox-tone-color) 42%, transparent)
26
+ )
27
+ drop-shadow(
28
+ 0 0 var(--nox-space-2)
29
+ color-mix(in srgb, var(--nox-tone-color) 16%, transparent)
30
+ )
31
+ brightness(1.01);
32
+ transform: scale(1);
33
+ transform-origin: center;
34
+ }
35
+
36
+ .media-trigger__sparkles {
37
+ position: absolute;
38
+ z-index: 2;
39
+ inset: var(--nox-space-3);
40
+ opacity: 1;
41
+ pointer-events: none;
42
+ }
43
+
44
+ .media-trigger__sparkle {
45
+ position: absolute;
46
+ display: block;
47
+ inline-size: var(--nox-space-3);
48
+ block-size: var(--nox-space-3);
49
+ background: color-mix(
50
+ in srgb,
51
+ var(--nox-tone-color) 62%,
52
+ var(--nox-mix-light)
53
+ );
54
+ clip-path: polygon(
55
+ 50% 0,
56
+ 60% 38%,
57
+ 100% 50%,
58
+ 60% 62%,
59
+ 50% 100%,
60
+ 40% 62%,
61
+ 0 50%,
62
+ 40% 38%
63
+ );
64
+ filter: drop-shadow(
65
+ 0 0 var(--nox-space-1)
66
+ color-mix(in srgb, var(--nox-tone-color) 78%, transparent)
67
+ );
68
+ opacity: 0.58;
69
+ }
70
+
71
+ .media-trigger__sparkle:nth-child(1) {
72
+ inset-block-start: 12%;
73
+ inset-inline-start: 26%;
74
+ }
75
+
76
+ .media-trigger__sparkle:nth-child(2) {
77
+ inset-block-start: 24%;
78
+ inset-inline-end: 18%;
79
+ }
80
+
81
+ .media-trigger__sparkle:nth-child(3) {
82
+ inset-block-end: 22%;
83
+ inset-inline-start: 16%;
84
+ }
85
+
86
+ .media-trigger__sparkle:nth-child(4) {
87
+ inset-block-end: 12%;
88
+ inset-inline-end: 28%;
89
+ }
90
+
91
+ .media-trigger:focus-visible .media-trigger__media {
92
+ filter: drop-shadow(
93
+ 0 0 var(--nox-focus-ring-width)
94
+ color-mix(in srgb, var(--nox-tone-focus-ring) 88%, transparent)
95
+ )
96
+ drop-shadow(
97
+ 0 0 var(--nox-space-2)
98
+ color-mix(in srgb, var(--nox-tone-color) 32%, transparent)
99
+ )
100
+ brightness(1.04);
101
+ transform: scale(1.02);
102
+ }
103
+
104
+ .media-trigger:focus-visible .media-trigger__sparkles {
105
+ opacity: 0;
106
+ visibility: hidden;
107
+ }
108
+
109
+ @media (hover: hover) and (pointer: fine) {
110
+ .media-trigger:hover .media-trigger__media {
111
+ filter: drop-shadow(
112
+ 0 0 var(--nox-space-1)
113
+ color-mix(in srgb, var(--nox-tone-color) 58%, transparent)
114
+ )
115
+ drop-shadow(
116
+ 0 0 var(--nox-space-3)
117
+ color-mix(in srgb, var(--nox-tone-color) 24%, transparent)
118
+ )
119
+ brightness(1.04);
120
+ transform: scale(1.035);
121
+ }
122
+
123
+ .media-trigger:hover .media-trigger__sparkles {
124
+ opacity: 0;
125
+ visibility: hidden;
126
+ }
127
+ }
128
+
129
+ @media (prefers-reduced-motion: no-preference) {
130
+ .media-trigger__media {
131
+ transition:
132
+ filter var(--nox-motion-duration-sm) var(--nox-motion-easing-standard),
133
+ transform var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
134
+ }
135
+
136
+ .media-trigger__sparkle {
137
+ animation: media-trigger-sparkle 2.6s ease-in-out infinite;
138
+ }
139
+
140
+ .media-trigger__sparkle:nth-child(2) {
141
+ animation-delay: -0.65s;
142
+ }
143
+
144
+ .media-trigger__sparkle:nth-child(3) {
145
+ animation-delay: -1.3s;
146
+ }
147
+
148
+ .media-trigger__sparkle:nth-child(4) {
149
+ animation-delay: -1.95s;
150
+ }
151
+
152
+ .media-trigger:focus-visible .media-trigger__sparkle,
153
+ .media-trigger:hover .media-trigger__sparkle {
154
+ animation: none;
155
+ }
156
+ }
157
+
158
+ @keyframes media-trigger-sparkle {
159
+ 0%,
160
+ 28%,
161
+ 100% {
162
+ opacity: 0.16;
163
+ transform: scale(0.45) rotate(0deg);
164
+ }
165
+
166
+ 12% {
167
+ opacity: 0.92;
168
+ transform: scale(1) rotate(45deg);
169
+ }
170
+
171
+ 20% {
172
+ opacity: 0.38;
173
+ transform: scale(0.68) rotate(72deg);
174
+ }
175
+ }
@@ -0,0 +1,36 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import Button from '../Button/Button.astro';
4
+ import ArrowUpIcon from '../../icons/ArrowUpIcon.astro';
5
+
6
+ type Props = Omit<HTMLAttributes<'button'>, 'type'> & {
7
+ label: string;
8
+ };
9
+
10
+ const { class: className, label, ...attrs }: Props = Astro.props;
11
+ const resolvedClass = ['scroll-to-top', className].filter(Boolean).join(' ');
12
+ ---
13
+
14
+ <Button
15
+ {...attrs}
16
+ class={resolvedClass}
17
+ type="button"
18
+ aria-label={label}
19
+ title={label}
20
+ hoverTone="info"
21
+ iconOnly
22
+ hidden
23
+ data-scroll-to-top
24
+ >
25
+ <ArrowUpIcon />
26
+ </Button>
27
+
28
+ <script>
29
+ import { initScrollToTop } from './scrollToTopController';
30
+
31
+ for (const control of document.querySelectorAll('[data-scroll-to-top]')) {
32
+ if (control instanceof HTMLButtonElement) {
33
+ initScrollToTop(control);
34
+ }
35
+ }
36
+ </script>
@@ -0,0 +1,19 @@
1
+ .scroll-to-top.nox-button {
2
+ position: fixed;
3
+ z-index: 45;
4
+ inset-inline-end: calc(
5
+ var(--nox-space-5) + env(safe-area-inset-right)
6
+ );
7
+ inset-block-end: calc(
8
+ var(--nox-space-5) + env(safe-area-inset-bottom)
9
+ );
10
+ inline-size: var(--nox-section-compact-block-size);
11
+ block-size: var(--nox-section-compact-block-size);
12
+ min-block-size: 0;
13
+ box-shadow: var(--nox-shadow-surface);
14
+ }
15
+
16
+ html:has(dialog[open]) .scroll-to-top,
17
+ html:has(:fullscreen) .scroll-to-top {
18
+ display: none;
19
+ }
@@ -0,0 +1,32 @@
1
+ const initializedAttribute = 'data-scroll-to-top-initialized';
2
+ const noop = (): void => undefined;
3
+
4
+ export function initScrollToTop(control: HTMLButtonElement): () => void {
5
+ if (control.getAttribute(initializedAttribute) === 'true') return noop;
6
+
7
+ const viewport = document.querySelector<HTMLElement>('[data-site-viewport]');
8
+ if (!viewport) return noop;
9
+
10
+ control.setAttribute(initializedAttribute, 'true');
11
+
12
+ const sync = (): void => {
13
+ control.hidden =
14
+ viewport.scrollTop <= 0 || document.fullscreenElement !== null;
15
+ };
16
+
17
+ const scrollToTop = (): void => {
18
+ viewport.scrollTo({ top: 0, behavior: 'auto' });
19
+ };
20
+
21
+ viewport.addEventListener('scroll', sync, { passive: true });
22
+ document.addEventListener('fullscreenchange', sync);
23
+ control.addEventListener('click', scrollToTop);
24
+ sync();
25
+
26
+ return () => {
27
+ viewport.removeEventListener('scroll', sync);
28
+ document.removeEventListener('fullscreenchange', sync);
29
+ control.removeEventListener('click', scrollToTop);
30
+ control.removeAttribute(initializedAttribute);
31
+ };
32
+ }
@@ -0,0 +1,31 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+
4
+ type Props = HTMLAttributes<'div'> & {
5
+ id?: string;
6
+ inset?: 'default' | 'none';
7
+ overlayBoundary?: boolean;
8
+ };
9
+
10
+ const {
11
+ class: className,
12
+ id,
13
+ inset = 'default',
14
+ overlayBoundary = false,
15
+ ...attrs
16
+ }: Props = Astro.props;
17
+ ---
18
+
19
+ <div
20
+ {...attrs}
21
+ class:list={['card-body', className]}
22
+ id={id}
23
+ data-widget="card-body"
24
+ data-surface
25
+ data-inset={inset}
26
+ data-overlay-boundary={overlayBoundary ? true : undefined}
27
+ >
28
+ <div class="card-body__content">
29
+ <slot />
30
+ </div>
31
+ </div>
@@ -0,0 +1,74 @@
1
+ .card-body {
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: var(--nox-surface);
6
+ --card-body-border-color: var(--surface-border-color);
7
+
8
+ container-type: inline-size;
9
+ display: flex;
10
+ min-width: 0;
11
+ min-height: 0;
12
+ border: var(--surface-border-width) solid var(--card-body-border-color);
13
+ border-radius: var(--surface-radius);
14
+ background: var(--surface-background);
15
+ color: var(--nox-text);
16
+ line-height: 1.7;
17
+ overflow-wrap: anywhere;
18
+ }
19
+
20
+ .card-body__content {
21
+ --nox-content-padding: var(--nox-space-5);
22
+ --nox-content-inline-inset: var(--nox-content-padding);
23
+
24
+ display: grid;
25
+ flex: 1 1 auto;
26
+ min-width: 0;
27
+ min-height: 0;
28
+ gap: var(--nox-space-4);
29
+ padding: var(--nox-content-padding);
30
+ }
31
+
32
+ .card-body[data-inset='none'] .card-body__content {
33
+ --nox-content-padding: 0px;
34
+ --nox-content-inline-inset: 0px;
35
+
36
+ gap: 0;
37
+ padding: 0;
38
+ }
39
+
40
+ .card-body[data-inset='none'] {
41
+ overflow: clip;
42
+ }
43
+
44
+ .card-body p {
45
+ margin: 0;
46
+ }
47
+
48
+ .card-body a {
49
+ color: var(--nox-link);
50
+ text-underline-offset: 0.2em;
51
+ }
52
+
53
+ .card-body strong {
54
+ color: var(--nox-text);
55
+ font-weight: var(--nox-font-weight-strong);
56
+ }
57
+
58
+ @container (width < 32rem) {
59
+ .card-body__content {
60
+ --nox-content-padding: var(--nox-space-4);
61
+ --nox-content-inline-inset: var(--nox-content-padding);
62
+
63
+ gap: var(--nox-space-3);
64
+ padding: var(--nox-content-padding);
65
+ }
66
+
67
+ .card-body[data-inset='none'] .card-body__content {
68
+ --nox-content-padding: 0px;
69
+ --nox-content-inline-inset: 0px;
70
+
71
+ gap: 0;
72
+ padding: 0;
73
+ }
74
+ }
@@ -0,0 +1,58 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types';
3
+ import type { DisplayMedia } from '../../../display/contracts';
4
+ import type { Tone } from '../../../theme/contracts';
5
+ import Media from '../../../primitives/media/Media/Media.astro';
6
+
7
+ type Props = HTMLAttributes<'footer'> & {
8
+ media?: DisplayMedia;
9
+ tone?: Tone;
10
+ };
11
+
12
+ const {
13
+ class: className,
14
+ 'data-tone': dataTone,
15
+ media,
16
+ tone,
17
+ ...attrs
18
+ }: Props = Astro.props;
19
+ const resolvedTone = tone ?? dataTone;
20
+ const hasAction = Astro.slots.has('action');
21
+ const hasMedia = Boolean(media);
22
+ ---
23
+
24
+ <footer
25
+ {...attrs}
26
+ class:list={['card-footer', className]}
27
+ data-widget="card-footer"
28
+ data-surface
29
+ data-surface-sizing="content"
30
+ data-has-action={hasAction ? true : undefined}
31
+ data-has-media={hasMedia ? true : undefined}
32
+ data-tone={resolvedTone}
33
+ >
34
+ <div class="card-footer__layout">
35
+ {
36
+ media ? (
37
+ <div class="card-footer__media" aria-hidden="true">
38
+ <Media
39
+ class="card-footer__image"
40
+ media={media}
41
+ fit="contain"
42
+ size="intrinsic"
43
+ />
44
+ </div>
45
+ ) : null
46
+ }
47
+ <div class="card-footer__content">
48
+ <slot />
49
+ </div>
50
+ {
51
+ hasAction ? (
52
+ <div class="card-footer__action">
53
+ <slot name="action" />
54
+ </div>
55
+ ) : null
56
+ }
57
+ </div>
58
+ </footer>