@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,22 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
class="stage-flow__symbol stage-flow__arrow"
|
|
3
|
+
viewBox="0 0 20 44"
|
|
4
|
+
fill="none"
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
focusable="false"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
class="stage-flow__symbol-outline"
|
|
10
|
+
d="M6 6.5 15 22 6 37.5"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
stroke-linecap="round"
|
|
13
|
+
stroke-linejoin="round"
|
|
14
|
+
stroke-width="5.5"></path>
|
|
15
|
+
<path
|
|
16
|
+
class="stage-flow__symbol-line"
|
|
17
|
+
d="M6 6.5 15 22 6 37.5"
|
|
18
|
+
stroke="currentColor"
|
|
19
|
+
stroke-linecap="round"
|
|
20
|
+
stroke-linejoin="round"
|
|
21
|
+
stroke-width="2.75"></path>
|
|
22
|
+
</svg>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { StageFlowItem } from '../../display/contracts';
|
|
3
|
+
import Tag from '../../components/data-display/Tag/Tag.astro';
|
|
4
|
+
import TextPair from '../../components/data-display/TextPair/TextPair.astro';
|
|
5
|
+
import MediaFrame from '../../components/media/MediaFrame/MediaFrame.astro';
|
|
6
|
+
import Inline from '../../composition/Inline/Inline.astro';
|
|
7
|
+
import Media from '../../primitives/media/Media/Media.astro';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
stage: StageFlowItem;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const { stage }: Props = Astro.props;
|
|
14
|
+
const StageTag = stage.href ? 'a' : 'div';
|
|
15
|
+
const stageAttributes = stage.href ? { href: stage.href } : {};
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<li class="stage-flow__item stage-flow__item--stage">
|
|
19
|
+
<StageTag
|
|
20
|
+
{...stageAttributes}
|
|
21
|
+
class="stage-flow__stage"
|
|
22
|
+
aria-current={stage.active ? 'page' : undefined}
|
|
23
|
+
>
|
|
24
|
+
<MediaFrame class="stage-flow__media" shape="circle" size="md">
|
|
25
|
+
{
|
|
26
|
+
stage.media ? (
|
|
27
|
+
<Media media={stage.media} fit="contain" size="fill" />
|
|
28
|
+
) : null
|
|
29
|
+
}
|
|
30
|
+
</MediaFrame>
|
|
31
|
+
<span class="stage-flow__content">
|
|
32
|
+
<TextPair class="stage-flow__text" primary={stage.title} />
|
|
33
|
+
{
|
|
34
|
+
stage.tags && stage.tags.length > 0 ? (
|
|
35
|
+
<Inline
|
|
36
|
+
as="span"
|
|
37
|
+
class="stage-flow__tags"
|
|
38
|
+
align="center"
|
|
39
|
+
gap="sm"
|
|
40
|
+
justify="center"
|
|
41
|
+
wrap
|
|
42
|
+
>
|
|
43
|
+
{stage.tags.map((tag) => (
|
|
44
|
+
<Tag {...tag} size="sm" />
|
|
45
|
+
))}
|
|
46
|
+
</Inline>
|
|
47
|
+
) : null
|
|
48
|
+
}
|
|
49
|
+
</span>
|
|
50
|
+
</StageTag>
|
|
51
|
+
</li>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
.stage-flow__item--stage {
|
|
2
|
+
inline-size: max-content;
|
|
3
|
+
min-inline-size: var(--stage-flow-stage-min-inline-size);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.stage-flow__stage {
|
|
7
|
+
display: grid;
|
|
8
|
+
inline-size: max-content;
|
|
9
|
+
min-inline-size: var(--stage-flow-stage-min-inline-size);
|
|
10
|
+
min-block-size: 9.75rem;
|
|
11
|
+
align-content: start;
|
|
12
|
+
justify-items: center;
|
|
13
|
+
padding: var(--nox-space-2);
|
|
14
|
+
gap: var(--nox-space-3);
|
|
15
|
+
border-radius: var(--nox-radius-lg);
|
|
16
|
+
background: transparent;
|
|
17
|
+
color: var(--nox-text);
|
|
18
|
+
text-align: center;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stage-flow__stage[href] {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.stage-flow__media {
|
|
27
|
+
--media-frame-size: var(--stage-flow-media-size);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.stage-flow__stage:focus-visible {
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.stage-flow__stage[aria-current='page'] [data-widget='media-frame'] {
|
|
35
|
+
border-width: 4px;
|
|
36
|
+
border-color: var(--nox-tone-color);
|
|
37
|
+
background:
|
|
38
|
+
radial-gradient(
|
|
39
|
+
circle at 50% 42%,
|
|
40
|
+
color-mix(in srgb, var(--nox-tone-color) 18%, transparent),
|
|
41
|
+
transparent 58%
|
|
42
|
+
),
|
|
43
|
+
var(--nox-tone-background);
|
|
44
|
+
box-shadow:
|
|
45
|
+
0 0 0 1px var(--nox-tone-color),
|
|
46
|
+
0 0.35rem 0.75rem
|
|
47
|
+
color-mix(in srgb, var(--nox-tone-shadow) 16%, transparent);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.stage-flow__stage:focus-visible [data-widget='media-frame'] {
|
|
51
|
+
box-shadow:
|
|
52
|
+
0 0 0 1px var(--nox-border),
|
|
53
|
+
0 0 0 5px color-mix(in srgb, var(--nox-tone-focus-ring) 22%, transparent),
|
|
54
|
+
0 0.5rem 1rem color-mix(in srgb, var(--nox-tone-shadow) 18%, transparent);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.stage-flow__stage[aria-current='page']:focus-visible
|
|
58
|
+
[data-widget='media-frame'] {
|
|
59
|
+
border-color: var(--nox-tone-color);
|
|
60
|
+
box-shadow:
|
|
61
|
+
0 0 0 1px var(--nox-tone-color),
|
|
62
|
+
0 0 0 6px color-mix(in srgb, var(--nox-tone-focus-ring) 18%, transparent),
|
|
63
|
+
0 0.5rem 1rem color-mix(in srgb, var(--nox-tone-shadow) 18%, transparent);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.stage-flow__content {
|
|
67
|
+
display: grid;
|
|
68
|
+
min-inline-size: 0;
|
|
69
|
+
justify-items: center;
|
|
70
|
+
gap: var(--nox-space-2);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.stage-flow__text {
|
|
74
|
+
--text-pair-primary-color: var(--nox-tone-text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.stage-flow__tags {
|
|
78
|
+
max-inline-size: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (hover: hover) and (pointer: fine) {
|
|
82
|
+
.stage-flow__stage[href]:not([aria-current='page']):hover
|
|
83
|
+
[data-widget='media-frame'] {
|
|
84
|
+
box-shadow:
|
|
85
|
+
0 0 0 1px var(--nox-border),
|
|
86
|
+
0 0 0 5px color-mix(in srgb, var(--nox-tone-color) 16%, transparent),
|
|
87
|
+
0 0.5rem 1rem color-mix(in srgb, var(--nox-tone-shadow) 18%, transparent);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
92
|
+
.stage-flow__stage [data-widget='media-frame'] {
|
|
93
|
+
transition:
|
|
94
|
+
background-color var(--nox-motion-duration-sm)
|
|
95
|
+
var(--nox-motion-easing-standard),
|
|
96
|
+
border-color var(--nox-motion-duration-sm)
|
|
97
|
+
var(--nox-motion-easing-standard),
|
|
98
|
+
box-shadow var(--nox-motion-duration-sm) var(--nox-motion-easing-standard);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@container (width < 32rem) {
|
|
103
|
+
.stage-flow__stage {
|
|
104
|
+
min-block-size: 8.75rem;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { StageFlowItem } from '../../display/contracts';
|
|
3
|
+
import StageFlowAlternative from './StageFlowAlternative.astro';
|
|
4
|
+
import StageFlowStage from './StageFlowStage.astro';
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
options: readonly StageFlowItem[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const { options }: Props = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<li class="stage-flow__item stage-flow__item--step">
|
|
14
|
+
<ol class="stage-flow__step-options">
|
|
15
|
+
{
|
|
16
|
+
options.map((option, index) => (
|
|
17
|
+
<>
|
|
18
|
+
{index > 0 ? <StageFlowAlternative /> : null}
|
|
19
|
+
<StageFlowStage stage={option} />
|
|
20
|
+
</>
|
|
21
|
+
))
|
|
22
|
+
}
|
|
23
|
+
</ol>
|
|
24
|
+
</li>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.stage-flow__item--step {
|
|
2
|
+
inline-size: max-content;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.stage-flow__step-options {
|
|
6
|
+
display: grid;
|
|
7
|
+
align-items: center;
|
|
8
|
+
grid-auto-columns: max-content;
|
|
9
|
+
grid-auto-flow: column;
|
|
10
|
+
gap: var(--nox-space-2);
|
|
11
|
+
list-style: none;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.stage-flow__item--alternative {
|
|
17
|
+
inline-size: var(--stage-flow-alternative-inline-size);
|
|
18
|
+
place-items: center;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.stage-flow__symbol {
|
|
2
|
+
display: block;
|
|
3
|
+
block-size: 2.9rem;
|
|
4
|
+
color: var(--nox-tone-color);
|
|
5
|
+
filter: drop-shadow(
|
|
6
|
+
0 0.18rem 0.22rem
|
|
7
|
+
color-mix(in srgb, var(--nox-tone-shadow) 18%, transparent)
|
|
8
|
+
);
|
|
9
|
+
overflow: visible;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.stage-flow__arrow {
|
|
13
|
+
inline-size: 1.45rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.stage-flow__alternative {
|
|
17
|
+
inline-size: 1.1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.stage-flow__symbol-outline {
|
|
21
|
+
color: var(--nox-tone-color);
|
|
22
|
+
opacity: 0.92;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.stage-flow__symbol-line {
|
|
26
|
+
color: var(--nox-surface);
|
|
27
|
+
opacity: 0.98;
|
|
28
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type {
|
|
4
|
+
TableColumn,
|
|
5
|
+
TablePaginationModel,
|
|
6
|
+
TableRow,
|
|
7
|
+
} from '../../display/contracts';
|
|
8
|
+
import type { Tone } from '../../theme/contracts';
|
|
9
|
+
import SurfaceGroup from '../../composition/SurfaceGroup/SurfaceGroup.astro';
|
|
10
|
+
import TableBody from './TableBody.astro';
|
|
11
|
+
import TableFooter from './TableFooter.astro';
|
|
12
|
+
import TableHeader from './TableHeader.astro';
|
|
13
|
+
import TablePagination from './TablePagination.astro';
|
|
14
|
+
import {
|
|
15
|
+
getTableColumnDensity,
|
|
16
|
+
getTableMinimumInlineSize,
|
|
17
|
+
getTableColumnTemplate,
|
|
18
|
+
type TableLayout,
|
|
19
|
+
} from './tableLayout';
|
|
20
|
+
|
|
21
|
+
type TableSortMessages = {
|
|
22
|
+
sortBy: string;
|
|
23
|
+
sortAscending: string;
|
|
24
|
+
sortDescending: string;
|
|
25
|
+
sortNone: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type TablePaginationMessages = {
|
|
29
|
+
error: string;
|
|
30
|
+
loading: string;
|
|
31
|
+
nextPage: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type Props = Omit<HTMLAttributes<'div'>, 'style'> & {
|
|
35
|
+
caption: string;
|
|
36
|
+
columns: readonly TableColumn[];
|
|
37
|
+
density?: 'regular' | 'compact';
|
|
38
|
+
emptyMessage: string;
|
|
39
|
+
errorMessage?: string;
|
|
40
|
+
filterEmptyMessage?: string;
|
|
41
|
+
header?: 'visible' | 'hidden';
|
|
42
|
+
inlineOverflow?: 'auto' | 'wrap';
|
|
43
|
+
layout?: TableLayout;
|
|
44
|
+
pagination?: TablePaginationModel;
|
|
45
|
+
paginationKey?: string;
|
|
46
|
+
paginationMessages?: TablePaginationMessages;
|
|
47
|
+
rowSizing?: 'content' | 'fill';
|
|
48
|
+
rows: readonly TableRow[];
|
|
49
|
+
skeletonRows?: number;
|
|
50
|
+
sortMessages?: TableSortMessages;
|
|
51
|
+
stickyHeader?: boolean;
|
|
52
|
+
tone?: Tone;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
caption,
|
|
57
|
+
class: className,
|
|
58
|
+
columns,
|
|
59
|
+
'data-tone': dataTone,
|
|
60
|
+
density = 'regular',
|
|
61
|
+
emptyMessage,
|
|
62
|
+
errorMessage,
|
|
63
|
+
filterEmptyMessage,
|
|
64
|
+
header = 'visible',
|
|
65
|
+
inlineOverflow = 'auto',
|
|
66
|
+
layout = 'default',
|
|
67
|
+
pagination,
|
|
68
|
+
paginationKey,
|
|
69
|
+
paginationMessages,
|
|
70
|
+
rowSizing = 'content',
|
|
71
|
+
rows,
|
|
72
|
+
skeletonRows,
|
|
73
|
+
sortMessages,
|
|
74
|
+
stickyHeader = false,
|
|
75
|
+
tone,
|
|
76
|
+
...attrs
|
|
77
|
+
}: Props = Astro.props;
|
|
78
|
+
const minimumInlineSize = getTableMinimumInlineSize(columns, layout);
|
|
79
|
+
const overflowColumnTemplate =
|
|
80
|
+
layout === 'index'
|
|
81
|
+
? getTableColumnTemplate(columns, layout, 'overflow')
|
|
82
|
+
: undefined;
|
|
83
|
+
const tableStyle = [
|
|
84
|
+
`--table-column-template: ${getTableColumnTemplate(columns, layout)}`,
|
|
85
|
+
minimumInlineSize
|
|
86
|
+
? `--table-index-min-inline-size: ${minimumInlineSize}`
|
|
87
|
+
: undefined,
|
|
88
|
+
overflowColumnTemplate
|
|
89
|
+
? `--table-index-overflow-column-template: ${overflowColumnTemplate}`
|
|
90
|
+
: undefined,
|
|
91
|
+
]
|
|
92
|
+
.filter(Boolean)
|
|
93
|
+
.join('; ');
|
|
94
|
+
const columnDensity = getTableColumnDensity(columns);
|
|
95
|
+
const resolvedTone = tone ?? dataTone;
|
|
96
|
+
const hasSortableColumns = columns.some((column) => column.sort);
|
|
97
|
+
const hasFooter = Astro.slots.has('footer');
|
|
98
|
+
|
|
99
|
+
if (header === 'visible' && hasSortableColumns && !sortMessages) {
|
|
100
|
+
throw new Error('Sortable table columns require localized sort messages');
|
|
101
|
+
}
|
|
102
|
+
if (pagination?.nextHref && !paginationMessages) {
|
|
103
|
+
throw new Error('Paginated tables require localized pagination messages');
|
|
104
|
+
}
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
<div
|
|
108
|
+
{...attrs}
|
|
109
|
+
class:list={['table', className]}
|
|
110
|
+
data-widget="table"
|
|
111
|
+
data-composition="table"
|
|
112
|
+
data-table-column-density={columnDensity}
|
|
113
|
+
data-table-density={density}
|
|
114
|
+
data-table-inline-overflow={inlineOverflow}
|
|
115
|
+
data-table-index-minimum-rem={
|
|
116
|
+
minimumInlineSize ? Number.parseFloat(minimumInlineSize) : undefined
|
|
117
|
+
}
|
|
118
|
+
data-table-layout={layout}
|
|
119
|
+
data-table-key={paginationKey}
|
|
120
|
+
data-table-scroll-root
|
|
121
|
+
data-table-sticky-header={stickyHeader ? true : undefined}
|
|
122
|
+
data-tone={resolvedTone}
|
|
123
|
+
style={tableStyle}
|
|
124
|
+
>
|
|
125
|
+
<SurfaceGroup>
|
|
126
|
+
<slot name="heading" />
|
|
127
|
+
{
|
|
128
|
+
header === 'visible' ? (
|
|
129
|
+
<TableHeader columns={columns} sortMessages={sortMessages} />
|
|
130
|
+
) : null
|
|
131
|
+
}
|
|
132
|
+
<TableBody
|
|
133
|
+
caption={caption}
|
|
134
|
+
columns={columns}
|
|
135
|
+
emptyMessage={emptyMessage}
|
|
136
|
+
errorMessage={errorMessage}
|
|
137
|
+
filterEmptyMessage={filterEmptyMessage}
|
|
138
|
+
layout={layout}
|
|
139
|
+
rowSizing={rowSizing}
|
|
140
|
+
rows={rows}
|
|
141
|
+
/>
|
|
142
|
+
{
|
|
143
|
+
pagination && paginationMessages ? (
|
|
144
|
+
<TablePagination
|
|
145
|
+
columns={columns}
|
|
146
|
+
errorLabel={paginationMessages.error}
|
|
147
|
+
loadingLabel={paginationMessages.loading}
|
|
148
|
+
nextLabel={paginationMessages.nextPage}
|
|
149
|
+
pagination={pagination}
|
|
150
|
+
skeletonRows={skeletonRows}
|
|
151
|
+
/>
|
|
152
|
+
) : null
|
|
153
|
+
}
|
|
154
|
+
{
|
|
155
|
+
hasFooter ? (
|
|
156
|
+
<TableFooter padding="none">
|
|
157
|
+
<slot name="footer" />
|
|
158
|
+
</TableFooter>
|
|
159
|
+
) : null
|
|
160
|
+
}
|
|
161
|
+
</SurfaceGroup>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<script>
|
|
165
|
+
import { initTableProgressive } from './tableProgressiveController';
|
|
166
|
+
import { initTableScroll } from './tableScrollController';
|
|
167
|
+
import { initTableSort } from './tableSortController';
|
|
168
|
+
|
|
169
|
+
for (const root of document.querySelectorAll('[data-table-scroll-root]')) {
|
|
170
|
+
if (root instanceof HTMLElement) {
|
|
171
|
+
initTableScroll(root);
|
|
172
|
+
initTableProgressive(root);
|
|
173
|
+
initTableSort(root);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.table {
|
|
2
|
+
--table-section-block-size: 3rem;
|
|
3
|
+
--table-header-column-template: var(--table-column-template);
|
|
4
|
+
--table-header-content-inline-size: 100%;
|
|
5
|
+
--table-cell-padding-block: var(--nox-space-1);
|
|
6
|
+
--table-cell-padding-inline: var(--nox-space-2);
|
|
7
|
+
--table-edge-padding-inline: var(--nox-space-4);
|
|
8
|
+
--table-header-letter-spacing: var(--nox-letter-spacing-wider);
|
|
9
|
+
--table-sort-gap: var(--nox-space-1);
|
|
10
|
+
--table-sort-icon-size: 0.75rem;
|
|
11
|
+
--table-row-min-block-size: 4.5rem;
|
|
12
|
+
--table-row-narrow-min-block-size: 3.75rem;
|
|
13
|
+
|
|
14
|
+
container: nox-table / inline-size;
|
|
15
|
+
display: grid;
|
|
16
|
+
inline-size: 100%;
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.table[data-table-column-density='compact'] {
|
|
21
|
+
--table-cell-padding-inline: var(--nox-space-1);
|
|
22
|
+
--table-edge-padding-inline: var(--nox-space-3);
|
|
23
|
+
--table-header-letter-spacing: 0;
|
|
24
|
+
--table-sort-gap: calc(var(--nox-space-1) / 2);
|
|
25
|
+
--table-sort-icon-size: 0.6875rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.table[data-table-density='compact'] {
|
|
29
|
+
--table-row-min-block-size: var(--table-section-block-size);
|
|
30
|
+
--table-row-narrow-min-block-size: var(--table-section-block-size);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.table[data-table-layout='index'] {
|
|
34
|
+
--table-index-row-block-size: var(--table-row-min-block-size);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.table[data-table-layout='index'][data-table-index-overflow] {
|
|
38
|
+
--table-column-template: var(--table-index-overflow-column-template);
|
|
39
|
+
--text-pair-truncate-overflow: visible;
|
|
40
|
+
--text-pair-truncate-text-overflow: clip;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.table[data-table-sticky-header] [data-table-header] {
|
|
44
|
+
position: sticky;
|
|
45
|
+
z-index: 40;
|
|
46
|
+
top: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.table[data-table-sticky-header]:has([data-sticky-surface])
|
|
50
|
+
[data-table-header] {
|
|
51
|
+
top: calc(var(--nox-layout-gap) + var(--nox-section-responsive-block-size));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@container nox-table (width < 32rem) {
|
|
55
|
+
.table {
|
|
56
|
+
--table-cell-padding-inline: var(--nox-space-1);
|
|
57
|
+
--table-edge-padding-inline: var(--nox-space-2);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.table[data-table-sticky-header]:has([data-sticky-surface])
|
|
61
|
+
[data-table-header] {
|
|
62
|
+
top: calc(var(--nox-layout-gap) + var(--nox-section-compact-block-size));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@container nox-table (width < 36rem) {
|
|
67
|
+
.table[data-table-layout='index'] {
|
|
68
|
+
--table-index-row-block-size: var(--table-row-narrow-min-block-size);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { TableCell, TableColumn, TableRow } from '../../display/contracts';
|
|
4
|
+
import type { Tone } from '../../theme/contracts';
|
|
5
|
+
import TableSortIcon from '../../components/icons/TableSortIcon.astro';
|
|
6
|
+
import TextBlock from '../../primitives/text/TextBlock/TextBlock.astro';
|
|
7
|
+
import TableCellContent from './TableCell.astro';
|
|
8
|
+
import {
|
|
9
|
+
getTableColumnAlignment,
|
|
10
|
+
type TableLayout,
|
|
11
|
+
} from './tableLayout';
|
|
12
|
+
|
|
13
|
+
type Props = HTMLAttributes<'div'> & {
|
|
14
|
+
caption: string;
|
|
15
|
+
columns: readonly TableColumn[];
|
|
16
|
+
'data-tone'?: Tone;
|
|
17
|
+
emptyMessage: string;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
filterEmptyMessage?: string;
|
|
20
|
+
layout?: TableLayout;
|
|
21
|
+
rowSizing?: 'content' | 'fill';
|
|
22
|
+
rows: readonly TableRow[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
caption,
|
|
27
|
+
class: className,
|
|
28
|
+
columns,
|
|
29
|
+
'data-tone': dataTone,
|
|
30
|
+
emptyMessage,
|
|
31
|
+
errorMessage,
|
|
32
|
+
filterEmptyMessage,
|
|
33
|
+
layout = 'default',
|
|
34
|
+
rowSizing = 'content',
|
|
35
|
+
rows,
|
|
36
|
+
...attrs
|
|
37
|
+
}: Props = Astro.props;
|
|
38
|
+
|
|
39
|
+
const getCell = (row: TableRow, column: TableColumn): TableCell | undefined =>
|
|
40
|
+
row.cells[column.id];
|
|
41
|
+
const hasExplicitRowHeader = columns.some((column) => column.rowHeader);
|
|
42
|
+
const state = errorMessage ? 'error' : rows.length === 0 ? 'empty' : undefined;
|
|
43
|
+
const stateMessage =
|
|
44
|
+
errorMessage ?? (state === 'empty' ? emptyMessage : undefined);
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
<div
|
|
48
|
+
{...attrs}
|
|
49
|
+
class:list={['table-body', className]}
|
|
50
|
+
data-widget="table-body"
|
|
51
|
+
data-surface
|
|
52
|
+
data-table-row-navigation
|
|
53
|
+
data-table-row-sizing={rowSizing}
|
|
54
|
+
data-table-scrollport="body"
|
|
55
|
+
data-tooltip-boundary
|
|
56
|
+
data-tone={dataTone}
|
|
57
|
+
>
|
|
58
|
+
<table class="table-body__table">
|
|
59
|
+
<caption class="table-body__visually-hidden">{caption}</caption>
|
|
60
|
+
<thead class="table-body__visually-hidden">
|
|
61
|
+
<tr>
|
|
62
|
+
{
|
|
63
|
+
columns.map((column) => (
|
|
64
|
+
<th scope="col">
|
|
65
|
+
{column.hiddenLabel ? <span>{column.label}</span> : column.label}
|
|
66
|
+
</th>
|
|
67
|
+
))
|
|
68
|
+
}
|
|
69
|
+
</tr>
|
|
70
|
+
</thead>
|
|
71
|
+
<tbody class="table-body__rows" data-table-column-grid data-table-rows>
|
|
72
|
+
<tr class="table-body__sizing-row" aria-hidden="true">
|
|
73
|
+
{
|
|
74
|
+
columns.map((column) => (
|
|
75
|
+
<td
|
|
76
|
+
class="table-body__sizing-cell"
|
|
77
|
+
data-table-column-role={column.role}
|
|
78
|
+
>
|
|
79
|
+
{!column.hiddenLabel ? (
|
|
80
|
+
<span class="table-body__sizing-content">
|
|
81
|
+
<span>{column.label}</span>
|
|
82
|
+
{column.sort ? <TableSortIcon aria-hidden="true" /> : null}
|
|
83
|
+
</span>
|
|
84
|
+
) : null}
|
|
85
|
+
</td>
|
|
86
|
+
))
|
|
87
|
+
}
|
|
88
|
+
</tr>
|
|
89
|
+
{
|
|
90
|
+
state && stateMessage ? (
|
|
91
|
+
<tr class="table-body__row" data-table-state={state}>
|
|
92
|
+
<td
|
|
93
|
+
class="table-body__cell"
|
|
94
|
+
colspan={Math.max(1, columns.length)}
|
|
95
|
+
data-table-state={state}
|
|
96
|
+
>
|
|
97
|
+
<TextBlock
|
|
98
|
+
text={stateMessage}
|
|
99
|
+
role={state === 'error' ? 'alert' : 'status'}
|
|
100
|
+
/>
|
|
101
|
+
</td>
|
|
102
|
+
</tr>
|
|
103
|
+
) : (
|
|
104
|
+
rows.map((row) => {
|
|
105
|
+
const rowHref = row.href;
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<tr
|
|
109
|
+
class="table-body__row"
|
|
110
|
+
hidden={row.hidden}
|
|
111
|
+
data-table-row
|
|
112
|
+
data-table-row-key={row.key}
|
|
113
|
+
data-table-row-href={rowHref}
|
|
114
|
+
data-table-filter-values={
|
|
115
|
+
row.filters ? JSON.stringify(row.filters) : undefined
|
|
116
|
+
}
|
|
117
|
+
data-table-sort-values={
|
|
118
|
+
row.sortValues ? JSON.stringify(row.sortValues) : undefined
|
|
119
|
+
}
|
|
120
|
+
data-interaction-accent={rowHref ? 'start' : undefined}
|
|
121
|
+
data-interaction-accent-within={rowHref ? true : undefined}
|
|
122
|
+
>
|
|
123
|
+
{columns.map((column, columnIndex) => {
|
|
124
|
+
const cell = getCell(row, column);
|
|
125
|
+
const isRowHeader = hasExplicitRowHeader
|
|
126
|
+
? column.rowHeader === true
|
|
127
|
+
: columnIndex === 0;
|
|
128
|
+
const CellTag = isRowHeader ? 'th' : 'td';
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<CellTag
|
|
132
|
+
class="table-body__cell"
|
|
133
|
+
scope={isRowHeader ? 'row' : undefined}
|
|
134
|
+
data-align={getTableColumnAlignment(column)}
|
|
135
|
+
data-table-column={column.id}
|
|
136
|
+
data-table-column-role={column.role}
|
|
137
|
+
data-tooltip-trigger={
|
|
138
|
+
cell?.tooltip?.trim() ? true : undefined
|
|
139
|
+
}
|
|
140
|
+
>
|
|
141
|
+
<TableCellContent
|
|
142
|
+
cell={cell}
|
|
143
|
+
rowHref={rowHref}
|
|
144
|
+
truncate={layout === 'index'}
|
|
145
|
+
wrap={column.wrap ?? false}
|
|
146
|
+
/>
|
|
147
|
+
</CellTag>
|
|
148
|
+
);
|
|
149
|
+
})}
|
|
150
|
+
</tr>
|
|
151
|
+
);
|
|
152
|
+
})
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
{
|
|
156
|
+
filterEmptyMessage && !state ? (
|
|
157
|
+
<tr
|
|
158
|
+
class="table-body__row"
|
|
159
|
+
data-table-state="empty"
|
|
160
|
+
data-table-filter-empty
|
|
161
|
+
hidden
|
|
162
|
+
>
|
|
163
|
+
<td
|
|
164
|
+
class="table-body__cell"
|
|
165
|
+
colspan={Math.max(1, columns.length)}
|
|
166
|
+
data-table-state="empty"
|
|
167
|
+
>
|
|
168
|
+
<TextBlock text={filterEmptyMessage} role="status" />
|
|
169
|
+
</td>
|
|
170
|
+
</tr>
|
|
171
|
+
) : null
|
|
172
|
+
}
|
|
173
|
+
</tbody>
|
|
174
|
+
</table>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<script>
|
|
178
|
+
import { initTableRowNavigation } from './tableRowNavigationController';
|
|
179
|
+
|
|
180
|
+
for (const root of document.querySelectorAll('[data-table-row-navigation]')) {
|
|
181
|
+
if (root instanceof HTMLElement) {
|
|
182
|
+
initTableRowNavigation(root);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</script>
|