@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,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
import ArrowUpDownIcon from '../../icons/ArrowUpDownIcon.astro';
|
|
3
|
+
import ArrowDownIcon from '../../icons/ArrowDownIcon.astro';
|
|
4
|
+
import ArrowRightIcon from '../../icons/ArrowRightIcon.astro';
|
|
5
|
+
import ArrowUpIcon from '../../icons/ArrowUpIcon.astro';
|
|
6
|
+
import BulletIcon from '../../icons/BulletIcon.astro';
|
|
7
|
+
import EqualIcon from '../../icons/EqualIcon.astro';
|
|
8
|
+
import FieldIcon from '../../icons/FieldIcon.astro';
|
|
9
|
+
import GrassIcon from '../../icons/GrassIcon.astro';
|
|
10
|
+
import MountainIcon from '../../icons/MountainIcon.astro';
|
|
11
|
+
import WaterIcon from '../../icons/WaterIcon.astro';
|
|
12
|
+
import type { MarkdownSymbol } from './contracts';
|
|
13
|
+
|
|
14
|
+
type Props = {
|
|
15
|
+
node: MarkdownSymbol;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const { node }: Props = Astro.props;
|
|
19
|
+
const Icon = {
|
|
20
|
+
adjustment: ArrowUpDownIcon,
|
|
21
|
+
'arrow-right': ArrowRightIcon,
|
|
22
|
+
bullet: BulletIcon,
|
|
23
|
+
decrease: ArrowDownIcon,
|
|
24
|
+
increase: ArrowUpIcon,
|
|
25
|
+
neutral: EqualIcon,
|
|
26
|
+
'terrain-field': FieldIcon,
|
|
27
|
+
'terrain-grass': GrassIcon,
|
|
28
|
+
'terrain-mountain': MountainIcon,
|
|
29
|
+
'terrain-water': WaterIcon,
|
|
30
|
+
}[node.name];
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<span
|
|
34
|
+
class="markdown-content__symbol"
|
|
35
|
+
data-markdown-symbol={node.name}
|
|
36
|
+
data-tone={node.tone}
|
|
37
|
+
lang={node.lang}
|
|
38
|
+
>
|
|
39
|
+
<Icon class="markdown-content__symbol-icon" />
|
|
40
|
+
{node.label ? (
|
|
41
|
+
<span class="markdown-content__symbol-label">{node.label}</span>
|
|
42
|
+
) : node.accessibleLabel ? (
|
|
43
|
+
<span class="markdown-content__visually-hidden">
|
|
44
|
+
{node.accessibleLabel}
|
|
45
|
+
</span>
|
|
46
|
+
) : null}
|
|
47
|
+
</span>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { DisplayMedia } from '../../../display/contracts';
|
|
2
|
+
import type { Tone } from '../../../theme/contracts';
|
|
3
|
+
|
|
4
|
+
export type MarkdownText = {
|
|
5
|
+
type: 'text';
|
|
6
|
+
lang?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type MarkdownSymbolName =
|
|
11
|
+
| 'adjustment'
|
|
12
|
+
| 'arrow-right'
|
|
13
|
+
| 'bullet'
|
|
14
|
+
| 'decrease'
|
|
15
|
+
| 'increase'
|
|
16
|
+
| 'neutral'
|
|
17
|
+
| 'terrain-field'
|
|
18
|
+
| 'terrain-grass'
|
|
19
|
+
| 'terrain-mountain'
|
|
20
|
+
| 'terrain-water';
|
|
21
|
+
|
|
22
|
+
export type MarkdownSymbol = {
|
|
23
|
+
type: 'symbol';
|
|
24
|
+
accessibleLabel?: string;
|
|
25
|
+
lang?: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
name: MarkdownSymbolName;
|
|
28
|
+
tone?: Tone;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type MarkdownStrong = {
|
|
32
|
+
type: 'strong';
|
|
33
|
+
children: readonly MarkdownInline[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type MarkdownEmphasis = {
|
|
37
|
+
type: 'emphasis';
|
|
38
|
+
children: readonly MarkdownInline[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type MarkdownInlineCode = {
|
|
42
|
+
type: 'code';
|
|
43
|
+
value: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type MarkdownLink = {
|
|
47
|
+
type: 'link';
|
|
48
|
+
children: readonly MarkdownInline[];
|
|
49
|
+
external: boolean;
|
|
50
|
+
href: string;
|
|
51
|
+
lang?: string;
|
|
52
|
+
treatment?: 'reference';
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type MarkdownBreak = {
|
|
56
|
+
type: 'break';
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type MarkdownInline =
|
|
60
|
+
| MarkdownText
|
|
61
|
+
| MarkdownStrong
|
|
62
|
+
| MarkdownEmphasis
|
|
63
|
+
| MarkdownInlineCode
|
|
64
|
+
| MarkdownLink
|
|
65
|
+
| MarkdownBreak
|
|
66
|
+
| MarkdownSymbol;
|
|
67
|
+
|
|
68
|
+
export type MarkdownParagraph = {
|
|
69
|
+
type: 'paragraph';
|
|
70
|
+
children: readonly MarkdownInline[];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type MarkdownCodeBlock = {
|
|
74
|
+
type: 'code';
|
|
75
|
+
language?: string;
|
|
76
|
+
value: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type MarkdownQuote = {
|
|
80
|
+
type: 'quote';
|
|
81
|
+
children: readonly MarkdownBlock[];
|
|
82
|
+
tone?: Tone;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type MarkdownSeparator = {
|
|
86
|
+
type: 'separator';
|
|
87
|
+
emphasis?: 'default' | 'muted';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type MarkdownListMarker = {
|
|
91
|
+
lang?: string;
|
|
92
|
+
label?: string;
|
|
93
|
+
symbol: Extract<
|
|
94
|
+
MarkdownSymbolName,
|
|
95
|
+
| 'adjustment'
|
|
96
|
+
| 'arrow-right'
|
|
97
|
+
| 'bullet'
|
|
98
|
+
| 'decrease'
|
|
99
|
+
| 'increase'
|
|
100
|
+
| 'neutral'
|
|
101
|
+
>;
|
|
102
|
+
tone: Tone;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type MarkdownChangeDelta = {
|
|
106
|
+
accessibleLabel: string;
|
|
107
|
+
lang?: string;
|
|
108
|
+
sign: 'minus' | 'neutral' | 'plus';
|
|
109
|
+
tone: Tone;
|
|
110
|
+
value: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type MarkdownChangeBase = {
|
|
114
|
+
type: 'change';
|
|
115
|
+
label: readonly MarkdownInline[];
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type MarkdownChange =
|
|
119
|
+
| (MarkdownChangeBase & {
|
|
120
|
+
presentation: 'statement';
|
|
121
|
+
value: readonly MarkdownInline[];
|
|
122
|
+
})
|
|
123
|
+
| (MarkdownChangeBase & {
|
|
124
|
+
presentation: 'transition';
|
|
125
|
+
after: string;
|
|
126
|
+
before: string;
|
|
127
|
+
delta?: MarkdownChangeDelta;
|
|
128
|
+
suffix?: readonly MarkdownInline[];
|
|
129
|
+
transitionLabel: string;
|
|
130
|
+
valueLang?: string;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export type MarkdownResource = {
|
|
134
|
+
layout: 'compact' | 'detailed';
|
|
135
|
+
media: DisplayMedia;
|
|
136
|
+
mediaPlacement: 'inline' | 'lead';
|
|
137
|
+
mediaScale: 'compact' | 'featured';
|
|
138
|
+
title: readonly MarkdownInline[];
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export type MarkdownListItem = {
|
|
142
|
+
children: readonly MarkdownBlock[];
|
|
143
|
+
heading?: readonly MarkdownInline[];
|
|
144
|
+
marker?: MarkdownListMarker;
|
|
145
|
+
resource?: MarkdownResource;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export type MarkdownList = {
|
|
149
|
+
type: 'list';
|
|
150
|
+
items: readonly MarkdownListItem[];
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type MarkdownHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
154
|
+
|
|
155
|
+
export type MarkdownHeading = {
|
|
156
|
+
type: 'heading';
|
|
157
|
+
children: readonly MarkdownInline[];
|
|
158
|
+
id: string;
|
|
159
|
+
level: MarkdownHeadingLevel;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export type MarkdownBlock =
|
|
163
|
+
| MarkdownParagraph
|
|
164
|
+
| MarkdownCodeBlock
|
|
165
|
+
| MarkdownChange
|
|
166
|
+
| MarkdownHeading
|
|
167
|
+
| MarkdownQuote
|
|
168
|
+
| MarkdownSeparator
|
|
169
|
+
| MarkdownList;
|
|
170
|
+
|
|
171
|
+
export type MarkdownSection = {
|
|
172
|
+
type: 'section';
|
|
173
|
+
blocks: readonly MarkdownBlock[];
|
|
174
|
+
id: string;
|
|
175
|
+
level: MarkdownHeadingLevel;
|
|
176
|
+
title: string;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export type MarkdownDocument = {
|
|
180
|
+
blocks: readonly (MarkdownBlock | MarkdownSection)[];
|
|
181
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { DisplayBadge } from '../../../display/contracts';
|
|
4
|
+
import type { Tone } from '../../../theme/contracts';
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<'div'> & {
|
|
7
|
+
badges: readonly DisplayBadge[];
|
|
8
|
+
label?: string;
|
|
9
|
+
tone?: Tone;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
badges,
|
|
14
|
+
class: className,
|
|
15
|
+
'data-tone': dataTone,
|
|
16
|
+
label,
|
|
17
|
+
tone,
|
|
18
|
+
...attrs
|
|
19
|
+
}: Props = Astro.props;
|
|
20
|
+
const resolvedTone = tone ?? dataTone;
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
{...attrs}
|
|
25
|
+
class:list={['badge-list', className]}
|
|
26
|
+
aria-label={label}
|
|
27
|
+
data-widget="badge-list"
|
|
28
|
+
data-tone={resolvedTone}
|
|
29
|
+
>
|
|
30
|
+
{
|
|
31
|
+
badges.map((item) =>
|
|
32
|
+
item.href ? (
|
|
33
|
+
<a
|
|
34
|
+
class="badge-list__item"
|
|
35
|
+
href={item.href}
|
|
36
|
+
data-tone={item.tone}
|
|
37
|
+
title={item.description}
|
|
38
|
+
>
|
|
39
|
+
<span>{item.label}</span>
|
|
40
|
+
{item.value !== undefined ? <span>{item.value}</span> : null}
|
|
41
|
+
</a>
|
|
42
|
+
) : (
|
|
43
|
+
<span
|
|
44
|
+
class="badge-list__item"
|
|
45
|
+
data-tone={item.tone}
|
|
46
|
+
title={item.description}
|
|
47
|
+
>
|
|
48
|
+
<span>{item.label}</span>
|
|
49
|
+
{item.value !== undefined ? <span>{item.value}</span> : null}
|
|
50
|
+
</span>
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.badge-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: var(--nox-space-2);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.badge-list__item {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
min-height: 1.75rem;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: var(--nox-space-1) var(--nox-space-3);
|
|
13
|
+
gap: var(--nox-space-1);
|
|
14
|
+
border: var(--nox-border-width) solid var(--nox-tone-border);
|
|
15
|
+
border-radius: var(--nox-radius-pill);
|
|
16
|
+
background: var(--nox-tone-background);
|
|
17
|
+
color: var(--nox-tone-text);
|
|
18
|
+
font-size: var(--nox-font-size-xs);
|
|
19
|
+
font-weight: var(--nox-font-weight-strong);
|
|
20
|
+
line-height: 1;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (hover: hover) and (pointer: fine) {
|
|
26
|
+
.badge-list__item[href]:hover {
|
|
27
|
+
background: var(--nox-tone-hover-background);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { DisplayIconItem } from '../../../display/contracts';
|
|
4
|
+
import type { Tone } from '../../../theme/contracts';
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<'div'> & {
|
|
7
|
+
'data-tone'?: Tone;
|
|
8
|
+
items: readonly DisplayIconItem[];
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: 'small' | 'medium';
|
|
11
|
+
tone?: Tone;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: className,
|
|
16
|
+
'data-tone': dataTone,
|
|
17
|
+
items,
|
|
18
|
+
label,
|
|
19
|
+
size = 'small',
|
|
20
|
+
tone,
|
|
21
|
+
...attrs
|
|
22
|
+
}: Props = Astro.props;
|
|
23
|
+
const resolvedTone = tone ?? dataTone;
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
{...attrs}
|
|
28
|
+
class:list={['icon-list', className]}
|
|
29
|
+
aria-label={label}
|
|
30
|
+
data-widget="icon-list"
|
|
31
|
+
data-icon-list-size={size}
|
|
32
|
+
data-tone={resolvedTone}
|
|
33
|
+
>
|
|
34
|
+
{
|
|
35
|
+
items.map((item) => {
|
|
36
|
+
const Icon = item.icon;
|
|
37
|
+
const icon = (
|
|
38
|
+
<span class="icon-list__icon">
|
|
39
|
+
<Icon />
|
|
40
|
+
</span>
|
|
41
|
+
);
|
|
42
|
+
const value =
|
|
43
|
+
item.value !== undefined ? (
|
|
44
|
+
<span class="icon-list__value">{item.value}</span>
|
|
45
|
+
) : null;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<span
|
|
49
|
+
class="icon-list__item"
|
|
50
|
+
data-muted={item.muted ? 'true' : undefined}
|
|
51
|
+
data-tone={item.tone}
|
|
52
|
+
role="group"
|
|
53
|
+
aria-label={item.label}
|
|
54
|
+
title={item.label}
|
|
55
|
+
>
|
|
56
|
+
<span class="icon-list__visible" aria-hidden="true">
|
|
57
|
+
{item.iconPosition === 'end' ? value : icon}
|
|
58
|
+
{item.iconPosition === 'end' ? icon : value}
|
|
59
|
+
</span>
|
|
60
|
+
</span>
|
|
61
|
+
);
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
</div>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.icon-list {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: inherit;
|
|
6
|
+
gap: var(--nox-space-1);
|
|
7
|
+
color: var(--nox-text);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.icon-list__item,
|
|
11
|
+
.icon-list__visible {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: var(--nox-space-1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.icon-list__item {
|
|
20
|
+
color: var(--nox-tone-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.icon-list__item[data-muted='true'] {
|
|
24
|
+
opacity: 0.4;
|
|
25
|
+
filter: grayscale(0.65);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-list__icon {
|
|
29
|
+
display: grid;
|
|
30
|
+
flex: none;
|
|
31
|
+
inline-size: var(--icon-list-icon-size);
|
|
32
|
+
block-size: var(--icon-list-icon-size);
|
|
33
|
+
place-items: center;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-list__icon > svg {
|
|
37
|
+
display: block;
|
|
38
|
+
inline-size: 100%;
|
|
39
|
+
block-size: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-list__value {
|
|
43
|
+
color: var(--nox-text);
|
|
44
|
+
font-size: var(--nox-font-size-sm);
|
|
45
|
+
font-weight: var(--nox-font-weight-regular);
|
|
46
|
+
line-height: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.icon-list[data-icon-list-size='small'] {
|
|
50
|
+
--icon-list-icon-size: 1.25rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.icon-list[data-icon-list-size='medium'] {
|
|
54
|
+
--icon-list-icon-size: 1.75rem;
|
|
55
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { DisplayMetric } from '../../../display/contracts';
|
|
4
|
+
import type { Tone } from '../../../theme/contracts';
|
|
5
|
+
import Tooltip from '../../feedback/Tooltip/Tooltip.astro';
|
|
6
|
+
import MetricTileContent from './MetricTileContent.astro';
|
|
7
|
+
|
|
8
|
+
type Props = HTMLAttributes<'dl'> &
|
|
9
|
+
DisplayMetric & {
|
|
10
|
+
class?: string;
|
|
11
|
+
'data-tone'?: Tone;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: className,
|
|
16
|
+
'data-tone': dataTone,
|
|
17
|
+
description,
|
|
18
|
+
icon,
|
|
19
|
+
items,
|
|
20
|
+
itemsLabel,
|
|
21
|
+
label,
|
|
22
|
+
tone,
|
|
23
|
+
unit,
|
|
24
|
+
value,
|
|
25
|
+
...attrs
|
|
26
|
+
}: Props = Astro.props;
|
|
27
|
+
const resolvedTone = tone ?? dataTone;
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
description ? (
|
|
32
|
+
<Tooltip content={description} tone={resolvedTone}>
|
|
33
|
+
<dl
|
|
34
|
+
{...attrs}
|
|
35
|
+
class:list={['metric-tile', className]}
|
|
36
|
+
data-widget="metric-tile"
|
|
37
|
+
data-tooltip-trigger
|
|
38
|
+
data-tone={resolvedTone}
|
|
39
|
+
>
|
|
40
|
+
<MetricTileContent
|
|
41
|
+
hint
|
|
42
|
+
icon={icon}
|
|
43
|
+
items={items}
|
|
44
|
+
itemsLabel={itemsLabel}
|
|
45
|
+
label={label}
|
|
46
|
+
unit={unit}
|
|
47
|
+
value={value}
|
|
48
|
+
/>
|
|
49
|
+
</dl>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
) : (
|
|
52
|
+
<dl
|
|
53
|
+
{...attrs}
|
|
54
|
+
class:list={['metric-tile', className]}
|
|
55
|
+
data-widget="metric-tile"
|
|
56
|
+
data-tone={resolvedTone}
|
|
57
|
+
>
|
|
58
|
+
<MetricTileContent
|
|
59
|
+
icon={icon}
|
|
60
|
+
items={items}
|
|
61
|
+
itemsLabel={itemsLabel}
|
|
62
|
+
label={label}
|
|
63
|
+
unit={unit}
|
|
64
|
+
value={value}
|
|
65
|
+
/>
|
|
66
|
+
</dl>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.metric-tile {
|
|
2
|
+
--metric-tile-icon-size: 1.75rem;
|
|
3
|
+
--metric-tile-unit-size: var(--nox-font-size-sm);
|
|
4
|
+
--metric-tile-value-size: clamp(var(--nox-font-size-xl), 8cqi, 1.75rem);
|
|
5
|
+
|
|
6
|
+
container-type: inline-size;
|
|
7
|
+
display: grid;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
min-height: 5.25rem;
|
|
10
|
+
align-content: center;
|
|
11
|
+
justify-items: center;
|
|
12
|
+
padding: var(--nox-space-4);
|
|
13
|
+
gap: var(--nox-space-2);
|
|
14
|
+
border: var(--nox-border-width) solid var(--nox-data-surface-border);
|
|
15
|
+
border-radius: var(--nox-radius-md);
|
|
16
|
+
background: var(--nox-data-surface-background);
|
|
17
|
+
margin: 0;
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.metric-tile__label {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
gap: var(--nox-space-1);
|
|
26
|
+
color: var(--nox-tone-text);
|
|
27
|
+
font-size: var(--nox-font-size-xs);
|
|
28
|
+
font-weight: var(--nox-font-weight-strong);
|
|
29
|
+
letter-spacing: var(--nox-letter-spacing-wider);
|
|
30
|
+
line-height: 1.15;
|
|
31
|
+
overflow-wrap: anywhere;
|
|
32
|
+
text-transform: uppercase;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.metric-tile__hint {
|
|
36
|
+
display: grid;
|
|
37
|
+
inline-size: 1rem;
|
|
38
|
+
block-size: 1rem;
|
|
39
|
+
flex: 0 0 auto;
|
|
40
|
+
place-items: center;
|
|
41
|
+
color: var(--nox-tone-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.metric-tile__hint svg {
|
|
45
|
+
display: block;
|
|
46
|
+
inline-size: 100%;
|
|
47
|
+
block-size: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.metric-tile__value {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
gap: var(--nox-space-1);
|
|
56
|
+
min-width: 0;
|
|
57
|
+
color: var(--nox-text);
|
|
58
|
+
line-height: 1.05;
|
|
59
|
+
margin: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.metric-tile__value strong {
|
|
63
|
+
font-size: var(--metric-tile-value-size);
|
|
64
|
+
font-weight: var(--nox-font-weight-strong);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.metric-tile__icon {
|
|
68
|
+
display: grid;
|
|
69
|
+
inline-size: var(--metric-tile-icon-size);
|
|
70
|
+
block-size: var(--metric-tile-icon-size);
|
|
71
|
+
flex: none;
|
|
72
|
+
align-self: center;
|
|
73
|
+
place-items: center;
|
|
74
|
+
color: var(--nox-tone-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.metric-tile__icon > svg {
|
|
78
|
+
display: block;
|
|
79
|
+
inline-size: 100%;
|
|
80
|
+
block-size: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.metric-tile__icon[data-position='start'] {
|
|
84
|
+
order: -1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.metric-tile__unit {
|
|
88
|
+
color: var(--nox-text-muted);
|
|
89
|
+
font-size: var(--metric-tile-unit-size);
|
|
90
|
+
font-weight: var(--nox-font-weight-medium);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (width < 34rem) {
|
|
94
|
+
.metric-tile {
|
|
95
|
+
--metric-tile-icon-size: 1.5rem;
|
|
96
|
+
--metric-tile-unit-size: var(--nox-font-size-xs);
|
|
97
|
+
--metric-tile-value-size: var(--nox-font-size-lg);
|
|
98
|
+
|
|
99
|
+
min-height: 4.75rem;
|
|
100
|
+
padding: var(--nox-space-3);
|
|
101
|
+
gap: var(--nox-space-1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type {
|
|
3
|
+
DisplayIconItem,
|
|
4
|
+
DisplayMetricIcon,
|
|
5
|
+
DisplayTextValue,
|
|
6
|
+
} from '../../../display/contracts';
|
|
7
|
+
import InfoIcon from '../../icons/InfoIcon.astro';
|
|
8
|
+
import IconList from '../IconList/IconList.astro';
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
hint?: boolean;
|
|
12
|
+
icon?: DisplayMetricIcon;
|
|
13
|
+
items?: readonly DisplayIconItem[];
|
|
14
|
+
itemsLabel?: string;
|
|
15
|
+
label: string;
|
|
16
|
+
unit?: string;
|
|
17
|
+
value?: DisplayTextValue;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
hint = false,
|
|
22
|
+
icon,
|
|
23
|
+
items,
|
|
24
|
+
itemsLabel,
|
|
25
|
+
label,
|
|
26
|
+
unit,
|
|
27
|
+
value,
|
|
28
|
+
}: Props = Astro.props;
|
|
29
|
+
const ValueIcon = icon?.component;
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
<dt class="metric-tile__label">
|
|
33
|
+
<span>{label}</span>
|
|
34
|
+
{
|
|
35
|
+
hint ? (
|
|
36
|
+
<span class="metric-tile__hint" aria-hidden="true">
|
|
37
|
+
<InfoIcon />
|
|
38
|
+
</span>
|
|
39
|
+
) : null
|
|
40
|
+
}
|
|
41
|
+
</dt>
|
|
42
|
+
<dd class="metric-tile__value">
|
|
43
|
+
{
|
|
44
|
+
items ? (
|
|
45
|
+
<IconList items={items} label={itemsLabel} size="medium" />
|
|
46
|
+
) : (
|
|
47
|
+
<>
|
|
48
|
+
<strong data-metric-value>{value}</strong>
|
|
49
|
+
{icon && ValueIcon ? (
|
|
50
|
+
<span
|
|
51
|
+
class="metric-tile__icon"
|
|
52
|
+
data-position={icon.position ?? 'end'}
|
|
53
|
+
data-tone={icon.tone}
|
|
54
|
+
role="img"
|
|
55
|
+
aria-label={icon.label}
|
|
56
|
+
>
|
|
57
|
+
<ValueIcon />
|
|
58
|
+
</span>
|
|
59
|
+
) : null}
|
|
60
|
+
</>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
{
|
|
64
|
+
unit ? (
|
|
65
|
+
<span class="metric-tile__unit" data-metric-unit>
|
|
66
|
+
{unit}
|
|
67
|
+
</span>
|
|
68
|
+
) : null
|
|
69
|
+
}
|
|
70
|
+
</dd>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DisplayTextValue } from '../../../display/contracts';
|
|
2
|
+
|
|
3
|
+
export function setMetricTileValue(
|
|
4
|
+
root: HTMLElement,
|
|
5
|
+
value: DisplayTextValue,
|
|
6
|
+
): void {
|
|
7
|
+
const valueNode = root.querySelector<HTMLElement>('[data-metric-value]');
|
|
8
|
+
if (valueNode) valueNode.textContent = String(value);
|
|
9
|
+
}
|