@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,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SegmentedControl: a fieldset of native radios drawn as joined segments.
|
|
3
|
+
* The radios stay real (opacity 0, covering each segment), so keyboard, forms and screen
|
|
4
|
+
* readers behave natively. The sliding highlight is a pseudo-element positioned from the
|
|
5
|
+
* checked option's index via :has(); without :has() the checked segment is filled instead.
|
|
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.primitives {
|
|
11
|
+
:where(.sinn-segmented) {
|
|
12
|
+
--sinn-p-h: var(--sinn-control-m);
|
|
13
|
+
--sinn-p-pad: 3px;
|
|
14
|
+
--sinn-p-r: var(--sinn-radius-control);
|
|
15
|
+
min-inline-size: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
border: 0;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
gap: var(--sinn-space-2xs);
|
|
23
|
+
font-size: var(--sinn-text-s);
|
|
24
|
+
}
|
|
25
|
+
:where(.sinn-segmented[data-size='s']) { --sinn-p-h: var(--sinn-control-s); --sinn-p-pad: 2px; font-size: var(--sinn-text-xs); }
|
|
26
|
+
:where(.sinn-segmented[data-size='l']) { --sinn-p-h: var(--sinn-control-l); font-size: var(--sinn-text-m); }
|
|
27
|
+
:where(.sinn-segmented[data-full-width]) { align-items: stretch; }
|
|
28
|
+
:where(.sinn-segmented__legend) { padding: 0; }
|
|
29
|
+
/* A fieldset's legend can't be a flex item: give the next sibling its gap. */
|
|
30
|
+
/* One class of specificity: must beat `margin: 0` resets (FormDescription, Text) in any load order. */
|
|
31
|
+
.sinn-segmented__legend + * { margin-block-start: var(--sinn-space-2xs); }
|
|
32
|
+
|
|
33
|
+
:where(.sinn-segmented__track) {
|
|
34
|
+
--sinn-p-i: 0;
|
|
35
|
+
--sinn-p-n: 2;
|
|
36
|
+
position: relative;
|
|
37
|
+
isolation: isolate;
|
|
38
|
+
display: inline-grid;
|
|
39
|
+
grid-auto-flow: column;
|
|
40
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
41
|
+
max-inline-size: 100%;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
padding: var(--sinn-p-pad);
|
|
44
|
+
border: var(--sinn-border-width-thin) solid var(--sinn-color-border-subtle);
|
|
45
|
+
border-radius: var(--sinn-p-r);
|
|
46
|
+
background-color: var(--sinn-color-surface-sunken);
|
|
47
|
+
}
|
|
48
|
+
:where(.sinn-segmented[data-width='fit']) :where(.sinn-segmented__track) { grid-auto-columns: auto; }
|
|
49
|
+
:where(.sinn-segmented[data-full-width]) :where(.sinn-segmented__track) { display: grid; }
|
|
50
|
+
|
|
51
|
+
:where(.sinn-segmented__option) {
|
|
52
|
+
position: relative;
|
|
53
|
+
display: grid;
|
|
54
|
+
place-items: center;
|
|
55
|
+
min-block-size: calc(var(--sinn-p-h) - 2 * var(--sinn-p-pad) - 2 * var(--sinn-border-width-thin));
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
padding-inline: 0.85em;
|
|
58
|
+
border-radius: calc(var(--sinn-p-r) - var(--sinn-p-pad));
|
|
59
|
+
color: var(--sinn-color-text-muted);
|
|
60
|
+
font-weight: var(--sinn-weight-medium);
|
|
61
|
+
line-height: var(--sinn-leading-tight);
|
|
62
|
+
text-align: center;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
transition: color var(--sinn-duration-fast) var(--sinn-ease-standard);
|
|
65
|
+
-webkit-tap-highlight-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
:where(.sinn-segmented[data-icon-only]) :where(.sinn-segmented__option) {
|
|
68
|
+
padding-inline: 0;
|
|
69
|
+
aspect-ratio: 1;
|
|
70
|
+
min-inline-size: calc(var(--sinn-p-h) - 2 * var(--sinn-p-pad) - 2 * var(--sinn-border-width-thin));
|
|
71
|
+
}
|
|
72
|
+
/* The real radio covers the whole segment: clicks, taps and focus all land on it. */
|
|
73
|
+
:where(.sinn-segmented__input) {
|
|
74
|
+
appearance: none;
|
|
75
|
+
position: absolute;
|
|
76
|
+
inset: 0;
|
|
77
|
+
margin: 0;
|
|
78
|
+
border-radius: inherit;
|
|
79
|
+
opacity: 0;
|
|
80
|
+
cursor: inherit;
|
|
81
|
+
}
|
|
82
|
+
:where(.sinn-segmented__content) {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: 0.4em;
|
|
87
|
+
min-inline-size: 0;
|
|
88
|
+
padding-block: 0.3em;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
text-wrap: balance;
|
|
91
|
+
}
|
|
92
|
+
:where(.sinn-segmented__icon) { display: inline-flex; flex-shrink: 0; }
|
|
93
|
+
:where(.sinn-segmented__icon) > :where(svg) { inline-size: 1.15em; block-size: 1.15em; }
|
|
94
|
+
|
|
95
|
+
:where(.sinn-segmented__option:has(> input:checked)) { color: var(--sinn-color-text); }
|
|
96
|
+
@media (hover: hover) {
|
|
97
|
+
:where(.sinn-segmented__option:not(:has(> input:checked, > input:disabled)):hover) { color: var(--sinn-color-text); }
|
|
98
|
+
}
|
|
99
|
+
:where(.sinn-segmented__option:has(> input:focus-visible)) {
|
|
100
|
+
outline: var(--sinn-focus-width) solid var(--sinn-color-focus);
|
|
101
|
+
outline-offset: 1px;
|
|
102
|
+
z-index: 1;
|
|
103
|
+
}
|
|
104
|
+
:where(.sinn-segmented__option:has(> input:disabled)),
|
|
105
|
+
:where(.sinn-segmented:disabled) :where(.sinn-segmented__track) {
|
|
106
|
+
opacity: 0.55;
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
}
|
|
109
|
+
:where(.sinn-segmented:has(input[aria-invalid='true'])) :where(.sinn-segmented__track) {
|
|
110
|
+
border-color: var(--sinn-color-danger);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ---------- The selected highlight ---------- */
|
|
114
|
+
/* fit: the checked segment is filled. equal: a highlight slides under it. */
|
|
115
|
+
:where(.sinn-segmented__option:has(> input:checked)) {
|
|
116
|
+
background-color: var(--sinn-color-surface-raised);
|
|
117
|
+
/* A border-strong edge, so the selection holds 3:1 against the track (WCAG 1.4.11), not just a shadow. */
|
|
118
|
+
box-shadow: var(--sinn-shadow-s), 0 0 0 var(--sinn-border-width-thin) var(--sinn-color-border-strong);
|
|
119
|
+
}
|
|
120
|
+
@supports selector(:has(*)) {
|
|
121
|
+
:where(.sinn-segmented[data-width='equal']) :where(.sinn-segmented__option:has(> input:checked)) {
|
|
122
|
+
background-color: transparent;
|
|
123
|
+
box-shadow: none;
|
|
124
|
+
}
|
|
125
|
+
:where(.sinn-segmented[data-width='equal']) :where(.sinn-segmented__track:has(input:checked))::before {
|
|
126
|
+
content: '';
|
|
127
|
+
position: absolute;
|
|
128
|
+
z-index: -1;
|
|
129
|
+
inset-block: var(--sinn-p-pad);
|
|
130
|
+
inset-inline-start: calc(var(--sinn-p-pad) + var(--sinn-p-i) * (100% - 2 * var(--sinn-p-pad)) / var(--sinn-p-n));
|
|
131
|
+
inline-size: calc((100% - 2 * var(--sinn-p-pad)) / var(--sinn-p-n));
|
|
132
|
+
border-radius: calc(var(--sinn-p-r) - var(--sinn-p-pad));
|
|
133
|
+
background-color: var(--sinn-color-surface-raised);
|
|
134
|
+
/* A border-strong edge, so the selection holds 3:1 against the track (WCAG 1.4.11), not just a shadow. */
|
|
135
|
+
box-shadow: var(--sinn-shadow-s), 0 0 0 var(--sinn-border-width-thin) var(--sinn-color-border-strong);
|
|
136
|
+
/* inset-inline-start (not translate) so it slides the right way in RTL. */
|
|
137
|
+
transition: inset-inline-start var(--sinn-duration-base) var(--sinn-ease-standard);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(1) > input:checked)) { --sinn-p-i: 0; }
|
|
141
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(2) > input:checked)) { --sinn-p-i: 1; }
|
|
142
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(3) > input:checked)) { --sinn-p-i: 2; }
|
|
143
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(4) > input:checked)) { --sinn-p-i: 3; }
|
|
144
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(5) > input:checked)) { --sinn-p-i: 4; }
|
|
145
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(6) > input:checked)) { --sinn-p-i: 5; }
|
|
146
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(7) > input:checked)) { --sinn-p-i: 6; }
|
|
147
|
+
:where(.sinn-segmented__track:has(> .sinn-segmented__option:nth-child(8) > input:checked)) { --sinn-p-i: 7; }
|
|
148
|
+
:where(.sinn-segmented__track[data-count='2']) { --sinn-p-n: 2; }
|
|
149
|
+
:where(.sinn-segmented__track[data-count='3']) { --sinn-p-n: 3; }
|
|
150
|
+
:where(.sinn-segmented__track[data-count='4']) { --sinn-p-n: 4; }
|
|
151
|
+
:where(.sinn-segmented__track[data-count='5']) { --sinn-p-n: 5; }
|
|
152
|
+
:where(.sinn-segmented__track[data-count='6']) { --sinn-p-n: 6; }
|
|
153
|
+
:where(.sinn-segmented__track[data-count='7']) { --sinn-p-n: 7; }
|
|
154
|
+
:where(.sinn-segmented__track[data-count='8']) { --sinn-p-n: 8; }
|
|
155
|
+
|
|
156
|
+
/* ---------- Forced colors: the selection must not depend on a shadow ---------- */
|
|
157
|
+
@media (forced-colors: active) {
|
|
158
|
+
:where(.sinn-segmented__track)::before { display: none; }
|
|
159
|
+
:where(.sinn-segmented__option:has(> input:checked)) {
|
|
160
|
+
forced-color-adjust: none;
|
|
161
|
+
background-color: Highlight;
|
|
162
|
+
color: HighlightText;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Slider: native range inputs over an SVG rail. The rail is inset by half a thumb on each
|
|
3
|
+
* side, so a percentage on the rail lines up exactly with the native thumb's center.
|
|
4
|
+
* A range stacks two inputs; only their thumbs take pointer events.
|
|
5
|
+
*/
|
|
6
|
+
/* Same order as tokens.css: whichever stylesheet loads first fixes the layer order. */
|
|
7
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
8
|
+
|
|
9
|
+
@layer sinn.primitives {
|
|
10
|
+
:where(.sinn-slider) {
|
|
11
|
+
--sinn-p-thumb: 1.5rem;
|
|
12
|
+
--sinn-p-rail: 6px;
|
|
13
|
+
--sinn-p-hit: max(1.5rem, var(--sinn-p-thumb));
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--sinn-space-3xs);
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
}
|
|
19
|
+
:where(.sinn-slider[data-size='s']) { --sinn-p-thumb: 1.25rem; --sinn-p-rail: 4px; }
|
|
20
|
+
:where(.sinn-slider[data-size='l']) { --sinn-p-thumb: 1.75rem; --sinn-p-rail: 8px; }
|
|
21
|
+
|
|
22
|
+
:where(.sinn-slider__head) {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
align-items: baseline;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
column-gap: var(--sinn-space-s);
|
|
28
|
+
}
|
|
29
|
+
:where(.sinn-slider__output) {
|
|
30
|
+
font-size: var(--sinn-text-s);
|
|
31
|
+
font-weight: var(--sinn-weight-semibold);
|
|
32
|
+
font-variant-numeric: tabular-nums;
|
|
33
|
+
color: var(--sinn-color-text);
|
|
34
|
+
}
|
|
35
|
+
:where(.sinn-slider__head--sr) { display: contents; }
|
|
36
|
+
/* The readout leads when the label is visually hidden. */
|
|
37
|
+
:where(.sinn-slider__head:has(> .sinn-sr-only)) { justify-content: flex-start; }
|
|
38
|
+
|
|
39
|
+
:where(.sinn-slider__control) {
|
|
40
|
+
position: relative;
|
|
41
|
+
min-block-size: var(--sinn-p-hit);
|
|
42
|
+
touch-action: pan-y;
|
|
43
|
+
}
|
|
44
|
+
:where(.sinn-slider__rail) {
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset-inline: calc(var(--sinn-p-thumb) / 2);
|
|
47
|
+
inset-block-start: 50%;
|
|
48
|
+
block-size: var(--sinn-p-rail);
|
|
49
|
+
translate: 0 -50%;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
:where(.sinn-slider__svg) { display: block; overflow: visible; }
|
|
53
|
+
:where(.sinn-slider:dir(rtl)) :where(.sinn-slider__svg) { transform: scaleX(-1); }
|
|
54
|
+
:where(.sinn-slider__track) { fill: var(--sinn-color-data-track); }
|
|
55
|
+
:where(.sinn-slider__fill) { fill: var(--sinn-color-accent); }
|
|
56
|
+
:where(.sinn-slider__tick) { fill: var(--sinn-color-border-strong); }
|
|
57
|
+
:where(.sinn-slider__tick[data-active]) { fill: var(--sinn-color-accent-contrast); }
|
|
58
|
+
|
|
59
|
+
/* ---------- The native input ---------- */
|
|
60
|
+
:where(.sinn-slider__input) {
|
|
61
|
+
-webkit-appearance: none;
|
|
62
|
+
appearance: none;
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset-inline: 0;
|
|
65
|
+
inset-block-start: 50%;
|
|
66
|
+
translate: 0 -50%;
|
|
67
|
+
inline-size: 100%;
|
|
68
|
+
block-size: var(--sinn-p-hit);
|
|
69
|
+
margin: 0;
|
|
70
|
+
background: transparent;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
:where(.sinn-slider__input)::-webkit-slider-runnable-track {
|
|
74
|
+
block-size: var(--sinn-p-hit);
|
|
75
|
+
background: transparent;
|
|
76
|
+
border: 0;
|
|
77
|
+
}
|
|
78
|
+
:where(.sinn-slider__input)::-moz-range-track { block-size: var(--sinn-p-hit); background: transparent; border: 0; }
|
|
79
|
+
:where(.sinn-slider__input)::-moz-range-progress { background: transparent; }
|
|
80
|
+
:where(.sinn-slider__input)::-webkit-slider-thumb {
|
|
81
|
+
-webkit-appearance: none;
|
|
82
|
+
appearance: none;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
inline-size: var(--sinn-p-thumb);
|
|
85
|
+
block-size: var(--sinn-p-thumb);
|
|
86
|
+
margin-block-start: calc((var(--sinn-p-hit) - var(--sinn-p-thumb)) / 2);
|
|
87
|
+
border: 2px solid var(--sinn-color-accent);
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
background-color: var(--sinn-color-surface-raised);
|
|
90
|
+
box-shadow: var(--sinn-shadow-s);
|
|
91
|
+
cursor: grab;
|
|
92
|
+
transition: box-shadow var(--sinn-duration-fast) var(--sinn-ease-standard), border-width var(--sinn-duration-fast) var(--sinn-ease-standard);
|
|
93
|
+
}
|
|
94
|
+
:where(.sinn-slider__input)::-moz-range-thumb {
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
inline-size: var(--sinn-p-thumb);
|
|
97
|
+
block-size: var(--sinn-p-thumb);
|
|
98
|
+
border: 2px solid var(--sinn-color-accent);
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
background-color: var(--sinn-color-surface-raised);
|
|
101
|
+
box-shadow: var(--sinn-shadow-s);
|
|
102
|
+
cursor: grab;
|
|
103
|
+
}
|
|
104
|
+
:where(.sinn-slider__input:active)::-webkit-slider-thumb { cursor: grabbing; border-width: 0.4em; }
|
|
105
|
+
:where(.sinn-slider__input:active)::-moz-range-thumb { cursor: grabbing; border-width: 0.4em; }
|
|
106
|
+
/* Focus ring on the thumb itself (an outline on the input would circle the whole track). */
|
|
107
|
+
:where(.sinn-slider__input:focus-visible) { outline: none; }
|
|
108
|
+
:where(.sinn-slider__input:focus-visible)::-webkit-slider-thumb {
|
|
109
|
+
box-shadow: 0 0 0 var(--sinn-focus-offset) var(--sinn-color-surface), 0 0 0 calc(var(--sinn-focus-offset) + var(--sinn-focus-width)) var(--sinn-color-focus);
|
|
110
|
+
}
|
|
111
|
+
:where(.sinn-slider__input:focus-visible)::-moz-range-thumb {
|
|
112
|
+
box-shadow: 0 0 0 var(--sinn-focus-offset) var(--sinn-color-surface), 0 0 0 calc(var(--sinn-focus-offset) + var(--sinn-focus-width)) var(--sinn-color-focus);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ---------- Range: two stacked inputs, thumbs only ---------- */
|
|
116
|
+
:where(.sinn-slider[data-range]) :where(.sinn-slider__input) { pointer-events: none; }
|
|
117
|
+
:where(.sinn-slider[data-range]) :where(.sinn-slider__input)::-webkit-slider-thumb { pointer-events: auto; }
|
|
118
|
+
:where(.sinn-slider[data-range]) :where(.sinn-slider__input)::-moz-range-thumb { pointer-events: auto; }
|
|
119
|
+
:where(.sinn-slider[data-range]) :where(.sinn-slider__control) { cursor: pointer; }
|
|
120
|
+
/* Keep a thumb parked at an end movable: the low thumb goes on top once it's past the middle. */
|
|
121
|
+
:where(.sinn-slider[data-top='lo']) :where(.sinn-slider__input:first-of-type),
|
|
122
|
+
:where(.sinn-slider[data-top='hi']) :where(.sinn-slider__input:last-of-type) { z-index: 1; }
|
|
123
|
+
:where(.sinn-slider__input:focus-visible) { z-index: 2; }
|
|
124
|
+
|
|
125
|
+
/* ---------- Marks ---------- */
|
|
126
|
+
:where(.sinn-slider__marks) {
|
|
127
|
+
position: relative;
|
|
128
|
+
block-size: 1lh;
|
|
129
|
+
margin-inline: calc(var(--sinn-p-thumb) / 2);
|
|
130
|
+
font-size: var(--sinn-text-xs);
|
|
131
|
+
line-height: var(--sinn-leading-snug);
|
|
132
|
+
color: var(--sinn-color-text-muted);
|
|
133
|
+
font-variant-numeric: tabular-nums;
|
|
134
|
+
}
|
|
135
|
+
:where(.sinn-slider__mark) {
|
|
136
|
+
position: absolute;
|
|
137
|
+
inset-inline-start: var(--sinn-p-pct);
|
|
138
|
+
translate: -50% 0;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
}
|
|
141
|
+
:where(.sinn-slider__mark[data-edge='start']) { translate: calc(var(--sinn-p-thumb) / -2) 0; }
|
|
142
|
+
:where(.sinn-slider__mark[data-edge='end']) { translate: calc(-100% + var(--sinn-p-thumb) / 2) 0; }
|
|
143
|
+
:where(.sinn-slider:dir(rtl)) :where(.sinn-slider__mark) { translate: 50% 0; }
|
|
144
|
+
:where(.sinn-slider:dir(rtl)) :where(.sinn-slider__mark[data-edge='start']) { translate: calc(var(--sinn-p-thumb) / 2) 0; }
|
|
145
|
+
:where(.sinn-slider:dir(rtl)) :where(.sinn-slider__mark[data-edge='end']) { translate: calc(100% - var(--sinn-p-thumb) / 2) 0; }
|
|
146
|
+
|
|
147
|
+
/* ---------- States ---------- */
|
|
148
|
+
:where(.sinn-slider[data-disabled]) :where(.sinn-slider__control, .sinn-slider__marks, .sinn-slider__output) { opacity: 0.55; }
|
|
149
|
+
:where(.sinn-slider[data-disabled]) :where(.sinn-slider__input) { cursor: not-allowed; }
|
|
150
|
+
:where(.sinn-slider[data-disabled]) :where(.sinn-slider__fill) { fill: var(--sinn-color-border-strong); }
|
|
151
|
+
:where(.sinn-slider:has(.sinn-slider__input[aria-invalid='true'])) :where(.sinn-slider__track) {
|
|
152
|
+
stroke: var(--sinn-color-danger);
|
|
153
|
+
stroke-width: 1px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Without JavaScript the fill and readout can't follow the thumbs: don't show stale ones. */
|
|
157
|
+
@media (scripting: none) {
|
|
158
|
+
:where(.sinn-slider__fill, .sinn-slider__output) { display: none; }
|
|
159
|
+
:where(.sinn-slider__tick[data-active]) { fill: var(--sinn-color-border-strong); }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media (forced-colors: active) {
|
|
163
|
+
:where(.sinn-slider__track) { fill: CanvasText; }
|
|
164
|
+
:where(.sinn-slider__fill) { fill: Highlight; }
|
|
165
|
+
:where(.sinn-slider__tick) { fill: Canvas; }
|
|
166
|
+
:where(.sinn-slider__input)::-webkit-slider-thumb { forced-color-adjust: none; background-color: Canvas; border-color: Highlight; }
|
|
167
|
+
:where(.sinn-slider__input)::-moz-range-thumb { background-color: Canvas; border-color: Highlight; }
|
|
168
|
+
:where(.sinn-slider__input:focus-visible)::-webkit-slider-thumb { outline: 2px solid Highlight; outline-offset: 2px; }
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Same order as tokens.css: whichever stylesheet loads first fixes the layer order. */
|
|
2
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
3
|
+
|
|
4
|
+
@layer sinn.primitives {
|
|
5
|
+
:where(.sinn-spacer) {
|
|
6
|
+
display: block;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
block-size: var(--sinn-p-size);
|
|
9
|
+
}
|
|
10
|
+
:where(.sinn-spacer[data-axis='inline']) {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
block-size: auto;
|
|
13
|
+
inline-size: var(--sinn-p-size);
|
|
14
|
+
}
|
|
15
|
+
/* In a flex parent, take all remaining space (push siblings apart). */
|
|
16
|
+
:where(.sinn-spacer[data-grow]) { flex-grow: 1; }
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* Same order as tokens.css: whichever stylesheet loads first fixes the layer order. */
|
|
2
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
3
|
+
|
|
4
|
+
@layer sinn.primitives {
|
|
5
|
+
:where(.sinn-stack) {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
gap: var(--sinn-p-gap);
|
|
10
|
+
}
|
|
11
|
+
/* Children's own block margins would double up with gap. */
|
|
12
|
+
:where(.sinn-stack) > :where(*) { margin-block: 0; }
|
|
13
|
+
:where(.sinn-stack:is(ul, ol)) { list-style: none; padding-inline-start: 0; margin-block: 0; }
|
|
14
|
+
|
|
15
|
+
:where(.sinn-stack[data-align='start']) { align-items: flex-start; }
|
|
16
|
+
:where(.sinn-stack[data-align='center']) { align-items: center; }
|
|
17
|
+
:where(.sinn-stack[data-align='end']) { align-items: flex-end; }
|
|
18
|
+
:where(.sinn-stack[data-align='stretch']) { align-items: stretch; }
|
|
19
|
+
|
|
20
|
+
/* Fill the parent's height so a grow Spacer or justify can push content apart. */
|
|
21
|
+
:where(.sinn-stack[data-fill]) { block-size: 100%; }
|
|
22
|
+
:where(.sinn-stack[data-justify='center']) { justify-content: center; }
|
|
23
|
+
:where(.sinn-stack[data-justify='end']) { justify-content: flex-end; }
|
|
24
|
+
:where(.sinn-stack[data-justify='between']) { justify-content: space-between; }
|
|
25
|
+
}
|