@sinnstack/ui 0.0.0-stage → 0.2.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/CHANGELOG.md +15 -0
- package/LICENSE +373 -0
- package/README.md +186 -2
- package/docs/blocks.md +364 -0
- package/docs/data.md +128 -0
- package/docs/motion.md +166 -0
- package/docs/primitives.md +510 -0
- package/docs/seo.md +187 -0
- package/docs/tokens.md +122 -0
- package/package.json +141 -3
- package/scripts/check-contrast.mjs +180 -0
- package/src/blocks/BlockRenderer.astro +54 -0
- package/src/blocks/CTABanner.astro +121 -0
- package/src/blocks/CTAPair.astro +110 -0
- package/src/blocks/CardGrid.astro +167 -0
- package/src/blocks/ConsentEmbed.astro +125 -0
- package/src/blocks/ConsentManager.astro +147 -0
- package/src/blocks/ConsentScript.astro +47 -0
- package/src/blocks/ContactCard.astro +164 -0
- package/src/blocks/ContactForm.astro +224 -0
- package/src/blocks/ErrorPage.astro +242 -0
- package/src/blocks/FAQ.astro +135 -0
- package/src/blocks/FeatureGrid.astro +148 -0
- package/src/blocks/Hero.astro +171 -0
- package/src/blocks/HeroCarousel.astro +220 -0
- package/src/blocks/HighlightCards.astro +107 -0
- package/src/blocks/LocationHours.astro +311 -0
- package/src/blocks/LogoCloud.astro +135 -0
- package/src/blocks/MaintenancePage.astro +168 -0
- package/src/blocks/MediaText.astro +177 -0
- package/src/blocks/PageHeader.astro +126 -0
- package/src/blocks/ProseSection.astro +98 -0
- package/src/blocks/Reviews.astro +194 -0
- package/src/blocks/RichText.astro +57 -0
- package/src/blocks/StatsBand.astro +117 -0
- package/src/blocks/Steps.astro +141 -0
- package/src/blocks/Testimonials.astro +144 -0
- package/src/blocks/Topbar.astro +158 -0
- package/src/blocks/cms/card-grid.ts +80 -0
- package/src/blocks/cms/consent.ts +45 -0
- package/src/blocks/cms/contact-card.ts +88 -0
- package/src/blocks/cms/contact-form.ts +55 -0
- package/src/blocks/cms/cta-banner.ts +48 -0
- package/src/blocks/cms/cta-pair.ts +63 -0
- package/src/blocks/cms/data-base.ts +7 -0
- package/src/blocks/cms/data.ts +257 -0
- package/src/blocks/cms/faq.ts +70 -0
- package/src/blocks/cms/feature-grid.ts +80 -0
- package/src/blocks/cms/fixtures.ts +599 -0
- package/src/blocks/cms/hero-carousel.ts +80 -0
- package/src/blocks/cms/hero.ts +77 -0
- package/src/blocks/cms/highlight-cards.ts +76 -0
- package/src/blocks/cms/images.ts +38 -0
- package/src/blocks/cms/index.ts +87 -0
- package/src/blocks/cms/location-hours.ts +149 -0
- package/src/blocks/cms/logo-cloud.ts +62 -0
- package/src/blocks/cms/media-text.ts +44 -0
- package/src/blocks/cms/page-header.ts +49 -0
- package/src/blocks/cms/pages.ts +81 -0
- package/src/blocks/cms/prose-section.ts +45 -0
- package/src/blocks/cms/reviews.ts +101 -0
- package/src/blocks/cms/shared.ts +115 -0
- package/src/blocks/cms/stats-band.ts +61 -0
- package/src/blocks/cms/steps.ts +67 -0
- package/src/blocks/cms/testimonials.ts +80 -0
- package/src/blocks/cms/topbar.ts +64 -0
- package/src/blocks/cms/types.ts +63 -0
- package/src/blocks/consent.ts +14 -0
- package/src/blocks/icons.ts +47 -0
- package/src/blocks/index.ts +42 -0
- package/src/blocks/internal/Actions.astro +29 -0
- package/src/blocks/internal/BlockHeader.astro +45 -0
- package/src/blocks/internal/BlockShell.astro +58 -0
- package/src/blocks/internal/CarouselScript.astro +7 -0
- package/src/blocks/internal/ConsentEmbedScript.astro +7 -0
- package/src/blocks/internal/ConsentManagerScript.astro +7 -0
- package/src/blocks/internal/HoursScript.astro +7 -0
- package/src/blocks/internal/Placeholder.astro +13 -0
- package/src/blocks/internal/RichTextNode.astro +133 -0
- package/src/blocks/internal/StandaloneDocument.astro +53 -0
- package/src/blocks/internal/tina.ts +19 -0
- package/src/blocks/internal/util.ts +23 -0
- package/src/blocks/lib/consent.ts +96 -0
- package/src/blocks/lib/contact.ts +86 -0
- package/src/blocks/lib/error-pages.ts +119 -0
- package/src/blocks/lib/faq.ts +37 -0
- package/src/blocks/lib/hours.ts +201 -0
- package/src/blocks/lib/maintenance.ts +129 -0
- package/src/blocks/lib/reviews.ts +22 -0
- package/src/blocks/lib/rich-text.ts +143 -0
- package/src/blocks/lib/slug.ts +12 -0
- package/src/blocks/registry.ts +79 -0
- package/src/blocks/scripts/carousel.ts +218 -0
- package/src/blocks/scripts/consent-embed.ts +105 -0
- package/src/blocks/scripts/consent-manager.ts +112 -0
- package/src/blocks/scripts/consent-store.ts +86 -0
- package/src/blocks/scripts/error-page.ts +71 -0
- package/src/blocks/scripts/hours.ts +106 -0
- package/src/blocks/scripts/maintenance.ts +109 -0
- package/src/blocks/styles/blocks.css +1320 -0
- package/src/blocks/styles/consent.css +102 -0
- package/src/blocks/styles/faq.css +28 -0
- package/src/blocks/styles/location.css +92 -0
- package/src/blocks/styles/prose-section.css +13 -0
- package/src/blocks/styles/quotes.css +123 -0
- package/src/blocks/styles/rich-text.css +14 -0
- package/src/blocks/types.ts +283 -0
- package/src/data/ChartAxis.astro +19 -0
- package/src/data/ChartContainer.astro +151 -0
- package/src/data/ChartLegend.astro +25 -0
- package/src/data/ChartSeries.astro +14 -0
- package/src/data/ChartTable.astro +17 -0
- package/src/data/ChartTooltip.astro +20 -0
- package/src/data/Sparkline.astro +55 -0
- package/src/data/cms.ts +190 -0
- package/src/data/index.ts +10 -0
- package/src/data/lib/chart.ts +450 -0
- package/src/data/lib/render.ts +219 -0
- package/src/data/lib/scale.ts +107 -0
- package/src/data/lib/sparkline.ts +117 -0
- package/src/data/scripts/chart.ts +324 -0
- package/src/data/styles/chart.css +392 -0
- package/src/motion/Marquee.astro +90 -0
- package/src/motion/MotionProvider.astro +50 -0
- package/src/motion/PageTransitions.astro +61 -0
- package/src/motion/Parallax.astro +44 -0
- package/src/motion/ParallaxLayer.astro +31 -0
- package/src/motion/RevealOnScroll.astro +59 -0
- package/src/motion/SceneRegistry.astro +38 -0
- package/src/motion/ScrollScene.astro +81 -0
- package/src/motion/index.ts +12 -0
- package/src/motion/integration.ts +48 -0
- package/src/motion/runtime/page-transitions.ts +68 -0
- package/src/motion/runtime/runtime.ts +180 -0
- package/src/motion/runtime/scenes.ts +248 -0
- package/src/motion/runtime/types.ts +103 -0
- package/src/motion/styles/motion.css +332 -0
- package/src/motion/transitions.ts +74 -0
- package/src/motion/virtual.d.ts +4 -0
- package/src/primitives/Accordion.astro +129 -0
- package/src/primitives/Breadcrumbs.astro +50 -0
- package/src/primitives/BulletList.astro +69 -0
- package/src/primitives/Button.astro +73 -0
- package/src/primitives/ButtonGroup.astro +54 -0
- package/src/primitives/Callout.astro +137 -0
- package/src/primitives/Caption.astro +35 -0
- package/src/primitives/Card.astro +72 -0
- package/src/primitives/CardContent.astro +24 -0
- package/src/primitives/CardFooter.astro +36 -0
- package/src/primitives/CardHeader.astro +86 -0
- package/src/primitives/Checkbox.astro +38 -0
- package/src/primitives/ChoiceGroup.astro +23 -0
- package/src/primitives/Cluster.astro +49 -0
- package/src/primitives/Container.astro +44 -0
- package/src/primitives/DescriptionList.astro +83 -0
- package/src/primitives/Dialog.astro +38 -0
- package/src/primitives/Disclosure.astro +67 -0
- package/src/primitives/Divider.astro +93 -0
- package/src/primitives/Drawer.astro +33 -0
- package/src/primitives/Fieldset.astro +80 -0
- package/src/primitives/Flex.astro +64 -0
- package/src/primitives/FocusRing.astro +63 -0
- package/src/primitives/FocusTrap.astro +64 -0
- package/src/primitives/Footer.astro +155 -0
- package/src/primitives/Form.astro +68 -0
- package/src/primitives/FormDescription.astro +26 -0
- package/src/primitives/FormError.astro +106 -0
- package/src/primitives/FormField.astro +72 -0
- package/src/primitives/Grid.astro +64 -0
- package/src/primitives/Heading.astro +45 -0
- package/src/primitives/IconButton.astro +48 -0
- package/src/primitives/Image.astro +125 -0
- package/src/primitives/Input.astro +84 -0
- package/src/primitives/Label.astro +50 -0
- package/src/primitives/Link.astro +81 -0
- package/src/primitives/LinkButton.astro +66 -0
- package/src/primitives/List.astro +39 -0
- package/src/primitives/ListItem.astro +178 -0
- package/src/primitives/MediaObject.astro +66 -0
- package/src/primitives/MetricCard.astro +276 -0
- package/src/primitives/NavLink.astro +81 -0
- package/src/primitives/NavMenu.astro +109 -0
- package/src/primitives/Navbar.astro +197 -0
- package/src/primitives/Panel.astro +153 -0
- package/src/primitives/Picture.astro +167 -0
- package/src/primitives/Popover.astro +95 -0
- package/src/primitives/Prose.astro +45 -0
- package/src/primitives/Radio.astro +21 -0
- package/src/primitives/Rating.astro +135 -0
- package/src/primitives/ReducedMotion.astro +90 -0
- package/src/primitives/SegmentedControl.astro +132 -0
- package/src/primitives/Select.astro +107 -0
- package/src/primitives/Sheet.astro +45 -0
- package/src/primitives/SkipLink.astro +31 -0
- package/src/primitives/Slider.astro +186 -0
- package/src/primitives/Spacer.astro +35 -0
- package/src/primitives/Stack.astro +51 -0
- package/src/primitives/Surface.astro +70 -0
- package/src/primitives/Switch.astro +22 -0
- package/src/primitives/Table.astro +382 -0
- package/src/primitives/Tabs.astro +126 -0
- package/src/primitives/Text.astro +56 -0
- package/src/primitives/Textarea.astro +73 -0
- package/src/primitives/Thumbnail.astro +154 -0
- package/src/primitives/Toggle.astro +99 -0
- package/src/primitives/Tooltip.astro +50 -0
- package/src/primitives/VisuallyHidden.astro +29 -0
- package/src/primitives/index.ts +103 -0
- package/src/primitives/internal/AccordionScript.astro +7 -0
- package/src/primitives/internal/ChoiceField.astro +89 -0
- package/src/primitives/internal/FocusTrapScript.astro +8 -0
- package/src/primitives/internal/FormValidationScript.astro +10 -0
- package/src/primitives/internal/IndeterminateScript.astro +13 -0
- package/src/primitives/internal/ModalPanel.astro +114 -0
- package/src/primitives/internal/OverlayScript.astro +7 -0
- package/src/primitives/internal/ReducedMotionScript.astro +7 -0
- package/src/primitives/internal/SliderScript.astro +7 -0
- package/src/primitives/internal/SparklineScript.astro +7 -0
- package/src/primitives/internal/TableSortScript.astro +7 -0
- package/src/primitives/internal/TabsScript.astro +7 -0
- package/src/primitives/internal/TooltipScript.astro +7 -0
- package/src/primitives/lib/deprecate.ts +47 -0
- package/src/primitives/lib/focus-trap.ts +197 -0
- package/src/primitives/lib/focus.ts +60 -0
- package/src/primitives/lib/image-plan.ts +82 -0
- package/src/primitives/lib/image.ts +129 -0
- package/src/primitives/lib/motion.ts +68 -0
- package/src/primitives/lib/slider.ts +170 -0
- package/src/primitives/scripts/accordion.ts +123 -0
- package/src/primitives/scripts/form-validation.ts +225 -0
- package/src/primitives/scripts/overlay.ts +71 -0
- package/src/primitives/scripts/reduced-motion.ts +59 -0
- package/src/primitives/scripts/slider.ts +150 -0
- package/src/primitives/scripts/sparkline.ts +131 -0
- package/src/primitives/scripts/table-sort.ts +68 -0
- package/src/primitives/scripts/tabs.ts +151 -0
- package/src/primitives/scripts/tooltip.ts +28 -0
- package/src/primitives/styles/a11y.css +104 -0
- package/src/primitives/styles/accordion.css +53 -0
- package/src/primitives/styles/breadcrumbs.css +59 -0
- package/src/primitives/styles/bullet-list.css +89 -0
- package/src/primitives/styles/button.css +237 -0
- package/src/primitives/styles/choice.css +164 -0
- package/src/primitives/styles/cluster.css +24 -0
- package/src/primitives/styles/container.css +19 -0
- package/src/primitives/styles/data.css +849 -0
- package/src/primitives/styles/disclosure.css +140 -0
- package/src/primitives/styles/divider.css +50 -0
- package/src/primitives/styles/flex.css +42 -0
- package/src/primitives/styles/form.css +241 -0
- package/src/primitives/styles/grid.css +36 -0
- package/src/primitives/styles/media.css +247 -0
- package/src/primitives/styles/nav.css +792 -0
- package/src/primitives/styles/overlay.css +362 -0
- package/src/primitives/styles/prose.css +146 -0
- package/src/primitives/styles/scale.css +175 -0
- package/src/primitives/styles/segmented.css +165 -0
- package/src/primitives/styles/slider.css +170 -0
- package/src/primitives/styles/spacer.css +17 -0
- package/src/primitives/styles/stack.css +25 -0
- package/src/primitives/styles/surface.css +403 -0
- package/src/primitives/styles/tabs.css +223 -0
- package/src/primitives/styles/typography.css +144 -0
- package/src/primitives/styles/utilities.css +24 -0
- package/src/primitives/types.ts +385 -0
- package/src/primitives/utils.ts +254 -0
- package/src/seo/JSONLD.astro +35 -0
- package/src/seo/SEOHead.astro +47 -0
- package/src/seo/cms.ts +80 -0
- package/src/seo/index.ts +10 -0
- package/src/seo/integration.ts +231 -0
- package/src/seo/lib/jsonld.ts +334 -0
- package/src/seo/lib/meta.ts +205 -0
- package/src/seo/lib/redirects.ts +283 -0
- package/src/seo/lib/robots.ts +33 -0
- package/src/seo/lib/rss.ts +98 -0
- package/src/seo/lib/sitemap.ts +105 -0
- package/src/seo/lib/url.ts +68 -0
- package/src/tokens/base.css +71 -0
- package/src/tokens/tokens.css +210 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @sinnstack/ui/data chart styles. Generated by scripts/generate-css.mjs: edit the generator.
|
|
3
|
+
* Specs (dataviz method): 2px lines with round joins; bars ≤ 24px with a 4px rounded data end and a
|
|
4
|
+
* square baseline; 2px surface gaps and rings instead of strokes; 10% area washes; solid 1px
|
|
5
|
+
* recessive gridlines; text in text tokens, never in series colors.
|
|
6
|
+
*/
|
|
7
|
+
/* Same order as tokens.css: whichever stylesheet loads first fixes the layer order. */
|
|
8
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
9
|
+
|
|
10
|
+
@layer sinn.data {
|
|
11
|
+
:where(.sinn-chart) {
|
|
12
|
+
--sinn-p-plot-h: 16rem;
|
|
13
|
+
--sinn-p-y-axis: calc(5ch + 0.75rem);
|
|
14
|
+
--sinn-p-bar: 8%;
|
|
15
|
+
--sinn-p-surface: var(--sinn-color-surface);
|
|
16
|
+
container: sinn-chart / inline-size;
|
|
17
|
+
display: grid;
|
|
18
|
+
gap: var(--sinn-space-s);
|
|
19
|
+
min-inline-size: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
color: var(--sinn-color-text);
|
|
22
|
+
}
|
|
23
|
+
:where(.sinn-chart[data-background="raised"]) { --sinn-p-surface: var(--sinn-color-surface-raised); }
|
|
24
|
+
:where(.sinn-chart[data-background="subtle"]) { --sinn-p-surface: var(--sinn-color-surface-subtle); }
|
|
25
|
+
:where(.sinn-chart[data-height="s"]) { --sinn-p-plot-h: 10rem; }
|
|
26
|
+
:where(.sinn-chart[data-height="l"]) { --sinn-p-plot-h: 22rem; }
|
|
27
|
+
:where(.sinn-chart[data-height="xl"]) { --sinn-p-plot-h: 28rem; }
|
|
28
|
+
@container sinn-chart (max-width: 24rem) {
|
|
29
|
+
:where(.sinn-chart__plot) { --sinn-p-plot-h-narrow: 0.8; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ---------- Header, footer ---------- */
|
|
33
|
+
:where(.sinn-chart__header) { display: grid; gap: var(--sinn-space-3xs); }
|
|
34
|
+
:where(.sinn-chart__title) { margin: 0; text-wrap: balance; }
|
|
35
|
+
:where(.sinn-chart__description) { margin: 0; color: var(--sinn-color-text-muted); font-size: var(--sinn-text-s); text-wrap: pretty; }
|
|
36
|
+
:where(.sinn-chart__source) { margin: 0; color: var(--sinn-color-text-muted); font-size: var(--sinn-text-xs); }
|
|
37
|
+
:where(.sinn-chart__source a) { color: inherit; }
|
|
38
|
+
:where(.sinn-chart__toolbar) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sinn-space-xs) var(--sinn-space-m); }
|
|
39
|
+
|
|
40
|
+
/* ---------- Plot grid: y labels | plot, then x labels. Fixed heights include the x-axis band. ---------- */
|
|
41
|
+
:where(.sinn-chart__plot) {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: var(--sinn-p-y-axis) minmax(0, 1fr);
|
|
45
|
+
grid-template-rows: auto calc(var(--sinn-p-plot-h) * var(--sinn-p-plot-h-narrow, 1)) auto auto;
|
|
46
|
+
grid-template-areas: 'ytitle .' 'yaxis plot' '. xaxis' '. xtitle';
|
|
47
|
+
/* Time runs left to right even on right-to-left pages. */
|
|
48
|
+
direction: ltr;
|
|
49
|
+
padding-inline-end: var(--sinn-space-xs);
|
|
50
|
+
color: var(--sinn-color-text-muted);
|
|
51
|
+
font-size: var(--sinn-text-xs);
|
|
52
|
+
font-variant-numeric: tabular-nums;
|
|
53
|
+
line-height: 1.2;
|
|
54
|
+
}
|
|
55
|
+
:where(.sinn-chart__layer) { grid-area: plot; display: block; inline-size: 100%; block-size: 100%; overflow: visible; }
|
|
56
|
+
:where(.sinn-chart__y-axis) { grid-area: yaxis; min-inline-size: 0; }
|
|
57
|
+
:where(.sinn-chart__x-axis) { grid-area: xaxis; block-size: 1.9em; }
|
|
58
|
+
:where(.sinn-chart__ticks) { display: block; overflow: visible; }
|
|
59
|
+
:where(.sinn-chart__ticks text) { fill: currentColor; font-size: inherit; }
|
|
60
|
+
:where(.sinn-chart__y-axis text) { text-anchor: end; }
|
|
61
|
+
:where(.sinn-chart__axis-title) { margin: 0; color: var(--sinn-color-text-muted); font-size: var(--sinn-text-xs); font-weight: var(--sinn-weight-semibold); }
|
|
62
|
+
:where(.sinn-chart__axis-title[data-axis="y"]) { grid-area: ytitle; padding-block-end: var(--sinn-space-2xs); white-space: nowrap; }
|
|
63
|
+
:where(.sinn-chart__axis-title[data-axis="x"]) { grid-area: xtitle; text-align: center; }
|
|
64
|
+
:where(.sinn-chart__grid line) { stroke: var(--sinn-color-chart-grid); stroke-width: 1px; shape-rendering: crispEdges; }
|
|
65
|
+
:where(.sinn-chart__grid .sinn-chart__baseline) { stroke: var(--sinn-color-chart-axis); }
|
|
66
|
+
|
|
67
|
+
/* ---------- Marks ---------- */
|
|
68
|
+
:where([data-slot="1"]) { --sinn-p-c: var(--sinn-color-series-1); }
|
|
69
|
+
:where([data-slot="2"]) { --sinn-p-c: var(--sinn-color-series-2); }
|
|
70
|
+
:where([data-slot="3"]) { --sinn-p-c: var(--sinn-color-series-3); }
|
|
71
|
+
:where([data-slot="4"]) { --sinn-p-c: var(--sinn-color-series-4); }
|
|
72
|
+
:where([data-slot="5"]) { --sinn-p-c: var(--sinn-color-series-5); }
|
|
73
|
+
:where([data-slot="6"]) { --sinn-p-c: var(--sinn-color-series-6); }
|
|
74
|
+
:where([data-slot="7"]) { --sinn-p-c: var(--sinn-color-series-7); }
|
|
75
|
+
:where([data-slot="8"]) { --sinn-p-c: var(--sinn-color-series-8); }
|
|
76
|
+
:where([data-slot="muted"]) { --sinn-p-c: var(--sinn-color-data-muted); }
|
|
77
|
+
:where(.sinn-chart__paths) { overflow: visible; }
|
|
78
|
+
:where(.sinn-chart__line) { fill: none; stroke: var(--sinn-p-c); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
|
|
79
|
+
:where(.sinn-chart__area) { fill: var(--sinn-p-c); fill-opacity: 0.1; stroke: none; }
|
|
80
|
+
/* Dots: r 4 (8px) with a 2px ring in the surface color (stroke 4px, painted under the fill). */
|
|
81
|
+
:where(.sinn-chart__dot, .sinn-chart__hover-dot) { fill: var(--sinn-p-c); stroke: var(--sinn-p-surface); stroke-width: 4px; paint-order: stroke; }
|
|
82
|
+
:where(.sinn-chart__bar, .sinn-chart__gap) {
|
|
83
|
+
width: min(24px, var(--sinn-p-bar));
|
|
84
|
+
transform-box: fill-box;
|
|
85
|
+
transform: translateX(calc(-50% + var(--sinn-p-off, 0) * (100% + 2px)));
|
|
86
|
+
}
|
|
87
|
+
:where(.sinn-chart__bar) { fill: var(--sinn-p-c); }
|
|
88
|
+
:where(.sinn-chart__bar[data-round="top"]) { clip-path: inset(0 round 4px 4px 0 0); }
|
|
89
|
+
:where(.sinn-chart__bar[data-round="bottom"]) { clip-path: inset(0 round 0 0 4px 4px); }
|
|
90
|
+
:where(.sinn-chart__gap) { fill: var(--sinn-p-surface); transform: translate(calc(-50% + var(--sinn-p-off, 0) * (100% + 2px)), -50%); }
|
|
91
|
+
:where(.sinn-chart__marks[data-hovering] .sinn-chart__bar:not([data-on]), .sinn-chart__marks[data-hovering] .sinn-chart__gap:not([data-on])) { opacity: 0.45; }
|
|
92
|
+
|
|
93
|
+
/* Hidden series (legend toggles). */
|
|
94
|
+
:where(.sinn-chart [data-hidden]) { display: none; }
|
|
95
|
+
|
|
96
|
+
/* ---------- Interaction layer ---------- */
|
|
97
|
+
:where(.sinn-chart__interact) { position: relative; cursor: crosshair; touch-action: pan-y; border-radius: var(--sinn-radius-s); }
|
|
98
|
+
:where(.sinn-chart__interact:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 6px; }
|
|
99
|
+
:where(.sinn-chart__hover) { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
|
|
100
|
+
:where(.sinn-chart__crosshair) { stroke: var(--sinn-color-text-muted); stroke-width: 1px; shape-rendering: crispEdges; }
|
|
101
|
+
:where(.sinn-chart__band) { fill: var(--sinn-color-text); fill-opacity: 0.05; }
|
|
102
|
+
|
|
103
|
+
:where(.sinn-chart-tooltip) {
|
|
104
|
+
position: absolute;
|
|
105
|
+
inset-block-start: var(--sinn-space-2xs);
|
|
106
|
+
z-index: 5;
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
min-inline-size: 9rem;
|
|
109
|
+
max-inline-size: min(18rem, 80cqi);
|
|
110
|
+
padding: var(--sinn-space-xs) var(--sinn-space-s);
|
|
111
|
+
border: 1px solid var(--sinn-color-border);
|
|
112
|
+
border-radius: var(--sinn-radius-m);
|
|
113
|
+
background-color: var(--sinn-color-surface-raised);
|
|
114
|
+
box-shadow: var(--sinn-shadow-m);
|
|
115
|
+
color: var(--sinn-color-text);
|
|
116
|
+
font-size: var(--sinn-text-s);
|
|
117
|
+
line-height: 1.35;
|
|
118
|
+
text-align: start;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
transform: translateX(12px);
|
|
121
|
+
}
|
|
122
|
+
:where(.sinn-chart-tooltip[data-edge="end"]) { transform: translateX(calc(-100% - 12px)); }
|
|
123
|
+
:where(.sinn-chart-tooltip__title) { margin: 0 0 var(--sinn-space-3xs); color: var(--sinn-color-text-muted); font-size: var(--sinn-text-xs); font-weight: var(--sinn-weight-semibold); }
|
|
124
|
+
:where(.sinn-chart-tooltip__rows) { display: grid; gap: 0.15rem; margin: 0; padding: 0; list-style: none; }
|
|
125
|
+
:where(.sinn-chart-tooltip__rows li) { display: grid; grid-template-columns: 0.875rem auto 1fr; align-items: center; column-gap: 0.4rem; }
|
|
126
|
+
:where(.sinn-chart-tooltip__rows li[data-current]) { font-weight: var(--sinn-weight-semibold); }
|
|
127
|
+
/* Line keys, not boxes. */
|
|
128
|
+
:where(.sinn-chart-tooltip__key) { inline-size: 0.875rem; block-size: 2px; border-radius: 1px; background-color: var(--sinn-p-c); }
|
|
129
|
+
:where(.sinn-chart-tooltip__value) { font-weight: var(--sinn-weight-semibold); font-variant-numeric: tabular-nums; }
|
|
130
|
+
:where(.sinn-chart-tooltip__label) { color: var(--sinn-color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
131
|
+
:where(.sinn-chart-tooltip__total) { margin: var(--sinn-space-3xs) 0 0; padding-block-start: var(--sinn-space-3xs); border-block-start: 1px solid var(--sinn-color-border); color: var(--sinn-color-text-muted); font-size: var(--sinn-text-xs); }
|
|
132
|
+
:where(.sinn-chart-tooltip__total strong) { color: var(--sinn-color-text); font-variant-numeric: tabular-nums; }
|
|
133
|
+
|
|
134
|
+
/* ---------- Legend ---------- */
|
|
135
|
+
:where(.sinn-chart-legend) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sinn-space-2xs) var(--sinn-space-s); }
|
|
136
|
+
:where(.sinn-chart-legend__list) { display: flex; flex-wrap: wrap; gap: var(--sinn-space-3xs) var(--sinn-space-s); margin: 0; padding: 0; list-style: none; }
|
|
137
|
+
:where(.sinn-chart-legend__item) {
|
|
138
|
+
display: inline-flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: 0.45rem;
|
|
141
|
+
min-block-size: 1.75rem;
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0 0.4rem;
|
|
144
|
+
border: 0;
|
|
145
|
+
border-radius: var(--sinn-radius-s);
|
|
146
|
+
background: none;
|
|
147
|
+
color: var(--sinn-color-text);
|
|
148
|
+
font: inherit;
|
|
149
|
+
font-size: var(--sinn-text-s);
|
|
150
|
+
}
|
|
151
|
+
:where(button.sinn-chart-legend__item) { cursor: pointer; }
|
|
152
|
+
:where(button.sinn-chart-legend__item:hover) { background-color: var(--sinn-color-surface-subtle); }
|
|
153
|
+
:where(button.sinn-chart-legend__item:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 1px; }
|
|
154
|
+
:where(.sinn-chart-legend__item[aria-pressed="false"]) { color: var(--sinn-color-text-muted); }
|
|
155
|
+
:where(.sinn-chart-legend__item[aria-pressed="false"] .sinn-chart-legend__label) { text-decoration: line-through; text-decoration-thickness: 1px; }
|
|
156
|
+
:where(.sinn-chart-legend__item[aria-pressed="false"] .sinn-chart-legend__key) { background-color: transparent; box-shadow: inset 0 0 0 1.5px var(--sinn-p-c); }
|
|
157
|
+
/* Keys mirror the mark: a short line for lines, a rounded square for bars and areas. */
|
|
158
|
+
:where(.sinn-chart-legend__key) { display: inline-block; flex-shrink: 0; background-color: var(--sinn-p-c); }
|
|
159
|
+
:where(.sinn-chart-legend__key[data-key="line"]) { inline-size: 1rem; block-size: 0.1875rem; border-radius: 2px; }
|
|
160
|
+
:where(.sinn-chart-legend__key[data-key="rect"]) { inline-size: 0.75rem; block-size: 0.75rem; border-radius: 3px; }
|
|
161
|
+
:where(.sinn-chart-legend__reset) {
|
|
162
|
+
min-block-size: 1.75rem;
|
|
163
|
+
padding: 0 0.5rem;
|
|
164
|
+
border: 1px solid var(--sinn-color-border);
|
|
165
|
+
border-radius: var(--sinn-radius-s);
|
|
166
|
+
background: none;
|
|
167
|
+
color: var(--sinn-color-accent-text);
|
|
168
|
+
font: inherit;
|
|
169
|
+
font-size: var(--sinn-text-xs);
|
|
170
|
+
font-weight: var(--sinn-weight-semibold);
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
}
|
|
173
|
+
:where(.sinn-chart-legend__reset:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 1px; }
|
|
174
|
+
|
|
175
|
+
/* ---------- Table view ---------- */
|
|
176
|
+
:where(.sinn-chart__data) { font-size: var(--sinn-text-s); }
|
|
177
|
+
:where(.sinn-chart__data > summary) { inline-size: fit-content; padding: 0.25rem 0.1rem; color: var(--sinn-color-accent-text); font-weight: var(--sinn-weight-semibold); cursor: pointer; }
|
|
178
|
+
:where(.sinn-chart__data > summary:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 2px; border-radius: var(--sinn-radius-s); }
|
|
179
|
+
:where(.sinn-chart__data[open] > summary) { margin-block-end: var(--sinn-space-xs); }
|
|
180
|
+
:where(.sinn-chart-table) { display: grid; justify-items: start; gap: var(--sinn-space-xs); }
|
|
181
|
+
:where(.sinn-chart-table__scroll) { inline-size: 100%; max-block-size: 24rem; overflow: auto; border: 1px solid var(--sinn-color-border); border-radius: var(--sinn-radius-m); }
|
|
182
|
+
:where(.sinn-chart-table__scroll:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 2px; }
|
|
183
|
+
:where(.sinn-chart-table table) { inline-size: 100%; border-collapse: collapse; font-size: var(--sinn-text-s); }
|
|
184
|
+
:where(.sinn-chart-table caption) { padding: var(--sinn-space-xs) var(--sinn-space-s); text-align: start; font-weight: var(--sinn-weight-semibold); }
|
|
185
|
+
:where(.sinn-chart-table th, .sinn-chart-table td) { padding: 0.4rem var(--sinn-space-s); border-block-end: 1px solid var(--sinn-color-border-subtle); text-align: start; white-space: nowrap; }
|
|
186
|
+
:where(.sinn-chart-table thead th) { position: sticky; inset-block-start: 0; background-color: var(--sinn-color-surface-subtle); color: var(--sinn-color-text-muted); font-size: var(--sinn-text-xs); font-weight: var(--sinn-weight-semibold); }
|
|
187
|
+
:where(.sinn-chart-table tbody th) { font-weight: var(--sinn-weight-regular); }
|
|
188
|
+
:where(.sinn-chart-table [data-numeric]) { text-align: end; font-variant-numeric: tabular-nums; }
|
|
189
|
+
:where(.sinn-chart-table tbody tr:last-child > *) { border-block-end: 0; }
|
|
190
|
+
:where(.sinn-chart-table__download) { color: var(--sinn-color-accent-text); font-size: var(--sinn-text-s); font-weight: var(--sinn-weight-semibold); }
|
|
191
|
+
|
|
192
|
+
/* ---------- States: loading, refetching, empty, error ---------- */
|
|
193
|
+
:where(.sinn-chart__state) {
|
|
194
|
+
display: grid;
|
|
195
|
+
place-content: center;
|
|
196
|
+
justify-items: center;
|
|
197
|
+
gap: var(--sinn-space-xs);
|
|
198
|
+
min-block-size: calc(var(--sinn-p-plot-h) + 2.5rem);
|
|
199
|
+
padding: var(--sinn-space-m);
|
|
200
|
+
border: 1px dashed var(--sinn-color-border);
|
|
201
|
+
border-radius: var(--sinn-radius-m);
|
|
202
|
+
color: var(--sinn-color-text-muted);
|
|
203
|
+
font-size: var(--sinn-text-s);
|
|
204
|
+
text-align: center;
|
|
205
|
+
}
|
|
206
|
+
:where(.sinn-chart__state > svg) { inline-size: 1.5rem; block-size: 1.5rem; }
|
|
207
|
+
:where(.sinn-chart__state[data-kind="error"]) { border-style: solid; border-color: var(--sinn-color-danger-soft); background-color: var(--sinn-color-danger-soft); color: var(--sinn-color-danger-text); }
|
|
208
|
+
:where(.sinn-chart__state p) { margin: 0; }
|
|
209
|
+
:where(.sinn-chart__skeleton) {
|
|
210
|
+
min-block-size: calc(var(--sinn-p-plot-h) + 2.5rem);
|
|
211
|
+
border-radius: var(--sinn-radius-m);
|
|
212
|
+
background: linear-gradient(90deg, var(--sinn-color-skeleton) 0%, var(--sinn-color-skeleton-highlight, var(--sinn-color-surface-subtle)) 50%, var(--sinn-color-skeleton) 100%) 0 0 / 200% 100%;
|
|
213
|
+
animation: sinn-chart-shimmer calc(1.6s / max(var(--sinn-motion-scale), 0.001)) linear infinite;
|
|
214
|
+
}
|
|
215
|
+
:where(.sinn-chart[data-state="refetching"] .sinn-chart__body) { opacity: 0.55; transition: opacity var(--sinn-duration-fast) linear; }
|
|
216
|
+
|
|
217
|
+
/* ---------- Sparkline ---------- */
|
|
218
|
+
:where(.sinn-spark) {
|
|
219
|
+
--sinn-p-c: var(--sinn-color-data-muted);
|
|
220
|
+
position: relative;
|
|
221
|
+
display: inline-block;
|
|
222
|
+
inline-size: 5em;
|
|
223
|
+
block-size: 1.1em;
|
|
224
|
+
vertical-align: -0.2em;
|
|
225
|
+
/* The end dot sits on the edge: keep it off the next word. */
|
|
226
|
+
margin-inline: 0.15em 0.45em;
|
|
227
|
+
color: var(--sinn-color-text);
|
|
228
|
+
}
|
|
229
|
+
:where(.sinn-spark[data-size]) { margin-inline: 0; }
|
|
230
|
+
:where(.sinn-spark[data-size="s"]) { display: block; inline-size: 6rem; block-size: 1.75rem; }
|
|
231
|
+
:where(.sinn-spark[data-size="m"]) { display: block; inline-size: 9rem; block-size: 2.5rem; }
|
|
232
|
+
:where(.sinn-spark[data-size="fill"]) { display: block; inline-size: 100%; block-size: 3rem; }
|
|
233
|
+
:where(.sinn-spark__svg) { display: block; overflow: visible; }
|
|
234
|
+
:where(.sinn-spark__line) { fill: none; stroke: var(--sinn-p-c); stroke-width: 1.5px; stroke-linejoin: round; stroke-linecap: round; }
|
|
235
|
+
:where(.sinn-spark__area) { fill: var(--sinn-p-c); fill-opacity: 0.12; }
|
|
236
|
+
:where(.sinn-spark__bar) { fill: var(--sinn-p-c); }
|
|
237
|
+
:where(.sinn-spark__bar[data-highlight], .sinn-spark__dot) { fill: var(--sinn-color-accent); }
|
|
238
|
+
:where(.sinn-spark__dot, .sinn-spark__hover-dot) { stroke: var(--sinn-p-surface, var(--sinn-color-surface)); stroke-width: 3px; paint-order: stroke; }
|
|
239
|
+
:where(.sinn-spark__hover-dot) { fill: var(--sinn-color-text); }
|
|
240
|
+
:where(.sinn-spark__crosshair) { stroke: var(--sinn-color-text-muted); stroke-width: 1px; shape-rendering: crispEdges; }
|
|
241
|
+
/* A target is a threshold, so here a dash is the right signal. */
|
|
242
|
+
:where(.sinn-spark__ref) { stroke: var(--sinn-color-text-muted); stroke-width: 1px; stroke-dasharray: 3 3; }
|
|
243
|
+
:where(.sinn-spark[data-sinn-spark]) { cursor: crosshair; touch-action: pan-y; }
|
|
244
|
+
:where(.sinn-spark[data-sinn-spark]:focus-visible) { outline: var(--sinn-focus-width) solid var(--sinn-color-focus); outline-offset: 3px; border-radius: 2px; }
|
|
245
|
+
:where(.sinn-spark__tip) { inset-block-start: auto; inset-block-end: calc(100% + 6px); min-inline-size: 0; white-space: nowrap; padding: 0.2rem 0.45rem; font-size: var(--sinn-text-xs); }
|
|
246
|
+
|
|
247
|
+
/* ---------- Forced colors & print: identity without hue ---------- */
|
|
248
|
+
@media (forced-colors: active) {
|
|
249
|
+
:where(.sinn-chart__line, .sinn-spark__line) { stroke: CanvasText; }
|
|
250
|
+
:where(.sinn-chart__line[data-slot="2"]) { stroke-dasharray: 8 4; }
|
|
251
|
+
:where(.sinn-chart__line[data-slot="3"]) { stroke-dasharray: 2 4; }
|
|
252
|
+
:where(.sinn-chart__line[data-slot="4"]) { stroke-dasharray: 12 4 2 4; }
|
|
253
|
+
:where(.sinn-chart__bar, .sinn-chart__dot, .sinn-chart__hover-dot, .sinn-spark__bar, .sinn-spark__dot) { fill: CanvasText; }
|
|
254
|
+
:where(.sinn-chart__bar[data-slot="2"], .sinn-chart__bar[data-slot="4"], .sinn-chart__bar[data-slot="6"], .sinn-chart__bar[data-slot="8"]) { fill: Canvas; stroke: CanvasText; stroke-width: 1.5px; }
|
|
255
|
+
:where(.sinn-chart__area) { fill: CanvasText; fill-opacity: 0.08; }
|
|
256
|
+
:where(.sinn-chart-legend__key) { forced-color-adjust: none; background-color: CanvasText; }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@keyframes sinn-chart-shimmer {
|
|
260
|
+
to { background-position: -200% 0; }
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* ---------- Generated ---------- */
|
|
264
|
+
:where(.sinn-chart[data-y-ch="2"]) { --sinn-p-y-axis: calc(2ch + 0.75rem); }
|
|
265
|
+
:where(.sinn-chart[data-y-ch="3"]) { --sinn-p-y-axis: calc(3ch + 0.75rem); }
|
|
266
|
+
:where(.sinn-chart[data-y-ch="4"]) { --sinn-p-y-axis: calc(4ch + 0.75rem); }
|
|
267
|
+
:where(.sinn-chart[data-y-ch="5"]) { --sinn-p-y-axis: calc(5ch + 0.75rem); }
|
|
268
|
+
:where(.sinn-chart[data-y-ch="6"]) { --sinn-p-y-axis: calc(6ch + 0.75rem); }
|
|
269
|
+
:where(.sinn-chart[data-y-ch="7"]) { --sinn-p-y-axis: calc(7ch + 0.75rem); }
|
|
270
|
+
:where(.sinn-chart[data-y-ch="8"]) { --sinn-p-y-axis: calc(8ch + 0.75rem); }
|
|
271
|
+
:where(.sinn-chart[data-y-ch="9"]) { --sinn-p-y-axis: calc(9ch + 0.75rem); }
|
|
272
|
+
:where(.sinn-chart[data-y-ch="10"]) { --sinn-p-y-axis: calc(10ch + 0.75rem); }
|
|
273
|
+
:where(.sinn-chart[data-y-ch="11"]) { --sinn-p-y-axis: calc(11ch + 0.75rem); }
|
|
274
|
+
:where(.sinn-chart[data-y-ch="12"]) { --sinn-p-y-axis: calc(12ch + 0.75rem); }
|
|
275
|
+
:where(.sinn-chart[data-y-ch="13"]) { --sinn-p-y-axis: calc(13ch + 0.75rem); }
|
|
276
|
+
:where(.sinn-chart[data-y-ch="14"]) { --sinn-p-y-axis: calc(14ch + 0.75rem); }
|
|
277
|
+
:where(.sinn-chart[data-bar-pct="1"]) { --sinn-p-bar: 1%; }
|
|
278
|
+
:where(.sinn-chart[data-bar-pct="2"]) { --sinn-p-bar: 2%; }
|
|
279
|
+
:where(.sinn-chart[data-bar-pct="3"]) { --sinn-p-bar: 3%; }
|
|
280
|
+
:where(.sinn-chart[data-bar-pct="4"]) { --sinn-p-bar: 4%; }
|
|
281
|
+
:where(.sinn-chart[data-bar-pct="5"]) { --sinn-p-bar: 5%; }
|
|
282
|
+
:where(.sinn-chart[data-bar-pct="6"]) { --sinn-p-bar: 6%; }
|
|
283
|
+
:where(.sinn-chart[data-bar-pct="7"]) { --sinn-p-bar: 7%; }
|
|
284
|
+
:where(.sinn-chart[data-bar-pct="8"]) { --sinn-p-bar: 8%; }
|
|
285
|
+
:where(.sinn-chart[data-bar-pct="9"]) { --sinn-p-bar: 9%; }
|
|
286
|
+
:where(.sinn-chart[data-bar-pct="10"]) { --sinn-p-bar: 10%; }
|
|
287
|
+
:where(.sinn-chart[data-bar-pct="11"]) { --sinn-p-bar: 11%; }
|
|
288
|
+
:where(.sinn-chart[data-bar-pct="12"]) { --sinn-p-bar: 12%; }
|
|
289
|
+
:where(.sinn-chart[data-bar-pct="13"]) { --sinn-p-bar: 13%; }
|
|
290
|
+
:where(.sinn-chart[data-bar-pct="14"]) { --sinn-p-bar: 14%; }
|
|
291
|
+
:where(.sinn-chart[data-bar-pct="15"]) { --sinn-p-bar: 15%; }
|
|
292
|
+
:where(.sinn-chart[data-bar-pct="16"]) { --sinn-p-bar: 16%; }
|
|
293
|
+
:where(.sinn-chart[data-bar-pct="17"]) { --sinn-p-bar: 17%; }
|
|
294
|
+
:where(.sinn-chart[data-bar-pct="18"]) { --sinn-p-bar: 18%; }
|
|
295
|
+
:where(.sinn-chart[data-bar-pct="19"]) { --sinn-p-bar: 19%; }
|
|
296
|
+
:where(.sinn-chart[data-bar-pct="20"]) { --sinn-p-bar: 20%; }
|
|
297
|
+
:where(.sinn-chart[data-bar-pct="21"]) { --sinn-p-bar: 21%; }
|
|
298
|
+
:where(.sinn-chart[data-bar-pct="22"]) { --sinn-p-bar: 22%; }
|
|
299
|
+
:where(.sinn-chart[data-bar-pct="23"]) { --sinn-p-bar: 23%; }
|
|
300
|
+
:where(.sinn-chart[data-bar-pct="24"]) { --sinn-p-bar: 24%; }
|
|
301
|
+
:where(.sinn-chart[data-bar-pct="25"]) { --sinn-p-bar: 25%; }
|
|
302
|
+
:where(.sinn-chart[data-bar-pct="26"]) { --sinn-p-bar: 26%; }
|
|
303
|
+
:where(.sinn-chart[data-bar-pct="27"]) { --sinn-p-bar: 27%; }
|
|
304
|
+
:where(.sinn-chart[data-bar-pct="28"]) { --sinn-p-bar: 28%; }
|
|
305
|
+
:where(.sinn-chart[data-bar-pct="29"]) { --sinn-p-bar: 29%; }
|
|
306
|
+
:where(.sinn-chart[data-bar-pct="30"]) { --sinn-p-bar: 30%; }
|
|
307
|
+
:where(.sinn-chart[data-bar-pct="31"]) { --sinn-p-bar: 31%; }
|
|
308
|
+
:where(.sinn-chart[data-bar-pct="32"]) { --sinn-p-bar: 32%; }
|
|
309
|
+
:where(.sinn-chart[data-bar-pct="33"]) { --sinn-p-bar: 33%; }
|
|
310
|
+
:where(.sinn-chart[data-bar-pct="34"]) { --sinn-p-bar: 34%; }
|
|
311
|
+
:where(.sinn-chart[data-bar-pct="35"]) { --sinn-p-bar: 35%; }
|
|
312
|
+
:where(.sinn-chart[data-bar-pct="36"]) { --sinn-p-bar: 36%; }
|
|
313
|
+
:where(.sinn-chart[data-bar-pct="37"]) { --sinn-p-bar: 37%; }
|
|
314
|
+
:where(.sinn-chart[data-bar-pct="38"]) { --sinn-p-bar: 38%; }
|
|
315
|
+
:where(.sinn-chart[data-bar-pct="39"]) { --sinn-p-bar: 39%; }
|
|
316
|
+
:where(.sinn-chart[data-bar-pct="40"]) { --sinn-p-bar: 40%; }
|
|
317
|
+
:where(.sinn-chart[data-bar-pct="41"]) { --sinn-p-bar: 41%; }
|
|
318
|
+
:where(.sinn-chart[data-bar-pct="42"]) { --sinn-p-bar: 42%; }
|
|
319
|
+
:where(.sinn-chart[data-bar-pct="43"]) { --sinn-p-bar: 43%; }
|
|
320
|
+
:where(.sinn-chart[data-bar-pct="44"]) { --sinn-p-bar: 44%; }
|
|
321
|
+
:where(.sinn-chart[data-bar-pct="45"]) { --sinn-p-bar: 45%; }
|
|
322
|
+
:where(.sinn-chart[data-bar-pct="46"]) { --sinn-p-bar: 46%; }
|
|
323
|
+
:where(.sinn-chart[data-bar-pct="47"]) { --sinn-p-bar: 47%; }
|
|
324
|
+
:where(.sinn-chart[data-bar-pct="48"]) { --sinn-p-bar: 48%; }
|
|
325
|
+
:where(.sinn-chart[data-bar-pct="49"]) { --sinn-p-bar: 49%; }
|
|
326
|
+
:where(.sinn-chart[data-bar-pct="50"]) { --sinn-p-bar: 50%; }
|
|
327
|
+
:where(.sinn-chart[data-bar-pct="51"]) { --sinn-p-bar: 51%; }
|
|
328
|
+
:where(.sinn-chart[data-bar-pct="52"]) { --sinn-p-bar: 52%; }
|
|
329
|
+
:where(.sinn-chart[data-bar-pct="53"]) { --sinn-p-bar: 53%; }
|
|
330
|
+
:where(.sinn-chart[data-bar-pct="54"]) { --sinn-p-bar: 54%; }
|
|
331
|
+
:where(.sinn-chart[data-bar-pct="55"]) { --sinn-p-bar: 55%; }
|
|
332
|
+
:where(.sinn-chart[data-bar-pct="56"]) { --sinn-p-bar: 56%; }
|
|
333
|
+
:where(.sinn-chart[data-bar-pct="57"]) { --sinn-p-bar: 57%; }
|
|
334
|
+
:where(.sinn-chart[data-bar-pct="58"]) { --sinn-p-bar: 58%; }
|
|
335
|
+
:where(.sinn-chart[data-bar-pct="59"]) { --sinn-p-bar: 59%; }
|
|
336
|
+
:where(.sinn-chart[data-bar-pct="60"]) { --sinn-p-bar: 60%; }
|
|
337
|
+
:where([data-offset="-1.5"]) { --sinn-p-off: -1.5; }
|
|
338
|
+
:where([data-offset="-1"]) { --sinn-p-off: -1; }
|
|
339
|
+
:where([data-offset="-0.5"]) { --sinn-p-off: -0.5; }
|
|
340
|
+
:where([data-offset="0"]) { --sinn-p-off: 0; }
|
|
341
|
+
:where([data-offset="0.5"]) { --sinn-p-off: 0.5; }
|
|
342
|
+
:where([data-offset="1"]) { --sinn-p-off: 1; }
|
|
343
|
+
:where([data-offset="1.5"]) { --sinn-p-off: 1.5; }
|
|
344
|
+
@container sinn-chart (max-width: 24rem) {
|
|
345
|
+
:where(.sinn-chart__x-axis[data-step-xs="2"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-xs="2"] [data-tier="1"]) { display: none; }
|
|
346
|
+
:where(.sinn-chart__x-axis[data-step-xs="4"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-xs="4"] [data-tier="1"]),
|
|
347
|
+
:where(.sinn-chart__x-axis[data-step-xs="4"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-xs="4"] [data-tier="2"]) { display: none; }
|
|
348
|
+
:where(.sinn-chart__x-axis[data-step-xs="8"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-xs="8"] [data-tier="1"]),
|
|
349
|
+
:where(.sinn-chart__x-axis[data-step-xs="8"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-xs="8"] [data-tier="2"]),
|
|
350
|
+
:where(.sinn-chart__x-axis[data-step-xs="8"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-xs="8"] [data-tier="4"]) { display: none; }
|
|
351
|
+
:where(.sinn-chart__x-axis[data-step-xs="16"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-xs="16"] [data-tier="1"]),
|
|
352
|
+
:where(.sinn-chart__x-axis[data-step-xs="16"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-xs="16"] [data-tier="2"]),
|
|
353
|
+
:where(.sinn-chart__x-axis[data-step-xs="16"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-xs="16"] [data-tier="4"]),
|
|
354
|
+
:where(.sinn-chart__x-axis[data-step-xs="16"] [data-tier="8"], .sinn-chart__grid[data-axis="x"][data-step-xs="16"] [data-tier="8"]) { display: none; }
|
|
355
|
+
}
|
|
356
|
+
@container sinn-chart (min-width: 24.01rem) and (max-width: 36rem) {
|
|
357
|
+
:where(.sinn-chart__x-axis[data-step-sm="2"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-sm="2"] [data-tier="1"]) { display: none; }
|
|
358
|
+
:where(.sinn-chart__x-axis[data-step-sm="4"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-sm="4"] [data-tier="1"]),
|
|
359
|
+
:where(.sinn-chart__x-axis[data-step-sm="4"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-sm="4"] [data-tier="2"]) { display: none; }
|
|
360
|
+
:where(.sinn-chart__x-axis[data-step-sm="8"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-sm="8"] [data-tier="1"]),
|
|
361
|
+
:where(.sinn-chart__x-axis[data-step-sm="8"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-sm="8"] [data-tier="2"]),
|
|
362
|
+
:where(.sinn-chart__x-axis[data-step-sm="8"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-sm="8"] [data-tier="4"]) { display: none; }
|
|
363
|
+
:where(.sinn-chart__x-axis[data-step-sm="16"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-sm="16"] [data-tier="1"]),
|
|
364
|
+
:where(.sinn-chart__x-axis[data-step-sm="16"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-sm="16"] [data-tier="2"]),
|
|
365
|
+
:where(.sinn-chart__x-axis[data-step-sm="16"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-sm="16"] [data-tier="4"]),
|
|
366
|
+
:where(.sinn-chart__x-axis[data-step-sm="16"] [data-tier="8"], .sinn-chart__grid[data-axis="x"][data-step-sm="16"] [data-tier="8"]) { display: none; }
|
|
367
|
+
}
|
|
368
|
+
@container sinn-chart (min-width: 36.01rem) and (max-width: 52rem) {
|
|
369
|
+
:where(.sinn-chart__x-axis[data-step-md="2"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-md="2"] [data-tier="1"]) { display: none; }
|
|
370
|
+
:where(.sinn-chart__x-axis[data-step-md="4"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-md="4"] [data-tier="1"]),
|
|
371
|
+
:where(.sinn-chart__x-axis[data-step-md="4"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-md="4"] [data-tier="2"]) { display: none; }
|
|
372
|
+
:where(.sinn-chart__x-axis[data-step-md="8"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-md="8"] [data-tier="1"]),
|
|
373
|
+
:where(.sinn-chart__x-axis[data-step-md="8"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-md="8"] [data-tier="2"]),
|
|
374
|
+
:where(.sinn-chart__x-axis[data-step-md="8"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-md="8"] [data-tier="4"]) { display: none; }
|
|
375
|
+
:where(.sinn-chart__x-axis[data-step-md="16"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-md="16"] [data-tier="1"]),
|
|
376
|
+
:where(.sinn-chart__x-axis[data-step-md="16"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-md="16"] [data-tier="2"]),
|
|
377
|
+
:where(.sinn-chart__x-axis[data-step-md="16"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-md="16"] [data-tier="4"]),
|
|
378
|
+
:where(.sinn-chart__x-axis[data-step-md="16"] [data-tier="8"], .sinn-chart__grid[data-axis="x"][data-step-md="16"] [data-tier="8"]) { display: none; }
|
|
379
|
+
}
|
|
380
|
+
@container sinn-chart (min-width: 52.01rem) {
|
|
381
|
+
:where(.sinn-chart__x-axis[data-step-lg="2"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-lg="2"] [data-tier="1"]) { display: none; }
|
|
382
|
+
:where(.sinn-chart__x-axis[data-step-lg="4"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-lg="4"] [data-tier="1"]),
|
|
383
|
+
:where(.sinn-chart__x-axis[data-step-lg="4"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-lg="4"] [data-tier="2"]) { display: none; }
|
|
384
|
+
:where(.sinn-chart__x-axis[data-step-lg="8"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-lg="8"] [data-tier="1"]),
|
|
385
|
+
:where(.sinn-chart__x-axis[data-step-lg="8"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-lg="8"] [data-tier="2"]),
|
|
386
|
+
:where(.sinn-chart__x-axis[data-step-lg="8"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-lg="8"] [data-tier="4"]) { display: none; }
|
|
387
|
+
:where(.sinn-chart__x-axis[data-step-lg="16"] [data-tier="1"], .sinn-chart__grid[data-axis="x"][data-step-lg="16"] [data-tier="1"]),
|
|
388
|
+
:where(.sinn-chart__x-axis[data-step-lg="16"] [data-tier="2"], .sinn-chart__grid[data-axis="x"][data-step-lg="16"] [data-tier="2"]),
|
|
389
|
+
:where(.sinn-chart__x-axis[data-step-lg="16"] [data-tier="4"], .sinn-chart__grid[data-axis="x"][data-step-lg="16"] [data-tier="4"]),
|
|
390
|
+
:where(.sinn-chart__x-axis[data-step-lg="16"] [data-tier="8"], .sinn-chart__grid[data-axis="x"][data-step-lg="16"] [data-tier="8"]) { display: none; }
|
|
391
|
+
}
|
|
392
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Marquee — a row of content (logos, announcements, testimonials) scrolling continuously.
|
|
4
|
+
* CSS animation over two copies of the content; no JavaScript.
|
|
5
|
+
*
|
|
6
|
+
* Accessibility built in:
|
|
7
|
+
* - The second copy is aria-hidden and inert: screen readers and the Tab key get the content once.
|
|
8
|
+
* - Pauses on hover (optional) and whenever anything inside has keyboard focus.
|
|
9
|
+
* - A visible "Pause scrolling" control (WCAG 2.2.2: moving content that lasts more than 5 seconds
|
|
10
|
+
* must be pausable). It's a real checkbox styled as a button, so it works without JS.
|
|
11
|
+
* - Reduced motion (OS or site override): no movement; the items wrap into a static row.
|
|
12
|
+
* - Direction follows the page (right-to-left pages scroll the other way).
|
|
13
|
+
*
|
|
14
|
+
* Don't put content people must read or act on quickly in a marquee. Avoid ids inside it
|
|
15
|
+
* (the content is rendered twice).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Marquee label="Tools we use" fade>
|
|
19
|
+
* <img src={aetna.src} alt="Aetna" width="120" height="40" />
|
|
20
|
+
* <img src={bcbs.src} alt="Blue Cross Blue Shield" width="120" height="40" />
|
|
21
|
+
* </Marquee>
|
|
22
|
+
*/
|
|
23
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
24
|
+
import './styles/motion.css';
|
|
25
|
+
|
|
26
|
+
type Props = HTMLAttributes<'div'> & {
|
|
27
|
+
/** Accessible name of the region ("Our partners"). Required. */
|
|
28
|
+
label: string;
|
|
29
|
+
speed?: 'slow' | 'normal' | 'fast';
|
|
30
|
+
direction?: 'forward' | 'reverse';
|
|
31
|
+
gap?: 's' | 'l' | 'xl';
|
|
32
|
+
/** Fade the edges. */
|
|
33
|
+
fade?: boolean;
|
|
34
|
+
pauseOnHover?: boolean;
|
|
35
|
+
/** Show the Pause control (default true; keep it unless the marquee stops within 5 s). */
|
|
36
|
+
controls?: boolean;
|
|
37
|
+
controlLabel?: string;
|
|
38
|
+
/** Render items as a list (<ul>); wrap each child in <li>. */
|
|
39
|
+
list?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
label,
|
|
44
|
+
speed = 'normal',
|
|
45
|
+
direction = 'forward',
|
|
46
|
+
gap = 'l',
|
|
47
|
+
fade = false,
|
|
48
|
+
pauseOnHover = true,
|
|
49
|
+
controls = true,
|
|
50
|
+
controlLabel = 'Pause scrolling',
|
|
51
|
+
list = false,
|
|
52
|
+
class: className,
|
|
53
|
+
...rest
|
|
54
|
+
} = Astro.props;
|
|
55
|
+
|
|
56
|
+
const content = await Astro.slots.render('default');
|
|
57
|
+
const Group = list ? 'ul' : 'div';
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
class:list={['sinn-marquee', className]}
|
|
62
|
+
role="region"
|
|
63
|
+
aria-label={label}
|
|
64
|
+
data-speed={speed === 'normal' ? undefined : speed}
|
|
65
|
+
data-direction={direction === 'reverse' ? 'reverse' : undefined}
|
|
66
|
+
data-gap={gap === 'l' ? undefined : gap}
|
|
67
|
+
data-fade={fade ? '' : undefined}
|
|
68
|
+
data-pause-on-hover={pauseOnHover ? '' : undefined}
|
|
69
|
+
{...rest}
|
|
70
|
+
>
|
|
71
|
+
<div class="sinn-marquee__viewport">
|
|
72
|
+
<Group class="sinn-marquee__group" role={list ? 'list' : undefined}><Fragment set:html={content} /></Group>
|
|
73
|
+
<Group class="sinn-marquee__group" aria-hidden="true" inert><Fragment set:html={content} /></Group>
|
|
74
|
+
</div>
|
|
75
|
+
{
|
|
76
|
+
controls && (
|
|
77
|
+
<label class="sinn-marquee__toggle">
|
|
78
|
+
<input type="checkbox" class="sinn-marquee__toggle-input" />
|
|
79
|
+
<svg class="sinn-marquee__icon-pause" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
80
|
+
<rect x="3.5" y="2.5" width="3" height="11" rx="1" />
|
|
81
|
+
<rect x="9.5" y="2.5" width="3" height="11" rx="1" />
|
|
82
|
+
</svg>
|
|
83
|
+
<svg class="sinn-marquee__icon-play" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
84
|
+
<path d="M4 2.5v11l9-5.5z" />
|
|
85
|
+
</svg>
|
|
86
|
+
<span>{controlLabel}</span>
|
|
87
|
+
</label>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* MotionProvider — loads GSAP (+ ScrollTrigger and any plugins you list) once per page
|
|
4
|
+
* lifetime, runs Lenis smooth scrolling in sync with ScrollTrigger, and keeps animations
|
|
5
|
+
* correct across Astro page transitions. Put it once in your layout.
|
|
6
|
+
*
|
|
7
|
+
* - Lazy: GSAP downloads only when the first scene nears the viewport, unless `smooth` or
|
|
8
|
+
* `eager` is on (then it loads at idle). GSAP is a peer dependency: `pnpm add gsap`.
|
|
9
|
+
* - Smooth scrolling (Lenis) is off by default and never runs with reduced motion. Native
|
|
10
|
+
* keyboard scrolling, find-in-page and anchor links keep working.
|
|
11
|
+
* - Page transitions: before Astro swaps the page, every scene is reverted (tweens and
|
|
12
|
+
* ScrollTriggers killed, inline styles removed); after the swap, Lenis and ScrollTrigger
|
|
13
|
+
* re-measure and scenes on the new page mount as they near the viewport.
|
|
14
|
+
* - Reduced motion changes at runtime (OS or site switch) stop/start Lenis and rebuild scenes.
|
|
15
|
+
*
|
|
16
|
+
* Your own scripts can use the same instance:
|
|
17
|
+
* import { getMotion, onBeforeSwap, onPageLoad } from '@sinnstack/ui/motion/runtime';
|
|
18
|
+
* const { gsap, ScrollTrigger, plugins } = await getMotion();
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <MotionProvider smooth plugins={['SplitText']} />
|
|
22
|
+
* <SceneRegistry />
|
|
23
|
+
*/
|
|
24
|
+
import type { PluginName } from './runtime/types';
|
|
25
|
+
import './styles/motion.css';
|
|
26
|
+
|
|
27
|
+
type Props = {
|
|
28
|
+
smooth?: boolean;
|
|
29
|
+
/** Lenis smoothing, 0–1 (lower = smoother). */
|
|
30
|
+
lerp?: number;
|
|
31
|
+
plugins?: PluginName[];
|
|
32
|
+
/** Load GSAP at idle even without smooth scrolling or scenes. */
|
|
33
|
+
eager?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const { smooth = false, lerp = 0.1, plugins = [], eager = false } = Astro.props;
|
|
37
|
+
|
|
38
|
+
const metaAttrs = {
|
|
39
|
+
'data-smooth': smooth ? 'true' : 'false',
|
|
40
|
+
'data-lerp': String(lerp),
|
|
41
|
+
'data-plugins': plugins.join(','),
|
|
42
|
+
'data-eager': eager ? 'true' : 'false',
|
|
43
|
+
};
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<meta name="sinn-motion" content="" {...metaAttrs} />
|
|
47
|
+
<script>
|
|
48
|
+
import { startMotionRuntime } from './runtime/runtime';
|
|
49
|
+
startMotionRuntime();
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* PageTransitions — animated navigation between pages with Astro View Transitions
|
|
4
|
+
* (ClientRouter). Put it in the <head> of your layout.
|
|
5
|
+
*
|
|
6
|
+
* - `animation`: page-level preset for the root: `fade` (default), `slide` (direction-aware:
|
|
7
|
+
* back navigation slides the other way; mirrored in right-to-left pages), `rise`, or `none`.
|
|
8
|
+
* For element-level control use Astro's `transition:animate` with the presets from
|
|
9
|
+
* `@sinnstack/ui/motion/transitions`, and `transition:name` (see `morphName()`) for shared
|
|
10
|
+
* elements, e.g. a card image that morphs into the detail page's hero.
|
|
11
|
+
* - Reduced motion (OS or <html data-motion="reduce">): navigation still works, with no animation.
|
|
12
|
+
* - Keeps `<html>` attributes listed in `persist` across navigations (Astro would otherwise drop
|
|
13
|
+
* client-set ones like the site's motion or theme switch).
|
|
14
|
+
* - After a navigation, focus moves to <main> (without scrolling) so keyboard and screen-reader
|
|
15
|
+
* users start at the new content; Astro announces the new page title.
|
|
16
|
+
* - `fallback`: what browsers without the View Transitions API do (`animate` simulates, `swap`
|
|
17
|
+
* just swaps, `none` does full page loads).
|
|
18
|
+
*
|
|
19
|
+
* Scripts on client-routed sites run once: re-run per-page setup on `astro:page-load`.
|
|
20
|
+
* MotionProvider does this for scenes.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <head>
|
|
24
|
+
* <PageTransitions animation="slide" />
|
|
25
|
+
* </head>
|
|
26
|
+
*/
|
|
27
|
+
import { ClientRouter } from 'astro:transitions';
|
|
28
|
+
import './styles/motion.css';
|
|
29
|
+
|
|
30
|
+
type Props = {
|
|
31
|
+
animation?: 'fade' | 'slide' | 'rise' | 'none';
|
|
32
|
+
fallback?: 'animate' | 'swap' | 'none';
|
|
33
|
+
/** <html> attributes to carry over between pages. */
|
|
34
|
+
persist?: string[];
|
|
35
|
+
/** Move focus to the main landmark after navigating. */
|
|
36
|
+
focusMain?: boolean;
|
|
37
|
+
focusTarget?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const {
|
|
41
|
+
animation = 'fade',
|
|
42
|
+
fallback = 'animate',
|
|
43
|
+
persist = ['data-motion', 'data-theme'],
|
|
44
|
+
focusMain = true,
|
|
45
|
+
focusTarget = 'main, [role="main"], #main',
|
|
46
|
+
} = Astro.props;
|
|
47
|
+
|
|
48
|
+
const metaAttrs = {
|
|
49
|
+
'data-animation': animation,
|
|
50
|
+
'data-persist': persist.join(','),
|
|
51
|
+
'data-focus': focusMain ? 'true' : 'false',
|
|
52
|
+
'data-focus-target': focusTarget,
|
|
53
|
+
};
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
<meta name="sinn-page-transitions" content="" {...metaAttrs} />
|
|
57
|
+
<ClientRouter fallback={fallback} />
|
|
58
|
+
<script>
|
|
59
|
+
import { setupPageTransitions } from './runtime/page-transitions';
|
|
60
|
+
setupPageTransitions();
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Parallax — layers that move at different speeds while the section scrolls past, for depth.
|
|
4
|
+
* CSS scroll-driven animations (a view timeline on the section); no JavaScript.
|
|
5
|
+
*
|
|
6
|
+
* - Put background layers in ParallaxLayer children (with a `speed`) and the readable
|
|
7
|
+
* foreground in the `content` slot. Content stays in normal flow and never moves, so text
|
|
8
|
+
* is always legible and selectable.
|
|
9
|
+
* - Layers are oversized by exactly how far they can travel, so edges never show.
|
|
10
|
+
* - Reduced motion (OS or site override): layers stay still. Unsupported browsers: still too.
|
|
11
|
+
* - Layers are decorative (aria-hidden) by default; put meaningful images in `content`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Parallax height="l" travel="m">
|
|
15
|
+
* <ParallaxLayer speed={0.5}><Image src={sky} alt="" layout="full" /></ParallaxLayer>
|
|
16
|
+
* <ParallaxLayer speed={0.25} z={1}><Image src={hills} alt="" layout="full" /></ParallaxLayer>
|
|
17
|
+
* <Container slot="content"><Heading level={2}>Built in Fort Worth, shipped everywhere</Heading></Container>
|
|
18
|
+
* </Parallax>
|
|
19
|
+
*/
|
|
20
|
+
import type { HTMLAttributes, HTMLTag } from 'astro/types';
|
|
21
|
+
import './styles/motion.css';
|
|
22
|
+
|
|
23
|
+
type Props = HTMLAttributes<'section'> & {
|
|
24
|
+
as?: HTMLTag;
|
|
25
|
+
/** Minimum height: s 40svh · m 60svh · l 80svh · screen 100svh. */
|
|
26
|
+
height?: 's' | 'm' | 'l' | 'screen';
|
|
27
|
+
/** How far layers travel at speed 1: s 10svh · m 20svh · l 35svh. */
|
|
28
|
+
travel?: 's' | 'm' | 'l';
|
|
29
|
+
radius?: 'none' | 'l';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const { as: Tag = 'section', height = 'm', travel = 'm', radius = 'none', class: className, ...rest } = Astro.props;
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<Tag
|
|
36
|
+
class:list={['sinn-parallax', className]}
|
|
37
|
+
data-height={height}
|
|
38
|
+
data-travel={travel === 'm' ? undefined : travel}
|
|
39
|
+
data-radius={radius === 'none' ? undefined : radius}
|
|
40
|
+
{...rest}
|
|
41
|
+
>
|
|
42
|
+
<slot />
|
|
43
|
+
{Astro.slots.has('content') && <div class="sinn-parallax__content"><slot name="content" /></div>}
|
|
44
|
+
</Tag>
|