@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,272 @@
|
|
|
1
|
+
type SortDirection = 'ascending' | 'descending';
|
|
2
|
+
type SortType = 'number' | 'text';
|
|
3
|
+
type SortValue = string | number | null;
|
|
4
|
+
type SortValues = Readonly<Record<string, SortValue>>;
|
|
5
|
+
|
|
6
|
+
type SortColumn = {
|
|
7
|
+
id: string;
|
|
8
|
+
type: SortType;
|
|
9
|
+
tieBreaker?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type SortState = SortColumn & {
|
|
13
|
+
direction: SortDirection;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const initializedAttribute = 'data-table-sort-initialized';
|
|
17
|
+
const noop = (): void => undefined;
|
|
18
|
+
const sortValuesCache = new WeakMap<HTMLElement, SortValues>();
|
|
19
|
+
|
|
20
|
+
export function initTableSort(root: HTMLElement): () => void {
|
|
21
|
+
if (root.getAttribute(initializedAttribute) === 'true') return noop;
|
|
22
|
+
|
|
23
|
+
const rowsRoot = root.querySelector<HTMLElement>('[data-table-rows]');
|
|
24
|
+
const buttons = Array.from(
|
|
25
|
+
root.querySelectorAll<HTMLButtonElement>('[data-table-sort-column]'),
|
|
26
|
+
);
|
|
27
|
+
if (!rowsRoot || buttons.length === 0) return noop;
|
|
28
|
+
|
|
29
|
+
root.setAttribute(initializedAttribute, 'true');
|
|
30
|
+
const collator = new Intl.Collator(
|
|
31
|
+
document.documentElement.lang || undefined,
|
|
32
|
+
{ numeric: true, sensitivity: 'base' },
|
|
33
|
+
);
|
|
34
|
+
const originalOrder = new WeakMap<HTMLElement, number>();
|
|
35
|
+
let state: SortState | null = null;
|
|
36
|
+
let nextOriginalOrder = 0;
|
|
37
|
+
let orderDirty = false;
|
|
38
|
+
let scheduledFrame: number | null = null;
|
|
39
|
+
|
|
40
|
+
const registerRows = (rows: readonly HTMLElement[]): void => {
|
|
41
|
+
for (const row of rows) {
|
|
42
|
+
if (!originalOrder.has(row)) {
|
|
43
|
+
originalOrder.set(row, nextOriginalOrder);
|
|
44
|
+
nextOriginalOrder += 1;
|
|
45
|
+
}
|
|
46
|
+
getSortValues(row);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getRows = (): HTMLElement[] =>
|
|
51
|
+
Array.from(
|
|
52
|
+
rowsRoot.querySelectorAll<HTMLElement>(':scope > [data-table-row]'),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const applySort = (): void => {
|
|
56
|
+
const rows = getRows();
|
|
57
|
+
registerRows(rows);
|
|
58
|
+
const activeState = state;
|
|
59
|
+
const sortedRows = [...rows].sort((left, right) => {
|
|
60
|
+
const leftValues = getSortValues(left);
|
|
61
|
+
const rightValues = getSortValues(right);
|
|
62
|
+
|
|
63
|
+
if (activeState) {
|
|
64
|
+
const comparison = compareValues(
|
|
65
|
+
leftValues[activeState.id],
|
|
66
|
+
rightValues[activeState.id],
|
|
67
|
+
activeState.type,
|
|
68
|
+
activeState.direction,
|
|
69
|
+
collator,
|
|
70
|
+
);
|
|
71
|
+
if (comparison !== 0) return comparison;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (activeState?.tieBreaker) {
|
|
75
|
+
const id = activeState.tieBreaker;
|
|
76
|
+
const tieComparison = compareValues(
|
|
77
|
+
leftValues[id],
|
|
78
|
+
rightValues[id],
|
|
79
|
+
inferSortType(leftValues[id], rightValues[id]),
|
|
80
|
+
'ascending',
|
|
81
|
+
collator,
|
|
82
|
+
);
|
|
83
|
+
if (tieComparison !== 0) return tieComparison;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (originalOrder.get(left) ?? 0) - (originalOrder.get(right) ?? 0);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
orderDirty = activeState !== null;
|
|
90
|
+
if (rows.every((row, index) => row === sortedRows[index])) return;
|
|
91
|
+
|
|
92
|
+
const fragment = document.createDocumentFragment();
|
|
93
|
+
for (const row of sortedRows) fragment.append(row);
|
|
94
|
+
rowsRoot.prepend(fragment);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const scheduleSort = (): void => {
|
|
98
|
+
if (scheduledFrame !== null) return;
|
|
99
|
+
if (!state && !orderDirty) return;
|
|
100
|
+
|
|
101
|
+
scheduledFrame = window.requestAnimationFrame(() => {
|
|
102
|
+
scheduledFrame = null;
|
|
103
|
+
applySort();
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const updateButtons = (): void => {
|
|
108
|
+
for (const button of buttons) {
|
|
109
|
+
const id = button.dataset.tableSortColumn;
|
|
110
|
+
const activeState = state?.id === id ? state : null;
|
|
111
|
+
const direction = activeState?.direction ?? 'none';
|
|
112
|
+
const label = button.dataset.tableSortLabel ?? id ?? '';
|
|
113
|
+
const directionLabel =
|
|
114
|
+
direction === 'ascending'
|
|
115
|
+
? button.dataset.tableSortAscendingLabel
|
|
116
|
+
: direction === 'descending'
|
|
117
|
+
? button.dataset.tableSortDescendingLabel
|
|
118
|
+
: button.dataset.tableSortNoneLabel;
|
|
119
|
+
|
|
120
|
+
button.dataset.tableSortDirection = direction;
|
|
121
|
+
button.setAttribute('aria-pressed', String(Boolean(activeState)));
|
|
122
|
+
button.setAttribute('aria-label', `${label}: ${directionLabel ?? ''}`);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const handleClick = (event: MouseEvent): void => {
|
|
127
|
+
const target = event.target;
|
|
128
|
+
if (!(target instanceof Element)) return;
|
|
129
|
+
const button = target.closest<HTMLButtonElement>(
|
|
130
|
+
'[data-table-sort-column]',
|
|
131
|
+
);
|
|
132
|
+
if (!button || !root.contains(button)) return;
|
|
133
|
+
|
|
134
|
+
const id = button.dataset.tableSortColumn;
|
|
135
|
+
const type = button.dataset.tableSortType;
|
|
136
|
+
if (!id || (type !== 'number' && type !== 'text')) return;
|
|
137
|
+
|
|
138
|
+
if (state?.id !== id) {
|
|
139
|
+
state = {
|
|
140
|
+
id,
|
|
141
|
+
type,
|
|
142
|
+
direction: 'descending',
|
|
143
|
+
tieBreaker: button.dataset.tableSortTieBreaker,
|
|
144
|
+
};
|
|
145
|
+
root.dispatchEvent(new CustomEvent('table:load-all', { bubbles: true }));
|
|
146
|
+
} else if (state.direction === 'descending') {
|
|
147
|
+
state = { ...state, direction: 'ascending' };
|
|
148
|
+
} else {
|
|
149
|
+
state = null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
updateButtons();
|
|
153
|
+
scheduleSort();
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const handleRowsAppended = (event: Event): void => {
|
|
157
|
+
const detail = (event as CustomEvent<{ rows?: readonly HTMLElement[] }>)
|
|
158
|
+
.detail;
|
|
159
|
+
registerRows(detail?.rows ?? []);
|
|
160
|
+
scheduleSort();
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const handleSortValuesChanged = (): void => {
|
|
164
|
+
scheduleSort();
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const handleSortReset = (): void => {
|
|
168
|
+
if (!state && !orderDirty) return;
|
|
169
|
+
|
|
170
|
+
state = null;
|
|
171
|
+
updateButtons();
|
|
172
|
+
scheduleSort();
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
registerRows(getRows());
|
|
176
|
+
updateButtons();
|
|
177
|
+
root.addEventListener('click', handleClick);
|
|
178
|
+
root.addEventListener('table:rows-appended', handleRowsAppended);
|
|
179
|
+
root.addEventListener('table:sort-values-changed', handleSortValuesChanged);
|
|
180
|
+
root.addEventListener('table:sort-reset', handleSortReset);
|
|
181
|
+
|
|
182
|
+
return () => {
|
|
183
|
+
if (scheduledFrame !== null) {
|
|
184
|
+
window.cancelAnimationFrame(scheduledFrame);
|
|
185
|
+
scheduledFrame = null;
|
|
186
|
+
}
|
|
187
|
+
state = null;
|
|
188
|
+
updateButtons();
|
|
189
|
+
if (orderDirty) applySort();
|
|
190
|
+
root.removeEventListener('click', handleClick);
|
|
191
|
+
root.removeEventListener('table:rows-appended', handleRowsAppended);
|
|
192
|
+
root.removeEventListener(
|
|
193
|
+
'table:sort-values-changed',
|
|
194
|
+
handleSortValuesChanged,
|
|
195
|
+
);
|
|
196
|
+
root.removeEventListener('table:sort-reset', handleSortReset);
|
|
197
|
+
root.removeAttribute(initializedAttribute);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function setTableSortValues(
|
|
202
|
+
row: HTMLElement,
|
|
203
|
+
values: Readonly<Record<string, SortValue>>,
|
|
204
|
+
): void {
|
|
205
|
+
const nextValues = {
|
|
206
|
+
...getSortValues(row),
|
|
207
|
+
...values,
|
|
208
|
+
};
|
|
209
|
+
sortValuesCache.set(row, nextValues);
|
|
210
|
+
row.dataset.tableSortValues = JSON.stringify(nextValues);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export function refreshTableSort(root: HTMLElement): void {
|
|
214
|
+
root.dispatchEvent(
|
|
215
|
+
new CustomEvent('table:sort-values-changed', { bubbles: true }),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function resetTableSort(root: HTMLElement): void {
|
|
220
|
+
root.dispatchEvent(new Event('table:sort-reset'));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function compareValues(
|
|
224
|
+
left: SortValue | undefined,
|
|
225
|
+
right: SortValue | undefined,
|
|
226
|
+
type: SortType,
|
|
227
|
+
direction: SortDirection,
|
|
228
|
+
collator: Intl.Collator,
|
|
229
|
+
): number {
|
|
230
|
+
const leftMissing = left === null || left === undefined;
|
|
231
|
+
const rightMissing = right === null || right === undefined;
|
|
232
|
+
if (leftMissing || rightMissing) {
|
|
233
|
+
if (leftMissing && rightMissing) return 0;
|
|
234
|
+
return leftMissing ? 1 : -1;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const comparison =
|
|
238
|
+
type === 'number'
|
|
239
|
+
? Number(left) - Number(right)
|
|
240
|
+
: collator.compare(String(left), String(right));
|
|
241
|
+
|
|
242
|
+
return direction === 'ascending' ? comparison : -comparison;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function inferSortType(
|
|
246
|
+
left: SortValue | undefined,
|
|
247
|
+
right: SortValue | undefined,
|
|
248
|
+
): SortType {
|
|
249
|
+
return typeof left === 'number' || typeof right === 'number'
|
|
250
|
+
? 'number'
|
|
251
|
+
: 'text';
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function getSortValues(row: HTMLElement): SortValues {
|
|
255
|
+
const cached = sortValuesCache.get(row);
|
|
256
|
+
if (cached) return cached;
|
|
257
|
+
|
|
258
|
+
const values = parseSortValues(row.dataset.tableSortValues);
|
|
259
|
+
sortValuesCache.set(row, values);
|
|
260
|
+
return values;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function parseSortValues(value: string | undefined): SortValues {
|
|
264
|
+
if (!value) return {};
|
|
265
|
+
|
|
266
|
+
try {
|
|
267
|
+
const parsed: unknown = JSON.parse(value);
|
|
268
|
+
return parsed && typeof parsed === 'object' ? (parsed as SortValues) : {};
|
|
269
|
+
} catch {
|
|
270
|
+
return {};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { default as CircuitPuzzle } from './CircuitPuzzle/CircuitPuzzle.astro';
|
|
2
|
+
export { default as Combobox } from './Combobox/Combobox.astro';
|
|
3
|
+
export { default as Dropdown } from './Dropdown/Dropdown.astro';
|
|
4
|
+
export { default as FullscreenControl } from './Fullscreen/FullscreenControl.astro';
|
|
5
|
+
export { default as GlitchOverlay } from './GlitchOverlay/GlitchOverlay.astro';
|
|
6
|
+
export { default as GuidedFlow } from './GuidedFlow/GuidedFlow.astro';
|
|
7
|
+
export { default as MagneticFieldPuzzle } from './MagneticFieldPuzzle/MagneticFieldPuzzle.astro';
|
|
8
|
+
export { default as MapViewport } from './MapViewport/MapViewport.astro';
|
|
9
|
+
export { default as Modal } from './Modal/Modal.astro';
|
|
10
|
+
export { default as ModalClose } from './Modal/ModalClose.astro';
|
|
11
|
+
export { default as ModalOpen } from './Modal/ModalOpen.astro';
|
|
12
|
+
export { default as PuzzleGrid } from './PuzzleGrid/PuzzleGrid.astro';
|
|
13
|
+
export { default as SpriteProjectilePreview } from './SpriteProjectilePreview/SpriteProjectilePreview.astro';
|
|
14
|
+
export { default as StageFlow } from './StageFlow/StageFlow.astro';
|
|
15
|
+
export { default as Table } from './Table/Table.astro';
|
|
16
|
+
export { default as TableBody } from './Table/TableBody.astro';
|
|
17
|
+
export { default as TableFooter } from './Table/TableFooter.astro';
|
|
18
|
+
export { default as TableHeader } from './Table/TableHeader.astro';
|
|
19
|
+
export { default as TablePagination } from './Table/TablePagination.astro';
|
|
20
|
+
export { default as TableSkeleton } from './Table/TableSkeleton.astro';
|
|
21
|
+
export * from './CircuitPuzzle/circuitPuzzleController';
|
|
22
|
+
export * from './CircuitPuzzle/contracts';
|
|
23
|
+
export * from './Combobox/comboboxController';
|
|
24
|
+
export * from './Combobox/contracts';
|
|
25
|
+
export * from './Dropdown/dropdownController';
|
|
26
|
+
export * from './Fullscreen/fullscreenController';
|
|
27
|
+
export * from './GlitchOverlay/glitchOverlayController';
|
|
28
|
+
export * from './GuidedFlow/contracts';
|
|
29
|
+
export * from './GuidedFlow/guidedFlowController';
|
|
30
|
+
export * from './MagneticFieldPuzzle/contracts';
|
|
31
|
+
export * from './MagneticFieldPuzzle/magneticFieldPuzzleController';
|
|
32
|
+
export * from './MagneticFieldPuzzle/simulation';
|
|
33
|
+
export * from './MapViewport/contracts';
|
|
34
|
+
export * from './MapViewport/geometry';
|
|
35
|
+
export * from './MapViewport/mapViewportController';
|
|
36
|
+
export * from './Modal/modalController';
|
|
37
|
+
export * from './PuzzleGrid/contracts';
|
|
38
|
+
export * from './PuzzleGrid/selectionDismissal';
|
|
39
|
+
export * from './PuzzleGrid/state';
|
|
40
|
+
export * from './SpriteProjectilePreview/contracts';
|
|
41
|
+
export * from './SpriteProjectilePreview/spriteProjectilePreviewController';
|
|
42
|
+
export * from './Table/tableCellController';
|
|
43
|
+
export * from './Table/tableFilterController';
|
|
44
|
+
export * from './Table/tableLayout';
|
|
45
|
+
export * from './Table/tableProgressiveController';
|
|
46
|
+
export * from './Table/tableSortController';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as Separator } from './layout/Separator/Separator.astro';
|
|
2
|
+
export { default as AmbientAudio } from './media/AmbientAudio/AmbientAudio.astro';
|
|
3
|
+
export { default as Media } from './media/Media/Media.astro';
|
|
4
|
+
export { default as TextBlock } from './text/TextBlock/TextBlock.astro';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { Tone } from '../../../theme/contracts';
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'hr'> & {
|
|
6
|
+
bleed?: boolean;
|
|
7
|
+
emphasis?: 'default' | 'muted';
|
|
8
|
+
tone?: Tone;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
bleed = false,
|
|
13
|
+
class: className,
|
|
14
|
+
'data-tone': dataTone,
|
|
15
|
+
emphasis = 'muted',
|
|
16
|
+
tone,
|
|
17
|
+
...attrs
|
|
18
|
+
}: Props = Astro.props;
|
|
19
|
+
const resolvedTone = tone ?? dataTone;
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<hr
|
|
23
|
+
{...attrs}
|
|
24
|
+
class:list={['separator', className]}
|
|
25
|
+
data-separator-bleed={bleed ? true : undefined}
|
|
26
|
+
data-separator-emphasis={emphasis}
|
|
27
|
+
data-tone={resolvedTone}
|
|
28
|
+
data-widget="separator"
|
|
29
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.separator {
|
|
2
|
+
inline-size: 100%;
|
|
3
|
+
block-size: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
border: 0;
|
|
6
|
+
border-block-start: var(--nox-border-width) solid var(--nox-border-muted);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.separator[data-separator-emphasis='default'] {
|
|
10
|
+
border-block-start-color: var(--nox-border);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.separator[data-separator-bleed] {
|
|
14
|
+
position: relative;
|
|
15
|
+
inset-inline-start: calc(-1 * var(--nox-content-inline-inset, 0px));
|
|
16
|
+
inline-size: calc(
|
|
17
|
+
100% + var(--nox-content-inline-inset, 0px) +
|
|
18
|
+
var(--nox-content-inline-inset, 0px)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
|
|
4
|
+
type Props = Omit<HTMLAttributes<'audio'>, 'src'> & {
|
|
5
|
+
src: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
class: className,
|
|
11
|
+
loop = false,
|
|
12
|
+
preload = 'auto',
|
|
13
|
+
src,
|
|
14
|
+
type,
|
|
15
|
+
...attrs
|
|
16
|
+
}: Props = Astro.props;
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<audio
|
|
20
|
+
{...attrs}
|
|
21
|
+
class:list={[className]}
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
data-widget="ambient-audio"
|
|
24
|
+
loop={loop}
|
|
25
|
+
preload={preload}
|
|
26
|
+
>
|
|
27
|
+
<source src={src} type={type} />
|
|
28
|
+
</audio>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type {
|
|
4
|
+
DisplayMedia,
|
|
5
|
+
DisplayMediaFit,
|
|
6
|
+
DisplayMediaFraming,
|
|
7
|
+
DisplayMediaRendering,
|
|
8
|
+
DisplayMediaShape,
|
|
9
|
+
DisplayMediaUpscale,
|
|
10
|
+
DisplayMediaVisualSize,
|
|
11
|
+
} from '../../../display/contracts';
|
|
12
|
+
import type { Tone } from '../../../theme/contracts';
|
|
13
|
+
|
|
14
|
+
type MediaSize = 'intrinsic' | 'fill';
|
|
15
|
+
|
|
16
|
+
type Props = Omit<HTMLAttributes<'figure'>, 'style'> & {
|
|
17
|
+
class?: string;
|
|
18
|
+
'data-tone'?: Tone;
|
|
19
|
+
fit?: DisplayMediaFit;
|
|
20
|
+
framing?: DisplayMediaFraming;
|
|
21
|
+
media: DisplayMedia;
|
|
22
|
+
rendering?: DisplayMediaRendering;
|
|
23
|
+
shape?: DisplayMediaShape;
|
|
24
|
+
size?: MediaSize;
|
|
25
|
+
upscale?: DisplayMediaUpscale;
|
|
26
|
+
visualSize?: DisplayMediaVisualSize;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
class: className,
|
|
31
|
+
'data-tone': dataTone,
|
|
32
|
+
fit: fitOverride,
|
|
33
|
+
framing: framingOverride,
|
|
34
|
+
media,
|
|
35
|
+
rendering: renderingOverride,
|
|
36
|
+
shape: shapeOverride,
|
|
37
|
+
size = 'intrinsic',
|
|
38
|
+
upscale: upscaleOverride,
|
|
39
|
+
visualSize: visualSizeOverride,
|
|
40
|
+
...attrs
|
|
41
|
+
}: Props = Astro.props;
|
|
42
|
+
const fit = fitOverride ?? media.fit ?? 'contain';
|
|
43
|
+
const requestedFraming = framingOverride ?? media.framing ?? 'asset';
|
|
44
|
+
const rendering = renderingOverride ?? media.rendering ?? 'auto';
|
|
45
|
+
const shape = shapeOverride ?? media.shape ?? 'default';
|
|
46
|
+
const upscale = upscaleOverride ?? media.upscale ?? 'allow';
|
|
47
|
+
const visualSize = visualSizeOverride ?? media.visualSize ?? 'default';
|
|
48
|
+
const contentBounds =
|
|
49
|
+
requestedFraming === 'content' &&
|
|
50
|
+
media.contentBounds &&
|
|
51
|
+
media.contentBounds.width > 0 &&
|
|
52
|
+
media.contentBounds.height > 0 &&
|
|
53
|
+
media.contentBounds.x >= 0 &&
|
|
54
|
+
media.contentBounds.y >= 0 &&
|
|
55
|
+
media.contentBounds.x + media.contentBounds.width <= media.width &&
|
|
56
|
+
media.contentBounds.y + media.contentBounds.height <= media.height
|
|
57
|
+
? media.contentBounds
|
|
58
|
+
: null;
|
|
59
|
+
const framing = contentBounds ? 'content' : 'asset';
|
|
60
|
+
const aspectRatio = contentBounds
|
|
61
|
+
? `${contentBounds.width} / ${contentBounds.height}`
|
|
62
|
+
: `${media.width} / ${media.height}`;
|
|
63
|
+
const contentExtent = contentBounds
|
|
64
|
+
? Math.max(contentBounds.width, contentBounds.height)
|
|
65
|
+
: 1;
|
|
66
|
+
const contentStyle = contentBounds
|
|
67
|
+
? [
|
|
68
|
+
`--media-content-image-inline-size: ${
|
|
69
|
+
(media.width / contentExtent) * 100
|
|
70
|
+
}%`,
|
|
71
|
+
`--media-content-image-block-size: ${
|
|
72
|
+
(media.height / contentExtent) * 100
|
|
73
|
+
}%`,
|
|
74
|
+
`--media-content-image-inline-start: ${
|
|
75
|
+
(0.5 - (contentBounds.x + contentBounds.width / 2) / contentExtent) *
|
|
76
|
+
100
|
|
77
|
+
}%`,
|
|
78
|
+
`--media-content-image-block-start: ${
|
|
79
|
+
(0.5 - (contentBounds.y + contentBounds.height / 2) / contentExtent) *
|
|
80
|
+
100
|
|
81
|
+
}%`,
|
|
82
|
+
]
|
|
83
|
+
: [];
|
|
84
|
+
const srcset = media.sources
|
|
85
|
+
?.map((source) => `${source.src} ${source.width}w`)
|
|
86
|
+
.join(', ');
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
<figure
|
|
90
|
+
{...attrs}
|
|
91
|
+
class:list={['media', className]}
|
|
92
|
+
data-widget="media"
|
|
93
|
+
data-media-fit={fit}
|
|
94
|
+
data-media-framing={framing}
|
|
95
|
+
data-media-rendering={rendering}
|
|
96
|
+
data-media-shape={shape}
|
|
97
|
+
data-media-size={size}
|
|
98
|
+
data-media-upscale={upscale}
|
|
99
|
+
data-media-visual-size={visualSize}
|
|
100
|
+
data-tone={dataTone}
|
|
101
|
+
style={[
|
|
102
|
+
`--media-aspect-ratio: ${aspectRatio}`,
|
|
103
|
+
`--media-source-inline-size: ${media.width}px`,
|
|
104
|
+
`--media-source-block-size: ${media.height}px`,
|
|
105
|
+
...contentStyle,
|
|
106
|
+
].join('; ')}
|
|
107
|
+
>
|
|
108
|
+
<div class="media__frame">
|
|
109
|
+
<img
|
|
110
|
+
src={media.src}
|
|
111
|
+
srcset={srcset}
|
|
112
|
+
sizes={media.sizes}
|
|
113
|
+
alt={media.alt}
|
|
114
|
+
width={media.width}
|
|
115
|
+
height={media.height}
|
|
116
|
+
loading={media.loading ?? 'lazy'}
|
|
117
|
+
decoding={media.decoding ?? 'async'}
|
|
118
|
+
fetchpriority={media.fetchPriority}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
{media.caption ? <figcaption>{media.caption}</figcaption> : null}
|
|
122
|
+
</figure>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
.media {
|
|
2
|
+
--media-fit: contain;
|
|
3
|
+
--media-object-inline-size: auto;
|
|
4
|
+
--media-object-block-size: auto;
|
|
5
|
+
--media-object-max-inline-size: 100%;
|
|
6
|
+
--media-object-max-block-size: 100%;
|
|
7
|
+
--media-object-radius: 0;
|
|
8
|
+
--media-visual-max-size: 100%;
|
|
9
|
+
|
|
10
|
+
display: grid;
|
|
11
|
+
overflow: visible;
|
|
12
|
+
margin: 0;
|
|
13
|
+
justify-items: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.media[data-media-fit='contain'] {
|
|
19
|
+
--media-fit: contain;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.media[data-media-fit='cover'] {
|
|
23
|
+
--media-fit: cover;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.media[data-media-fit='fill'] {
|
|
27
|
+
--media-fit: fill;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.media[data-media-fit='none'] {
|
|
31
|
+
--media-fit: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.media[data-media-fit='scale-down'] {
|
|
35
|
+
--media-fit: scale-down;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.media[data-media-rendering='pixelated'] .media__frame img {
|
|
39
|
+
image-rendering: pixelated;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.media[data-media-shape='circle'] {
|
|
43
|
+
--media-object-radius: var(--nox-radius-pill);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.media[data-media-visual-size='compact'] {
|
|
47
|
+
--media-visual-max-size: calc(
|
|
48
|
+
var(--nox-compact-media-responsive-size) - var(--nox-space-2)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.media__frame {
|
|
53
|
+
display: grid;
|
|
54
|
+
inline-size: 100%;
|
|
55
|
+
max-inline-size: 100%;
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
min-block-size: 0;
|
|
58
|
+
place-items: center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.media__frame img {
|
|
62
|
+
display: block;
|
|
63
|
+
inline-size: var(--media-object-inline-size);
|
|
64
|
+
block-size: var(--media-object-block-size);
|
|
65
|
+
max-inline-size: min(
|
|
66
|
+
var(--media-object-max-inline-size),
|
|
67
|
+
var(--media-visual-max-size)
|
|
68
|
+
);
|
|
69
|
+
max-block-size: min(
|
|
70
|
+
var(--media-object-max-block-size),
|
|
71
|
+
var(--media-visual-max-size)
|
|
72
|
+
);
|
|
73
|
+
border-radius: var(--media-object-radius);
|
|
74
|
+
object-fit: var(--media-fit);
|
|
75
|
+
object-position: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.media figcaption {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
inline-size: 100%;
|
|
81
|
+
min-inline-size: 0;
|
|
82
|
+
padding: 0 var(--nox-space-3) var(--nox-space-3);
|
|
83
|
+
color: var(--nox-text-muted);
|
|
84
|
+
font-size: var(--nox-font-size-sm);
|
|
85
|
+
overflow-wrap: anywhere;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.media[data-media-size='fill'] {
|
|
90
|
+
--media-object-inline-size: 100%;
|
|
91
|
+
--media-object-block-size: 100%;
|
|
92
|
+
|
|
93
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
94
|
+
align-items: stretch;
|
|
95
|
+
width: 100%;
|
|
96
|
+
inline-size: 100%;
|
|
97
|
+
block-size: 100%;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
min-height: 0;
|
|
100
|
+
min-inline-size: 0;
|
|
101
|
+
min-block-size: 0;
|
|
102
|
+
max-inline-size: 100%;
|
|
103
|
+
max-block-size: 100%;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.media[data-media-size='fill'] .media__frame {
|
|
107
|
+
position: relative;
|
|
108
|
+
inline-size: 100%;
|
|
109
|
+
block-size: 100%;
|
|
110
|
+
min-width: 0;
|
|
111
|
+
min-height: 0;
|
|
112
|
+
min-inline-size: 0;
|
|
113
|
+
min-block-size: 0;
|
|
114
|
+
max-inline-size: 100%;
|
|
115
|
+
max-block-size: 100%;
|
|
116
|
+
aspect-ratio: var(--media-aspect-ratio);
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.media[data-media-size='fill'] .media__frame img {
|
|
121
|
+
position: absolute;
|
|
122
|
+
inset: 0;
|
|
123
|
+
inline-size: 100%;
|
|
124
|
+
block-size: 100%;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.media[data-media-framing='content'] .media__frame {
|
|
128
|
+
position: relative;
|
|
129
|
+
inline-size: 100%;
|
|
130
|
+
block-size: 100%;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.media[data-media-framing='content'] .media__frame img {
|
|
135
|
+
position: absolute;
|
|
136
|
+
inset-block-start: var(--media-content-image-block-start);
|
|
137
|
+
inset-inline-start: var(--media-content-image-inline-start);
|
|
138
|
+
inline-size: var(--media-content-image-inline-size);
|
|
139
|
+
block-size: var(--media-content-image-block-size);
|
|
140
|
+
max-inline-size: none;
|
|
141
|
+
max-block-size: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.media[data-media-upscale='prevent'] .media__frame img {
|
|
145
|
+
max-inline-size: min(
|
|
146
|
+
var(--media-object-max-inline-size),
|
|
147
|
+
var(--media-visual-max-size),
|
|
148
|
+
var(--media-source-inline-size)
|
|
149
|
+
);
|
|
150
|
+
max-block-size: min(
|
|
151
|
+
var(--media-object-max-block-size),
|
|
152
|
+
var(--media-visual-max-size),
|
|
153
|
+
var(--media-source-block-size)
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.media[data-media-upscale='prevent'][data-media-size='fill'][data-media-framing='asset']
|
|
158
|
+
.media__frame
|
|
159
|
+
img {
|
|
160
|
+
margin: auto;
|
|
161
|
+
}
|