@astronox/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +66 -0
- package/package.json +77 -0
- package/src/client/clipboard.ts +7 -0
- package/src/client/focus.ts +17 -0
- package/src/client/index.ts +3 -0
- package/src/client/scroll.ts +15 -0
- package/src/components/actions/ActionListItem/ActionListItem.astro +78 -0
- package/src/components/actions/ActionListItem/ActionListItem.css +43 -0
- package/src/components/actions/Button/Button.astro +100 -0
- package/src/components/actions/Button/Button.css +165 -0
- package/src/components/actions/CardAction/CardAction.astro +97 -0
- package/src/components/actions/CardAction/CardAction.css +188 -0
- package/src/components/actions/MediaTrigger/MediaTrigger.astro +55 -0
- package/src/components/actions/MediaTrigger/MediaTrigger.css +175 -0
- package/src/components/actions/ScrollToTop/ScrollToTop.astro +36 -0
- package/src/components/actions/ScrollToTop/ScrollToTop.css +19 -0
- package/src/components/actions/ScrollToTop/scrollToTopController.ts +32 -0
- package/src/components/content/CardBody/CardBody.astro +31 -0
- package/src/components/content/CardBody/CardBody.css +74 -0
- package/src/components/content/CardFooter/CardFooter.astro +58 -0
- package/src/components/content/CardFooter/CardFooter.css +102 -0
- package/src/components/content/CardHeader/CardHeader.astro +96 -0
- package/src/components/content/CardHeader/CardHeader.css +164 -0
- package/src/components/content/CardLink/CardLink.astro +138 -0
- package/src/components/content/CardLink/CardLink.css +362 -0
- package/src/components/content/CodeBlock/CodeBlock.astro +102 -0
- package/src/components/content/CodeBlock/CodeBlock.css +85 -0
- package/src/components/content/CodeBlock/codeBlockController.ts +60 -0
- package/src/components/content/CodeBlock/contracts.ts +8 -0
- package/src/components/content/InlineDefinition/InlineDefinition.astro +31 -0
- package/src/components/content/InlineDefinition/InlineDefinition.css +9 -0
- package/src/components/content/MarkdownContent/MarkdownContent.astro +32 -0
- package/src/components/content/MarkdownContent/MarkdownContent.css +358 -0
- package/src/components/content/MarkdownContent/MarkdownInline.astro +44 -0
- package/src/components/content/MarkdownContent/MarkdownNode.astro +280 -0
- package/src/components/content/MarkdownContent/MarkdownSymbol.astro +47 -0
- package/src/components/content/MarkdownContent/contracts.ts +181 -0
- package/src/components/data-display/BadgeList/BadgeList.astro +54 -0
- package/src/components/data-display/BadgeList/BadgeList.css +29 -0
- package/src/components/data-display/IconList/IconList.astro +64 -0
- package/src/components/data-display/IconList/IconList.css +55 -0
- package/src/components/data-display/MetricTile/MetricTile.astro +68 -0
- package/src/components/data-display/MetricTile/MetricTile.css +103 -0
- package/src/components/data-display/MetricTile/MetricTileContent.astro +70 -0
- package/src/components/data-display/MetricTile/metricTileController.ts +9 -0
- package/src/components/data-display/Tag/Tag.astro +67 -0
- package/src/components/data-display/Tag/Tag.css +134 -0
- package/src/components/data-display/Tag/TagAffix.astro +33 -0
- package/src/components/data-display/TextPair/TextPair.astro +63 -0
- package/src/components/data-display/TextPair/TextPair.css +99 -0
- package/src/components/feedback/Spinner/Spinner.astro +32 -0
- package/src/components/feedback/Spinner/Spinner.css +37 -0
- package/src/components/feedback/Tooltip/Tooltip.astro +66 -0
- package/src/components/feedback/Tooltip/Tooltip.css +67 -0
- package/src/components/feedback/Tooltip/tooltipController.ts +371 -0
- package/src/components/forms/FieldError/FieldError.astro +31 -0
- package/src/components/forms/FieldError/FieldError.css +12 -0
- package/src/components/forms/FieldError/fieldErrorState.ts +21 -0
- package/src/components/forms/FieldLabel/FieldLabel.astro +32 -0
- package/src/components/forms/FieldLabel/FieldLabel.css +17 -0
- package/src/components/forms/TextInput/TextInput.astro +79 -0
- package/src/components/forms/TextInput/TextInput.css +121 -0
- package/src/components/forms/TextInput/textInputController.ts +53 -0
- package/src/components/icons/ArrowDownIcon.astro +26 -0
- package/src/components/icons/ArrowLeftIcon.astro +26 -0
- package/src/components/icons/ArrowRightIcon.astro +26 -0
- package/src/components/icons/ArrowUpDownIcon.astro +26 -0
- package/src/components/icons/ArrowUpIcon.astro +26 -0
- package/src/components/icons/BulletIcon.astro +21 -0
- package/src/components/icons/BurnIcon.astro +24 -0
- package/src/components/icons/CircleSymbolIcon.css +66 -0
- package/src/components/icons/ClearIcon.astro +28 -0
- package/src/components/icons/CloseIcon.astro +21 -0
- package/src/components/icons/CopyIcon.astro +30 -0
- package/src/components/icons/CurrencyIcon.css +9 -0
- package/src/components/icons/DayIcon.astro +33 -0
- package/src/components/icons/DollarIcon.astro +28 -0
- package/src/components/icons/DownloadIcon.astro +22 -0
- package/src/components/icons/EnterFullscreenIcon.astro +22 -0
- package/src/components/icons/EqualIcon.astro +25 -0
- package/src/components/icons/ExitFullscreenIcon.astro +22 -0
- package/src/components/icons/ExternalLinkIcon.astro +22 -0
- package/src/components/icons/FieldIcon.astro +28 -0
- package/src/components/icons/GrassIcon.astro +29 -0
- package/src/components/icons/InfoIcon.astro +24 -0
- package/src/components/icons/MinusIcon.astro +21 -0
- package/src/components/icons/MountainIcon.astro +31 -0
- package/src/components/icons/NightIcon.astro +32 -0
- package/src/components/icons/PlayIcon.astro +22 -0
- package/src/components/icons/PlusIcon.astro +21 -0
- package/src/components/icons/PoisonIcon.astro +24 -0
- package/src/components/icons/RibbonIcon.astro +25 -0
- package/src/components/icons/SlashIcon.astro +22 -0
- package/src/components/icons/SlowIcon.astro +25 -0
- package/src/components/icons/StarIcon.astro +28 -0
- package/src/components/icons/StunIcon.astro +22 -0
- package/src/components/icons/TableSortIcon.astro +34 -0
- package/src/components/icons/WaterIcon.astro +30 -0
- package/src/components/index.ts +83 -0
- package/src/components/media/CanvasFrame/CanvasFrame.astro +130 -0
- package/src/components/media/CanvasFrame/CanvasFrame.css +59 -0
- package/src/components/media/CanvasFrame/canvasFrameController.ts +104 -0
- package/src/components/media/EmbedFrame/EmbedFrame.astro +147 -0
- package/src/components/media/EmbedFrame/EmbedFrame.css +51 -0
- package/src/components/media/EmbedFrame/embedFrameController.ts +66 -0
- package/src/components/media/MediaFrame/MediaFrame.astro +34 -0
- package/src/components/media/MediaFrame/MediaFrame.css +66 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.astro +55 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.css +89 -0
- package/src/components/navigation/DesktopNavigation.astro +92 -0
- package/src/components/navigation/DesktopNavigation.css +99 -0
- package/src/components/navigation/Header.astro +73 -0
- package/src/components/navigation/Header.css +20 -0
- package/src/components/navigation/MobileNavigation.astro +124 -0
- package/src/components/navigation/MobileNavigation.css +177 -0
- package/src/components/navigation/NavigationBrand.astro +63 -0
- package/src/components/navigation/NavigationBrand.css +52 -0
- package/src/components/navigation/NavigationControl.css +166 -0
- package/src/components/navigation/NavigationItemContent.astro +24 -0
- package/src/components/navigation/NavigationLink.astro +121 -0
- package/src/components/navigation/NavigationLinks.astro +27 -0
- package/src/components/navigation/NavigationMenuList.astro +37 -0
- package/src/components/navigation/NavigationMenuList.css +6 -0
- package/src/components/navigation/SkipLink/SkipLink.astro +18 -0
- package/src/components/navigation/SkipLink/SkipLink.css +26 -0
- package/src/components/navigation/SubNavigation/SubNavigation.astro +124 -0
- package/src/components/navigation/SubNavigation/SubNavigation.css +211 -0
- package/src/components/navigation/mobileNavigationController.ts +122 -0
- package/src/components/navigation/navigationState.ts +35 -0
- package/src/components/navigation/navigationTypes.ts +18 -0
- package/src/components/seo/SeoHead.astro +194 -0
- package/src/components/widgetTypes.ts +3 -0
- package/src/composition/Grid/Grid.astro +82 -0
- package/src/composition/Grid/Grid.css +314 -0
- package/src/composition/GridItem/GridItem.astro +50 -0
- package/src/composition/GridItem/GridItem.css +95 -0
- package/src/composition/Inline/Inline.astro +48 -0
- package/src/composition/Inline/Inline.css +65 -0
- package/src/composition/Stack/Stack.astro +37 -0
- package/src/composition/Stack/Stack.css +31 -0
- package/src/composition/SurfaceGroup/SurfaceGroup.astro +44 -0
- package/src/composition/SurfaceGroup/SurfaceGroup.css +76 -0
- package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +89 -0
- package/src/composition/index.ts +6 -0
- package/src/config/index.ts +2 -0
- package/src/config/pageMeta.ts +55 -0
- package/src/config/siteConfig.ts +90 -0
- package/src/data/collectionValidation.ts +61 -0
- package/src/data/index.ts +1 -0
- package/src/display/contracts.ts +284 -0
- package/src/display/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/layouts/BaseLayout.astro +74 -0
- package/src/layouts/PageSurface.astro +15 -0
- package/src/layouts/PageSurface.css +24 -0
- package/src/layouts/index.ts +2 -0
- package/src/patterns/CircuitPuzzle/CircuitPuzzle.astro +93 -0
- package/src/patterns/CircuitPuzzle/CircuitPuzzle.css +118 -0
- package/src/patterns/CircuitPuzzle/circuitPuzzleController.ts +205 -0
- package/src/patterns/CircuitPuzzle/contracts.ts +42 -0
- package/src/patterns/Combobox/Combobox.astro +462 -0
- package/src/patterns/Combobox/Combobox.css +403 -0
- package/src/patterns/Combobox/comboboxController.ts +788 -0
- package/src/patterns/Combobox/contracts.ts +18 -0
- package/src/patterns/Dropdown/Dropdown.astro +127 -0
- package/src/patterns/Dropdown/Dropdown.css +100 -0
- package/src/patterns/Dropdown/dropdownController.ts +157 -0
- package/src/patterns/Fullscreen/FullscreenControl.astro +103 -0
- package/src/patterns/Fullscreen/FullscreenControl.css +49 -0
- package/src/patterns/Fullscreen/fullscreenController.ts +73 -0
- package/src/patterns/GlitchOverlay/GlitchOverlay.astro +50 -0
- package/src/patterns/GlitchOverlay/GlitchOverlay.css +234 -0
- package/src/patterns/GlitchOverlay/glitchOverlayController.ts +152 -0
- package/src/patterns/GuidedFlow/GuidedFlow.astro +60 -0
- package/src/patterns/GuidedFlow/GuidedFlow.css +82 -0
- package/src/patterns/GuidedFlow/contracts.ts +3 -0
- package/src/patterns/GuidedFlow/guidedFlowController.ts +49 -0
- package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.astro +217 -0
- package/src/patterns/MagneticFieldPuzzle/MagneticFieldPuzzle.css +383 -0
- package/src/patterns/MagneticFieldPuzzle/contracts.ts +81 -0
- package/src/patterns/MagneticFieldPuzzle/magneticFieldPuzzleController.ts +802 -0
- package/src/patterns/MagneticFieldPuzzle/simulation.ts +244 -0
- package/src/patterns/MapViewport/MapViewport.astro +296 -0
- package/src/patterns/MapViewport/MapViewport.css +257 -0
- package/src/patterns/MapViewport/contracts.ts +79 -0
- package/src/patterns/MapViewport/geometry.ts +80 -0
- package/src/patterns/MapViewport/mapViewportController.ts +636 -0
- package/src/patterns/Modal/Modal.astro +64 -0
- package/src/patterns/Modal/Modal.css +87 -0
- package/src/patterns/Modal/ModalClose.astro +37 -0
- package/src/patterns/Modal/ModalOpen.astro +36 -0
- package/src/patterns/Modal/modalController.ts +118 -0
- package/src/patterns/PuzzleGrid/PuzzleGrid.astro +22 -0
- package/src/patterns/PuzzleGrid/PuzzleGrid.css +149 -0
- package/src/patterns/PuzzleGrid/contracts.ts +2 -0
- package/src/patterns/PuzzleGrid/selectionDismissal.ts +27 -0
- package/src/patterns/PuzzleGrid/state.ts +25 -0
- package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.astro +65 -0
- package/src/patterns/SpriteProjectilePreview/SpriteProjectilePreview.css +35 -0
- package/src/patterns/SpriteProjectilePreview/contracts.ts +33 -0
- package/src/patterns/SpriteProjectilePreview/spriteProjectilePreviewController.ts +586 -0
- package/src/patterns/StageFlow/StageFlow.astro +57 -0
- package/src/patterns/StageFlow/StageFlow.css +54 -0
- package/src/patterns/StageFlow/StageFlowAlternative.astro +23 -0
- package/src/patterns/StageFlow/StageFlowArrow.astro +22 -0
- package/src/patterns/StageFlow/StageFlowConnector.astro +7 -0
- package/src/patterns/StageFlow/StageFlowConnector.css +4 -0
- package/src/patterns/StageFlow/StageFlowStage.astro +51 -0
- package/src/patterns/StageFlow/StageFlowStage.css +106 -0
- package/src/patterns/StageFlow/StageFlowStep.astro +24 -0
- package/src/patterns/StageFlow/StageFlowStep.css +19 -0
- package/src/patterns/StageFlow/StageFlowSymbol.css +28 -0
- package/src/patterns/Table/Table.astro +176 -0
- package/src/patterns/Table/Table.css +70 -0
- package/src/patterns/Table/TableBody.astro +185 -0
- package/src/patterns/Table/TableBody.css +262 -0
- package/src/patterns/Table/TableCell.astro +59 -0
- package/src/patterns/Table/TableCell.css +99 -0
- package/src/patterns/Table/TableCellValue.astro +86 -0
- package/src/patterns/Table/TableFooter.astro +32 -0
- package/src/patterns/Table/TableFooter.css +31 -0
- package/src/patterns/Table/TableHeader.astro +118 -0
- package/src/patterns/Table/TableHeader.css +209 -0
- package/src/patterns/Table/TablePagination.astro +70 -0
- package/src/patterns/Table/TablePagination.css +133 -0
- package/src/patterns/Table/TableSkeleton.astro +36 -0
- package/src/patterns/Table/TableSkeleton.css +81 -0
- package/src/patterns/Table/tableCellController.ts +11 -0
- package/src/patterns/Table/tableFilterController.ts +206 -0
- package/src/patterns/Table/tableHeaderOverflowController.ts +105 -0
- package/src/patterns/Table/tableLayout.ts +113 -0
- package/src/patterns/Table/tableProgressiveController.ts +319 -0
- package/src/patterns/Table/tableRowNavigationController.ts +91 -0
- package/src/patterns/Table/tableScrollController.ts +192 -0
- package/src/patterns/Table/tableSortController.ts +272 -0
- package/src/patterns/index.ts +46 -0
- package/src/primitives/index.ts +4 -0
- package/src/primitives/layout/Separator/Separator.astro +29 -0
- package/src/primitives/layout/Separator/Separator.css +20 -0
- package/src/primitives/media/AmbientAudio/AmbientAudio.astro +28 -0
- package/src/primitives/media/Media/Media.astro +122 -0
- package/src/primitives/media/Media/Media.css +161 -0
- package/src/primitives/text/TextBlock/TextBlock.astro +46 -0
- package/src/primitives/text/TextBlock/TextBlock.css +21 -0
- package/src/seo/StaticRedirect.astro +32 -0
- package/src/seo/index.ts +6 -0
- package/src/seo/pageSeo.ts +99 -0
- package/src/seo/robots.ts +16 -0
- package/src/seo/sitemap.ts +38 -0
- package/src/seo/structuredData.ts +133 -0
- package/src/seo/url.ts +64 -0
- package/src/styles/base.css +148 -0
- package/src/styles/interaction.css +108 -0
- package/src/styles/style.css +93 -0
- package/src/styles/tokens.css +256 -0
- package/src/theme/contracts.ts +7 -0
- package/src/theme/index.ts +1 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
.card-link {
|
|
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(
|
|
6
|
+
in srgb,
|
|
7
|
+
var(--nox-tone-color) 8%,
|
|
8
|
+
var(--nox-surface)
|
|
9
|
+
);
|
|
10
|
+
--card-link-border-color: var(--surface-border-color);
|
|
11
|
+
--card-link-hover-background: var(--nox-surface-strong);
|
|
12
|
+
--card-link-active-background: var(--nox-border-muted);
|
|
13
|
+
|
|
14
|
+
container-type: inline-size;
|
|
15
|
+
display: block;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
overflow: clip;
|
|
18
|
+
border: var(--surface-border-width) solid var(--card-link-border-color);
|
|
19
|
+
border-radius: var(--surface-radius);
|
|
20
|
+
background: var(--surface-background);
|
|
21
|
+
color: var(--nox-text);
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.card-link[data-full='true'] {
|
|
26
|
+
flex: 1 1 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.card-link__layout {
|
|
31
|
+
--card-link-size: var(--nox-navigation-block-size);
|
|
32
|
+
--card-link-media-size: 2.35rem;
|
|
33
|
+
--card-link-artwork-max-size: calc(
|
|
34
|
+
var(--card-link-size) - (var(--nox-space-1) * 2)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
display: grid;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
min-height: var(--card-link-size);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.card-link[data-media-position='start'] .card-link__layout {
|
|
43
|
+
grid-template-columns: var(--card-link-size) minmax(0, 1fr);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.card-link[data-media-position='end'] .card-link__layout {
|
|
47
|
+
grid-template-columns: minmax(0, 1fr) var(--card-link-size);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.card-link__media {
|
|
51
|
+
display: grid;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
min-height: var(--card-link-size);
|
|
54
|
+
place-items: center;
|
|
55
|
+
background: color-mix(in srgb, var(--nox-tone-color) 15%, var(--nox-surface));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.card-link[data-media-position='start'] .card-link__media {
|
|
59
|
+
border-inline-end: var(--nox-border-width) solid var(--card-link-border-color);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.card-link[data-media-position='end'] .card-link__media {
|
|
63
|
+
border-inline-start: var(--nox-border-width) solid
|
|
64
|
+
var(--card-link-border-color);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.card-link__media [data-widget='media'] {
|
|
68
|
+
inline-size: var(--card-link-size);
|
|
69
|
+
block-size: var(--card-link-size);
|
|
70
|
+
--media-object-inline-size: auto;
|
|
71
|
+
--media-object-block-size: auto;
|
|
72
|
+
--media-object-max-inline-size: var(--card-link-artwork-max-size);
|
|
73
|
+
--media-object-max-block-size: var(--card-link-artwork-max-size);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.card-link__icon {
|
|
77
|
+
display: block;
|
|
78
|
+
inline-size: var(--card-link-media-size);
|
|
79
|
+
block-size: var(--card-link-media-size);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.card-link__icon[data-tone] {
|
|
83
|
+
color: var(--nox-tone-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.card-link__content {
|
|
87
|
+
--card-link-content-media-size: calc(
|
|
88
|
+
var(--card-link-size) - (var(--nox-space-2) * 2)
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
display: grid;
|
|
92
|
+
min-width: 0;
|
|
93
|
+
min-block-size: var(--card-link-size);
|
|
94
|
+
grid-template-rows: minmax(0, 1fr);
|
|
95
|
+
align-items: center;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
padding: var(--nox-space-2) var(--nox-space-4);
|
|
98
|
+
overflow-wrap: anywhere;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.card-link[data-has-content-media='true'][data-media-position='start']
|
|
102
|
+
.card-link__content {
|
|
103
|
+
grid-template-columns:
|
|
104
|
+
var(--card-link-content-media-size)
|
|
105
|
+
minmax(0, 1fr);
|
|
106
|
+
column-gap: var(--nox-space-3);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.card-link[data-has-content-media='true'][data-media-position='end']
|
|
110
|
+
.card-link__content {
|
|
111
|
+
grid-template-columns:
|
|
112
|
+
minmax(0, 1fr)
|
|
113
|
+
var(--card-link-content-media-size);
|
|
114
|
+
column-gap: var(--nox-space-3);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.card-link__content-media {
|
|
118
|
+
display: grid;
|
|
119
|
+
grid-row: 1;
|
|
120
|
+
inline-size: var(--card-link-content-media-size);
|
|
121
|
+
block-size: var(--card-link-size);
|
|
122
|
+
margin-block: calc(0px - var(--nox-space-2));
|
|
123
|
+
align-self: center;
|
|
124
|
+
place-items: center;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.card-link[data-media-position='start'] .card-link__content-media {
|
|
128
|
+
grid-column: 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.card-link[data-media-position='end'] .card-link__content-media {
|
|
132
|
+
grid-column: 2;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.card-link__content-media [data-widget='media'] {
|
|
136
|
+
display: flex;
|
|
137
|
+
inline-size: 100%;
|
|
138
|
+
block-size: 100%;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
--media-object-inline-size: auto;
|
|
142
|
+
--media-object-block-size: auto;
|
|
143
|
+
--media-object-max-inline-size: 100%;
|
|
144
|
+
--media-object-max-block-size: 100%;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.card-link[data-media-size='compact'] {
|
|
148
|
+
--card-link-resolved-media-size: var(--nox-compact-media-responsive-size);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.card-link[data-media-size='small'] {
|
|
152
|
+
--card-link-resolved-media-size: calc(
|
|
153
|
+
var(--nox-compact-media-responsive-size) - var(--nox-space-3)
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.card-link:is(
|
|
158
|
+
[data-media-size='compact'],
|
|
159
|
+
[data-media-size='small']
|
|
160
|
+
)
|
|
161
|
+
.card-link__layout {
|
|
162
|
+
--card-link-artwork-max-size: var(--card-link-resolved-media-size);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.card-link:is(
|
|
166
|
+
[data-media-size='compact'],
|
|
167
|
+
[data-media-size='small']
|
|
168
|
+
)
|
|
169
|
+
.card-link__content {
|
|
170
|
+
--card-link-content-media-size: var(--card-link-resolved-media-size);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.card-link:is(
|
|
174
|
+
[data-media-size='compact'],
|
|
175
|
+
[data-media-size='small']
|
|
176
|
+
)
|
|
177
|
+
:is(.card-link__media, .card-link__content-media)
|
|
178
|
+
[data-widget='media'] {
|
|
179
|
+
--media-object-inline-size: 100%;
|
|
180
|
+
--media-object-block-size: 100%;
|
|
181
|
+
--media-object-max-inline-size: var(--card-link-resolved-media-size);
|
|
182
|
+
--media-object-max-block-size: var(--card-link-resolved-media-size);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.card-link[data-has-content-media='true'][data-media-position='start']
|
|
186
|
+
.card-link__content-copy {
|
|
187
|
+
grid-column: 2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.card-link[data-has-content-media='true'][data-media-position='end']
|
|
191
|
+
.card-link__content-copy {
|
|
192
|
+
grid-column: 1;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.card-link__content-copy {
|
|
196
|
+
display: grid;
|
|
197
|
+
grid-row: 1;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
align-self: center;
|
|
200
|
+
align-content: center;
|
|
201
|
+
justify-self: stretch;
|
|
202
|
+
gap: var(--nox-space-1);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.card-link__compact-text {
|
|
206
|
+
display: none;
|
|
207
|
+
min-width: 0;
|
|
208
|
+
color: var(--nox-tone-text);
|
|
209
|
+
font-size: var(--nox-font-size-md);
|
|
210
|
+
font-weight: var(--nox-font-weight-strong);
|
|
211
|
+
line-height: 1;
|
|
212
|
+
overflow-wrap: anywhere;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.card-link[data-direction='next'] .card-link__content-copy {
|
|
216
|
+
justify-items: end;
|
|
217
|
+
text-align: end;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.card-link__label {
|
|
221
|
+
min-width: 0;
|
|
222
|
+
color: var(--nox-text-muted);
|
|
223
|
+
font-size: var(--nox-font-size-xs);
|
|
224
|
+
font-weight: var(--nox-font-weight-strong);
|
|
225
|
+
letter-spacing: var(--nox-letter-spacing-wider);
|
|
226
|
+
line-height: 1;
|
|
227
|
+
overflow-wrap: anywhere;
|
|
228
|
+
text-transform: uppercase;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.card-link__text {
|
|
232
|
+
--text-pair-primary-color: var(--nox-tone-text);
|
|
233
|
+
align-items: center;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.card-link[data-interactive='true']:active {
|
|
237
|
+
background: var(--card-link-active-background);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.card-link[data-interactive='true']:focus-visible {
|
|
241
|
+
outline: var(--nox-focus-ring-width) solid var(--nox-tone-focus-ring);
|
|
242
|
+
outline-offset: var(--nox-focus-ring-offset);
|
|
243
|
+
background: var(--card-link-hover-background);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.card-link[data-interactive='true']:focus-visible .card-link__label {
|
|
247
|
+
color: var(--nox-tone-text);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.card-link[data-interactive='true']:focus-visible .card-link__text {
|
|
251
|
+
--text-pair-secondary-color: var(--nox-tone-text);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media (hover: hover) and (pointer: fine) {
|
|
255
|
+
.card-link[data-interactive='true']:hover {
|
|
256
|
+
background: var(--card-link-hover-background);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.card-link[data-interactive='true']:hover .card-link__label {
|
|
260
|
+
color: var(--nox-tone-text);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.card-link[data-interactive='true']:hover .card-link__text {
|
|
264
|
+
--text-pair-secondary-color: var(--nox-tone-text);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
269
|
+
.card-link,
|
|
270
|
+
.card-link__label {
|
|
271
|
+
transition:
|
|
272
|
+
background-color var(--nox-motion-duration-sm)
|
|
273
|
+
var(--nox-motion-easing-standard),
|
|
274
|
+
color var(--nox-motion-duration-sm) var(--nox-motion-easing-standard),
|
|
275
|
+
transform var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.card-link[data-interactive='true']:active {
|
|
279
|
+
transform: translateY(1px);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.card-link[data-disabled='true'] {
|
|
284
|
+
opacity: 0.4;
|
|
285
|
+
filter: grayscale(0.65);
|
|
286
|
+
cursor: not-allowed;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@media (width < 48rem) {
|
|
290
|
+
.card-link[data-compact-content] .card-link__layout {
|
|
291
|
+
--card-link-size: var(--nox-navigation-compact-block-size);
|
|
292
|
+
--card-link-media-size: 2.125rem;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.card-link[data-compact-content] .card-link__content {
|
|
296
|
+
padding-inline: var(--nox-space-3);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.card-link[data-compact-content] :is(.card-link__label, .card-link__text) {
|
|
300
|
+
display: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.card-link[data-compact-content='text'] .card-link__compact-text {
|
|
304
|
+
display: block;
|
|
305
|
+
align-self: center;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.card-link[data-compact-content='text'] .card-link__content-media {
|
|
309
|
+
display: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.card-link[data-compact-content] .card-link__content {
|
|
313
|
+
grid-template-columns: minmax(0, 1fr);
|
|
314
|
+
place-items: center;
|
|
315
|
+
text-align: center;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.card-link[data-compact-content][data-has-content-media='true']
|
|
319
|
+
.card-link__content {
|
|
320
|
+
grid-template-columns: minmax(0, 1fr);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.card-link[data-compact-content='text'] .card-link__content-copy {
|
|
324
|
+
justify-self: center;
|
|
325
|
+
justify-items: center;
|
|
326
|
+
text-align: center;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.card-link[data-compact-content='media'][data-has-content-media='true']
|
|
330
|
+
.card-link__content-media {
|
|
331
|
+
grid-area: 1 / 1;
|
|
332
|
+
place-self: center;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.card-link[data-compact-content='media'] .card-link__content-copy {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.card-link[data-compact-content][data-compact-visual='hide']
|
|
340
|
+
.card-link__layout {
|
|
341
|
+
grid-template-columns: minmax(0, 1fr);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.card-link[data-compact-content][data-compact-visual='hide']
|
|
345
|
+
.card-link__media {
|
|
346
|
+
display: none;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
@container (width < 12rem) {
|
|
351
|
+
.card-link[data-collapse='icon'][data-has-visual='true'] .card-link__layout {
|
|
352
|
+
grid-template-columns: minmax(0, 1fr);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.card-link[data-collapse='icon'][data-has-visual='true'] .card-link__media {
|
|
356
|
+
border-inline: 0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.card-link[data-collapse='icon'][data-has-visual='true'] .card-link__content {
|
|
360
|
+
display: none;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import Button from '../../actions/Button/Button.astro';
|
|
4
|
+
import CopyIcon from '../../icons/CopyIcon.astro';
|
|
5
|
+
import type { Tone } from '../../../theme/contracts';
|
|
6
|
+
import type {
|
|
7
|
+
CodeBlockCopy,
|
|
8
|
+
CodeBlockPresentation,
|
|
9
|
+
} from './contracts';
|
|
10
|
+
|
|
11
|
+
type Props = HTMLAttributes<'pre'> & {
|
|
12
|
+
copy?: CodeBlockCopy;
|
|
13
|
+
presentation?: CodeBlockPresentation;
|
|
14
|
+
text: string;
|
|
15
|
+
tone?: Tone;
|
|
16
|
+
wrap?: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
class: className,
|
|
21
|
+
copy,
|
|
22
|
+
'data-tone': dataTone,
|
|
23
|
+
presentation = 'default',
|
|
24
|
+
text,
|
|
25
|
+
tone,
|
|
26
|
+
wrap = false,
|
|
27
|
+
...attrs
|
|
28
|
+
}: Props = Astro.props;
|
|
29
|
+
const resolvedTone = tone ?? dataTone;
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
copy ? (
|
|
34
|
+
<nox-code-block
|
|
35
|
+
{...attrs}
|
|
36
|
+
class:list={['code-block-shell', className]}
|
|
37
|
+
data-widget="code-block"
|
|
38
|
+
data-tone={resolvedTone}
|
|
39
|
+
>
|
|
40
|
+
<pre
|
|
41
|
+
class="code-block"
|
|
42
|
+
data-code-block-content
|
|
43
|
+
data-code-block-presentation={presentation}
|
|
44
|
+
data-wrap={wrap ? true : undefined}
|
|
45
|
+
>{text}</pre>
|
|
46
|
+
<Button
|
|
47
|
+
class="code-block__copy"
|
|
48
|
+
type="button"
|
|
49
|
+
size="sm"
|
|
50
|
+
borderless
|
|
51
|
+
iconOnly
|
|
52
|
+
hoverTone="info"
|
|
53
|
+
aria-label={copy.copyLabel}
|
|
54
|
+
title={copy.copyLabel}
|
|
55
|
+
lang={copy.lang}
|
|
56
|
+
data-code-block-copy
|
|
57
|
+
data-copy-label={copy.copyLabel}
|
|
58
|
+
data-copied-label={copy.copiedLabel}
|
|
59
|
+
data-copy-unavailable-label={copy.unavailableLabel}
|
|
60
|
+
>
|
|
61
|
+
<CopyIcon />
|
|
62
|
+
</Button>
|
|
63
|
+
<span
|
|
64
|
+
class="code-block__status"
|
|
65
|
+
aria-live="polite"
|
|
66
|
+
lang={copy.lang}
|
|
67
|
+
data-code-block-status
|
|
68
|
+
/>
|
|
69
|
+
</nox-code-block>
|
|
70
|
+
) : (
|
|
71
|
+
<pre
|
|
72
|
+
{...attrs}
|
|
73
|
+
class:list={['code-block', className]}
|
|
74
|
+
data-widget="code-block"
|
|
75
|
+
data-code-block-presentation={presentation}
|
|
76
|
+
data-tone={resolvedTone}
|
|
77
|
+
data-wrap={wrap ? true : undefined}
|
|
78
|
+
>{text}</pre>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
<script>
|
|
83
|
+
import { initCodeBlock } from './codeBlockController';
|
|
84
|
+
|
|
85
|
+
class NoxCodeBlockElement extends HTMLElement {
|
|
86
|
+
cleanup?: () => void;
|
|
87
|
+
|
|
88
|
+
connectedCallback() {
|
|
89
|
+
this.cleanup?.();
|
|
90
|
+
this.cleanup = initCodeBlock(this);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
disconnectedCallback() {
|
|
94
|
+
this.cleanup?.();
|
|
95
|
+
this.cleanup = undefined;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (!customElements.get('nox-code-block')) {
|
|
100
|
+
customElements.define('nox-code-block', NoxCodeBlockElement);
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.code-block {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
padding: var(--nox-space-4);
|
|
4
|
+
overflow: auto;
|
|
5
|
+
border: var(--nox-border-width) solid var(--nox-border);
|
|
6
|
+
border-radius: var(--nox-radius-md);
|
|
7
|
+
background: var(--nox-surface-muted);
|
|
8
|
+
color: var(--nox-text);
|
|
9
|
+
font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
|
|
10
|
+
font-size: var(--nox-font-size-xs);
|
|
11
|
+
font-weight: var(--nox-font-weight-regular);
|
|
12
|
+
line-height: 1.65;
|
|
13
|
+
margin: 0;
|
|
14
|
+
white-space: pre;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.code-block-shell {
|
|
18
|
+
--code-block-light-line-height: 1.125rem;
|
|
19
|
+
--code-block-copy-size: calc(
|
|
20
|
+
var(--code-block-light-line-height) + var(--nox-space-3) +
|
|
21
|
+
var(--nox-space-3) + var(--nox-border-width) +
|
|
22
|
+
var(--nox-border-width)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
position: relative;
|
|
26
|
+
display: block;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.code-block-shell .code-block {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
inline-size: 100%;
|
|
33
|
+
padding-inline-end: calc(
|
|
34
|
+
var(--code-block-copy-size) + var(--nox-space-3)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.code-block[data-code-block-presentation='light'] {
|
|
39
|
+
padding-block: var(--nox-space-3);
|
|
40
|
+
border-color: var(--nox-border);
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
background: var(--nox-surface-muted);
|
|
43
|
+
color: var(--nox-text);
|
|
44
|
+
line-height: var(--code-block-light-line-height);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.code-block__copy {
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset-block-start: 0;
|
|
50
|
+
inset-inline-end: 0;
|
|
51
|
+
inline-size: var(--code-block-copy-size);
|
|
52
|
+
block-size: var(--code-block-copy-size);
|
|
53
|
+
min-height: 0;
|
|
54
|
+
background: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.code-block__copy:active:not([disabled], [aria-disabled='true']) {
|
|
58
|
+
background: transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
.code-block__copy[data-button-hover-tone]:hover:not(
|
|
63
|
+
[disabled],
|
|
64
|
+
[aria-disabled='true']
|
|
65
|
+
) {
|
|
66
|
+
background: transparent;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.code-block__status {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inline-size: 1px;
|
|
73
|
+
block-size: 1px;
|
|
74
|
+
padding: 0;
|
|
75
|
+
border: 0;
|
|
76
|
+
margin: -1px;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
clip: rect(0 0 0 0);
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.code-block[data-wrap] {
|
|
83
|
+
overflow-wrap: anywhere;
|
|
84
|
+
white-space: pre-wrap;
|
|
85
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { copyText } from '../../../client/clipboard';
|
|
2
|
+
|
|
3
|
+
const initializedAttribute = 'data-code-block-initialized';
|
|
4
|
+
const feedbackDurationMs = 1600;
|
|
5
|
+
const noop = (): void => undefined;
|
|
6
|
+
|
|
7
|
+
export function initCodeBlock(root: HTMLElement): () => void {
|
|
8
|
+
if (root.getAttribute(initializedAttribute) === 'true') return noop;
|
|
9
|
+
|
|
10
|
+
const content = root.querySelector<HTMLElement>('[data-code-block-content]');
|
|
11
|
+
const copyButton = root.querySelector<HTMLButtonElement>(
|
|
12
|
+
'[data-code-block-copy]',
|
|
13
|
+
);
|
|
14
|
+
const status = root.querySelector<HTMLElement>('[data-code-block-status]');
|
|
15
|
+
if (!content || !copyButton || !status) return noop;
|
|
16
|
+
|
|
17
|
+
root.setAttribute(initializedAttribute, 'true');
|
|
18
|
+
const copyLabel = copyButton.dataset.copyLabel ?? '';
|
|
19
|
+
const copiedLabel = copyButton.dataset.copiedLabel ?? copyLabel;
|
|
20
|
+
const unavailableLabel =
|
|
21
|
+
copyButton.dataset.copyUnavailableLabel ?? copyLabel;
|
|
22
|
+
let feedbackTimeout: number | undefined;
|
|
23
|
+
|
|
24
|
+
const setButtonLabel = (label: string): void => {
|
|
25
|
+
copyButton.setAttribute('aria-label', label);
|
|
26
|
+
copyButton.title = label;
|
|
27
|
+
status.textContent = label;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const restoreLabelLater = (): void => {
|
|
31
|
+
if (feedbackTimeout !== undefined) {
|
|
32
|
+
window.clearTimeout(feedbackTimeout);
|
|
33
|
+
}
|
|
34
|
+
feedbackTimeout = window.setTimeout(() => {
|
|
35
|
+
setButtonLabel(copyLabel);
|
|
36
|
+
status.textContent = '';
|
|
37
|
+
feedbackTimeout = undefined;
|
|
38
|
+
}, feedbackDurationMs);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const handleCopy = async (): Promise<void> => {
|
|
42
|
+
try {
|
|
43
|
+
await copyText(content.textContent ?? '');
|
|
44
|
+
setButtonLabel(copiedLabel);
|
|
45
|
+
} catch {
|
|
46
|
+
setButtonLabel(unavailableLabel);
|
|
47
|
+
}
|
|
48
|
+
restoreLabelLater();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
copyButton.addEventListener('click', handleCopy);
|
|
52
|
+
|
|
53
|
+
return () => {
|
|
54
|
+
copyButton.removeEventListener('click', handleCopy);
|
|
55
|
+
if (feedbackTimeout !== undefined) {
|
|
56
|
+
window.clearTimeout(feedbackTimeout);
|
|
57
|
+
}
|
|
58
|
+
root.removeAttribute(initializedAttribute);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { Tone } from '../../../theme/contracts';
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'p'> & {
|
|
6
|
+
'data-tone'?: Tone;
|
|
7
|
+
term: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
class: className,
|
|
13
|
+
'data-tone': dataTone,
|
|
14
|
+
term,
|
|
15
|
+
text,
|
|
16
|
+
...attrs
|
|
17
|
+
}: Props = Astro.props;
|
|
18
|
+
const hasText = text !== undefined && text.length > 0;
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<p
|
|
22
|
+
{...attrs}
|
|
23
|
+
class:list={['inline-definition', className]}
|
|
24
|
+
data-widget="inline-definition"
|
|
25
|
+
data-tone={dataTone}
|
|
26
|
+
>
|
|
27
|
+
<strong class="inline-definition__term">{term}</strong>
|
|
28
|
+
{hasText ? <span class="inline-definition__separator">:</span> : null}
|
|
29
|
+
{hasText ? <span class="inline-definition__text"> {text}</span> : null}
|
|
30
|
+
{!hasText ? <slot /> : null}
|
|
31
|
+
</p>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type {
|
|
4
|
+
CodeBlockCopy,
|
|
5
|
+
} from '../CodeBlock/contracts';
|
|
6
|
+
import MarkdownNode from './MarkdownNode.astro';
|
|
7
|
+
import type { MarkdownDocument } from './contracts';
|
|
8
|
+
|
|
9
|
+
type Props = HTMLAttributes<'div'> & {
|
|
10
|
+
codeBlockCopy?: CodeBlockCopy;
|
|
11
|
+
document: MarkdownDocument;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: className,
|
|
16
|
+
codeBlockCopy,
|
|
17
|
+
document,
|
|
18
|
+
...attrs
|
|
19
|
+
}: Props = Astro.props;
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<div
|
|
23
|
+
{...attrs}
|
|
24
|
+
class:list={['markdown-content', className]}
|
|
25
|
+
data-widget="markdown-content"
|
|
26
|
+
>
|
|
27
|
+
{
|
|
28
|
+
document.blocks.map((block) => (
|
|
29
|
+
<MarkdownNode node={block} codeBlockCopy={codeBlockCopy} />
|
|
30
|
+
))
|
|
31
|
+
}
|
|
32
|
+
</div>
|