@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,209 @@
|
|
|
1
|
+
.table-header {
|
|
2
|
+
--surface-border-width: var(--nox-border-width);
|
|
3
|
+
--surface-border-color: var(--nox-border);
|
|
4
|
+
--surface-radius: var(--nox-radius-md);
|
|
5
|
+
--surface-background: var(--nox-surface-muted);
|
|
6
|
+
|
|
7
|
+
container-type: inline-size;
|
|
8
|
+
block-size: var(--table-section-block-size, 3rem);
|
|
9
|
+
min-width: 0;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
overflow-y: hidden;
|
|
12
|
+
overscroll-behavior-inline: contain;
|
|
13
|
+
border: var(--surface-border-width) solid var(--surface-border-color);
|
|
14
|
+
border-radius: var(--surface-radius);
|
|
15
|
+
background: var(--surface-background);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.table-header__row {
|
|
19
|
+
display: grid;
|
|
20
|
+
block-size: 100%;
|
|
21
|
+
inline-size: var(--table-header-content-inline-size);
|
|
22
|
+
grid-template-columns: var(--table-header-column-template);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.table-header__cell {
|
|
26
|
+
display: grid;
|
|
27
|
+
block-size: 100%;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
min-height: 0;
|
|
30
|
+
align-items: center;
|
|
31
|
+
padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
|
|
32
|
+
color: var(--nox-text);
|
|
33
|
+
font-size: var(--nox-font-size-xs);
|
|
34
|
+
font-weight: var(--nox-font-weight-strong);
|
|
35
|
+
letter-spacing: var(--table-header-letter-spacing);
|
|
36
|
+
line-height: 1.2;
|
|
37
|
+
overflow-wrap: normal;
|
|
38
|
+
text-align: start;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.table-header__cell[data-table-sortable] {
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.table-header__sort {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
inline-size: 100%;
|
|
50
|
+
block-size: 100%;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: start;
|
|
54
|
+
gap: var(--table-sort-gap);
|
|
55
|
+
padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
|
|
56
|
+
border: 0;
|
|
57
|
+
background: transparent;
|
|
58
|
+
color: inherit;
|
|
59
|
+
font: inherit;
|
|
60
|
+
letter-spacing: inherit;
|
|
61
|
+
line-height: inherit;
|
|
62
|
+
text-transform: inherit;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.table-header__sort-icon {
|
|
67
|
+
flex: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.table-header__label {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
max-inline-size: 100%;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.table-header__label-text {
|
|
78
|
+
min-width: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.table-header__overflow-marker {
|
|
82
|
+
display: none;
|
|
83
|
+
flex: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.table[data-table-layout='index'] .table-header__label {
|
|
87
|
+
flex: 0 1 auto;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.table[data-table-layout='index'] .table-header__label-text {
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: clip;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.table-header__label[data-table-header-overflowed]
|
|
97
|
+
.table-header__overflow-marker {
|
|
98
|
+
display: inline;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.table-header__cell[data-align='center'] .table-header__sort {
|
|
102
|
+
justify-content: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.table-header__cell[data-align='end'] .table-header__sort {
|
|
106
|
+
justify-content: end;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.table-header__sort-icon {
|
|
110
|
+
inline-size: var(--table-sort-icon-size);
|
|
111
|
+
block-size: var(--table-sort-icon-size);
|
|
112
|
+
color: var(--nox-text-muted);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.table-header__sort[data-table-sort-direction='ascending']
|
|
116
|
+
[data-table-sort-arrow='descending'],
|
|
117
|
+
.table-header__sort[data-table-sort-direction='descending']
|
|
118
|
+
[data-table-sort-arrow='ascending'] {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.table-header__sort[data-table-sort-direction]:not(
|
|
123
|
+
[data-table-sort-direction='none']
|
|
124
|
+
) {
|
|
125
|
+
background: var(--nox-tone-active-background);
|
|
126
|
+
color: var(--nox-tone-color);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.table-header__sort[data-table-sort-direction]:not(
|
|
130
|
+
[data-table-sort-direction='none']
|
|
131
|
+
)
|
|
132
|
+
.table-header__sort-icon {
|
|
133
|
+
color: currentColor;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.table-header__sort:focus-visible {
|
|
137
|
+
outline: var(--nox-focus-ring-width) solid var(--nox-tone-focus-ring);
|
|
138
|
+
outline-offset: calc(var(--nox-focus-ring-width) * -1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.table-header__cell[data-align='center'] {
|
|
142
|
+
justify-items: center;
|
|
143
|
+
text-align: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.table[data-table-layout='index']
|
|
147
|
+
.table-header__cell[data-table-column-role='primary']
|
|
148
|
+
~ .table-header__cell {
|
|
149
|
+
justify-items: center;
|
|
150
|
+
text-align: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.table[data-table-layout='index']
|
|
154
|
+
.table-header__cell[data-table-column-role='primary']
|
|
155
|
+
~ .table-header__cell
|
|
156
|
+
.table-header__sort {
|
|
157
|
+
justify-content: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.table-header__cell[data-align='end'] {
|
|
161
|
+
justify-items: end;
|
|
162
|
+
text-align: end;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.table-header__cell:first-child {
|
|
166
|
+
padding-inline-start: var(--table-edge-padding-inline);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.table-header__cell:last-child {
|
|
170
|
+
padding-inline-end: var(--table-edge-padding-inline);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.table-header__cell[data-table-sortable]:first-child {
|
|
174
|
+
padding-inline-start: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.table-header__cell[data-table-sortable]:last-child {
|
|
178
|
+
padding-inline-end: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.table-header__cell[data-table-sortable]:first-child .table-header__sort {
|
|
182
|
+
padding-inline-start: var(--table-edge-padding-inline);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.table-header__cell[data-table-sortable]:last-child .table-header__sort {
|
|
186
|
+
padding-inline-end: var(--table-edge-padding-inline);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.table-header__visually-hidden {
|
|
190
|
+
position: absolute;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
width: 1px;
|
|
193
|
+
height: 1px;
|
|
194
|
+
clip: rect(0 0 0 0);
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@container (width < 36rem) {
|
|
199
|
+
.table-header__cell {
|
|
200
|
+
font-size: var(--nox-font-size-xs);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@media (hover: hover) and (pointer: fine) {
|
|
205
|
+
.table-header__sort:hover {
|
|
206
|
+
background: var(--nox-tone-hover-background);
|
|
207
|
+
color: var(--nox-tone-color);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type {
|
|
4
|
+
TableColumn,
|
|
5
|
+
TablePaginationModel,
|
|
6
|
+
} from '../../display/contracts';
|
|
7
|
+
import TableFooter from './TableFooter.astro';
|
|
8
|
+
import TableSkeleton from './TableSkeleton.astro';
|
|
9
|
+
|
|
10
|
+
type Props = HTMLAttributes<'div'> & {
|
|
11
|
+
columns: readonly TableColumn[];
|
|
12
|
+
errorLabel: string;
|
|
13
|
+
loadingLabel: string;
|
|
14
|
+
nextLabel: string;
|
|
15
|
+
pagination: TablePaginationModel;
|
|
16
|
+
skeletonRows?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
class: className,
|
|
21
|
+
columns,
|
|
22
|
+
errorLabel,
|
|
23
|
+
loadingLabel,
|
|
24
|
+
nextLabel,
|
|
25
|
+
pagination,
|
|
26
|
+
skeletonRows = 3,
|
|
27
|
+
...attrs
|
|
28
|
+
}: Props = Astro.props;
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
pagination.nextHref ? (
|
|
33
|
+
<TableFooter
|
|
34
|
+
{...attrs}
|
|
35
|
+
class:list={['table-pagination', className]}
|
|
36
|
+
padding="none"
|
|
37
|
+
data-table-pagination
|
|
38
|
+
data-table-page={pagination.page}
|
|
39
|
+
data-table-total-pages={pagination.totalPages}
|
|
40
|
+
data-table-loading-label={loadingLabel}
|
|
41
|
+
data-table-error-label={errorLabel}
|
|
42
|
+
data-table-progressive-state="idle"
|
|
43
|
+
>
|
|
44
|
+
<template data-table-skeleton-template>
|
|
45
|
+
<TableSkeleton columns={columns} rows={skeletonRows} />
|
|
46
|
+
</template>
|
|
47
|
+
<div class="table-pagination__content">
|
|
48
|
+
<a
|
|
49
|
+
class="table-pagination__link"
|
|
50
|
+
href={pagination.nextHref}
|
|
51
|
+
data-table-pagination-link
|
|
52
|
+
>
|
|
53
|
+
{nextLabel}
|
|
54
|
+
</a>
|
|
55
|
+
<span
|
|
56
|
+
class="table-pagination__status"
|
|
57
|
+
data-table-pagination-status
|
|
58
|
+
role="status"
|
|
59
|
+
aria-live="polite"
|
|
60
|
+
hidden
|
|
61
|
+
/>
|
|
62
|
+
<span
|
|
63
|
+
class="table-pagination__sentinel"
|
|
64
|
+
data-table-pagination-sentinel
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</TableFooter>
|
|
69
|
+
) : null
|
|
70
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
.table-pagination__content {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: grid;
|
|
4
|
+
inline-size: 100%;
|
|
5
|
+
min-inline-size: 0;
|
|
6
|
+
place-items: stretch;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.table-pagination__link {
|
|
10
|
+
display: grid;
|
|
11
|
+
inline-size: 100%;
|
|
12
|
+
min-inline-size: 0;
|
|
13
|
+
min-block-size: 100%;
|
|
14
|
+
place-items: center;
|
|
15
|
+
padding-inline: var(--nox-space-4);
|
|
16
|
+
color: var(--nox-tone-color);
|
|
17
|
+
font-size: var(--nox-font-size-sm);
|
|
18
|
+
font-weight: var(--nox-font-weight-strong);
|
|
19
|
+
letter-spacing: var(--nox-letter-spacing-wide);
|
|
20
|
+
line-height: 1;
|
|
21
|
+
text-align: center;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.table-pagination__status {
|
|
27
|
+
position: absolute;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
width: 1px;
|
|
30
|
+
height: 1px;
|
|
31
|
+
clip: rect(0 0 0 0);
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.table-pagination__link:focus-visible {
|
|
36
|
+
outline: var(--nox-focus-ring-width) solid var(--nox-tone-focus-ring);
|
|
37
|
+
outline-offset: calc(var(--nox-focus-ring-width) * -1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.table-pagination__sentinel {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset-inline: 0;
|
|
43
|
+
inset-block-end: 0;
|
|
44
|
+
block-size: 1px;
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.table-pagination[data-table-progressive-enhanced='true'] {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: block;
|
|
51
|
+
overflow: visible;
|
|
52
|
+
block-size: 0;
|
|
53
|
+
min-block-size: 0;
|
|
54
|
+
border: 0;
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
background: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.table-pagination[data-table-progressive-enhanced='true']
|
|
60
|
+
.table-pagination__content {
|
|
61
|
+
block-size: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.table-pagination[data-table-progressive-enhanced='true']
|
|
65
|
+
.table-pagination__link {
|
|
66
|
+
position: absolute;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
width: 1px;
|
|
69
|
+
height: 1px;
|
|
70
|
+
padding: 0;
|
|
71
|
+
clip: rect(0 0 0 0);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.table-pagination[data-table-progressive-enhanced='true']
|
|
76
|
+
.table-pagination__link:focus-visible {
|
|
77
|
+
z-index: 1;
|
|
78
|
+
inset-inline: 0;
|
|
79
|
+
inset-block-end: 0;
|
|
80
|
+
display: grid;
|
|
81
|
+
overflow: visible;
|
|
82
|
+
width: auto;
|
|
83
|
+
height: var(--table-section-block-size, 3rem);
|
|
84
|
+
padding-inline: var(--nox-space-4);
|
|
85
|
+
border: var(--nox-border-width) solid var(--nox-border);
|
|
86
|
+
border-radius: var(--nox-radius-md);
|
|
87
|
+
clip: auto;
|
|
88
|
+
background: var(--nox-surface-muted);
|
|
89
|
+
white-space: normal;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.table-pagination[data-table-progressive-state='loading']
|
|
93
|
+
.table-pagination__link {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.table-pagination[data-table-progressive-state='loading']
|
|
98
|
+
.table-pagination__status {
|
|
99
|
+
position: static;
|
|
100
|
+
display: grid;
|
|
101
|
+
overflow: visible;
|
|
102
|
+
width: 100%;
|
|
103
|
+
height: 100%;
|
|
104
|
+
place-items: center;
|
|
105
|
+
padding-inline: var(--nox-space-4);
|
|
106
|
+
clip: auto;
|
|
107
|
+
color: var(--nox-text-muted);
|
|
108
|
+
font-size: var(--nox-font-size-sm);
|
|
109
|
+
font-weight: var(--nox-font-weight-strong);
|
|
110
|
+
letter-spacing: var(--nox-letter-spacing-wide);
|
|
111
|
+
line-height: 1;
|
|
112
|
+
text-align: center;
|
|
113
|
+
text-transform: uppercase;
|
|
114
|
+
white-space: normal;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.table-pagination[data-table-progressive-enhanced='true']
|
|
118
|
+
.table-pagination__status {
|
|
119
|
+
position: absolute;
|
|
120
|
+
display: inline;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
width: 1px;
|
|
123
|
+
height: 1px;
|
|
124
|
+
padding: 0;
|
|
125
|
+
clip: rect(0 0 0 0);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media (hover: hover) and (pointer: fine) {
|
|
130
|
+
.table-pagination__link:hover {
|
|
131
|
+
background: var(--nox-tone-hover-background);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { TableColumn } from '../../display/contracts';
|
|
3
|
+
import { getTableColumnAlignment } from './tableLayout';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
columns: readonly TableColumn[];
|
|
7
|
+
rows?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const { columns, rows = 3 }: Props = Astro.props;
|
|
11
|
+
const rowCount = Math.max(1, Math.floor(rows));
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<table class="table-skeleton" aria-hidden="true">
|
|
15
|
+
<tbody>
|
|
16
|
+
{
|
|
17
|
+
Array.from({ length: rowCount }, () => (
|
|
18
|
+
<tr
|
|
19
|
+
class="table-skeleton__row"
|
|
20
|
+
data-table-skeleton-row
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
>
|
|
23
|
+
{columns.map((column) => (
|
|
24
|
+
<td
|
|
25
|
+
class="table-skeleton__cell"
|
|
26
|
+
data-align={getTableColumnAlignment(column)}
|
|
27
|
+
data-table-column-role={column.role}
|
|
28
|
+
>
|
|
29
|
+
<span class="table-skeleton__placeholder" />
|
|
30
|
+
</td>
|
|
31
|
+
))}
|
|
32
|
+
</tr>
|
|
33
|
+
))
|
|
34
|
+
}
|
|
35
|
+
</tbody>
|
|
36
|
+
</table>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.table-skeleton {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.table-skeleton__row {
|
|
6
|
+
display: grid;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
min-height: var(--table-row-min-block-size);
|
|
9
|
+
grid-column: 1 / -1;
|
|
10
|
+
grid-template-columns: subgrid;
|
|
11
|
+
border-block-start: var(--nox-border-width) solid var(--nox-border);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.table-skeleton__cell {
|
|
15
|
+
display: grid;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.table-skeleton__cell[data-align='center'] {
|
|
22
|
+
justify-items: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.table-skeleton__cell[data-align='end'] {
|
|
26
|
+
justify-items: end;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.table[data-table-layout='index']
|
|
30
|
+
.table-skeleton__cell[data-table-column-role='primary']
|
|
31
|
+
~ .table-skeleton__cell {
|
|
32
|
+
justify-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.table-skeleton__cell:first-child {
|
|
36
|
+
padding-inline-start: var(--table-edge-padding-inline);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.table-skeleton__cell:last-child {
|
|
40
|
+
padding-inline-end: var(--table-edge-padding-inline);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.table-skeleton__placeholder {
|
|
44
|
+
inline-size: min(100%, 8rem);
|
|
45
|
+
block-size: 0.875rem;
|
|
46
|
+
border-radius: var(--nox-radius-sm);
|
|
47
|
+
background: linear-gradient(
|
|
48
|
+
90deg,
|
|
49
|
+
var(--nox-surface-muted) 0%,
|
|
50
|
+
var(--nox-surface-strong) 50%,
|
|
51
|
+
var(--nox-surface-muted) 100%
|
|
52
|
+
);
|
|
53
|
+
background-size: 200% 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.table[data-table-layout='index'] .table-skeleton__row {
|
|
57
|
+
block-size: var(--table-index-row-block-size);
|
|
58
|
+
min-height: var(--table-index-row-block-size);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
62
|
+
.table-skeleton__placeholder {
|
|
63
|
+
animation: table-skeleton-pulse 1.4s ease-in-out infinite;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes table-skeleton-pulse {
|
|
68
|
+
from {
|
|
69
|
+
background-position: 200% 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
to {
|
|
73
|
+
background-position: -200% 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@container (width < 36rem) {
|
|
78
|
+
.table-skeleton__row {
|
|
79
|
+
min-height: var(--table-row-narrow-min-block-size);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DisplayTextValue } from '../../display/contracts';
|
|
2
|
+
|
|
3
|
+
export function setTableTextCellValue(
|
|
4
|
+
cell: HTMLElement,
|
|
5
|
+
value: DisplayTextValue,
|
|
6
|
+
): void {
|
|
7
|
+
const valueNode = cell.querySelector<HTMLElement>(
|
|
8
|
+
'[data-part="text-pair-primary"]',
|
|
9
|
+
);
|
|
10
|
+
if (valueNode) valueNode.textContent = String(value);
|
|
11
|
+
}
|