@sinnstack/ui 0.0.0-stage → 0.3.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 +89 -0
- package/LICENSE +373 -0
- package/README.md +188 -2
- package/docs/blocks.md +373 -0
- package/docs/data.md +128 -0
- package/docs/finishes.md +165 -0
- package/docs/motion.md +166 -0
- package/docs/primitives.md +510 -0
- package/docs/seo.md +191 -0
- package/docs/tokens.md +122 -0
- package/package.json +132 -3
- package/scripts/check-contrast.mjs +180 -0
- package/src/blocks/BlockRenderer.astro +60 -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 +173 -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 +58 -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 +48 -0
- package/src/blocks/cms/consent.ts +16 -0
- package/src/blocks/cms/contact-card.ts +46 -0
- package/src/blocks/cms/contact-form.ts +37 -0
- package/src/blocks/cms/cta-banner.ts +27 -0
- package/src/blocks/cms/cta-pair.ts +30 -0
- package/src/blocks/cms/data-base.ts +5 -0
- package/src/blocks/cms/data.ts +257 -0
- package/src/blocks/cms/faq.ts +38 -0
- package/src/blocks/cms/feature-grid.ts +47 -0
- package/src/blocks/cms/fixtures.ts +591 -0
- package/src/blocks/cms/hero-carousel.ts +36 -0
- package/src/blocks/cms/hero.ts +33 -0
- package/src/blocks/cms/highlight-cards.ts +41 -0
- package/src/blocks/cms/images.ts +37 -0
- package/src/blocks/cms/index.ts +59 -0
- package/src/blocks/cms/location-hours.ts +67 -0
- package/src/blocks/cms/logo-cloud.ts +36 -0
- package/src/blocks/cms/media-text.ts +26 -0
- package/src/blocks/cms/page-header.ts +27 -0
- package/src/blocks/cms/pages.ts +35 -0
- package/src/blocks/cms/prose-section.ts +25 -0
- package/src/blocks/cms/reviews.ts +50 -0
- package/src/blocks/cms/schema-dsl.ts +134 -0
- package/src/blocks/cms/schema.ts +794 -0
- package/src/blocks/cms/shared.ts +63 -0
- package/src/blocks/cms/stats-band.ts +35 -0
- package/src/blocks/cms/steps.ts +40 -0
- package/src/blocks/cms/testimonials.ts +46 -0
- package/src/blocks/cms/topbar.ts +27 -0
- package/src/blocks/cms/types.ts +27 -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 +35 -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/consent.ts +96 -0
- package/src/blocks/internal/fields.ts +18 -0
- package/src/blocks/internal/registry-contract.ts +67 -0
- package/src/blocks/internal/reviews.ts +22 -0
- package/src/blocks/internal/slug.ts +12 -0
- package/src/blocks/internal/util.ts +23 -0
- package/src/blocks/lib/contact.ts +92 -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/markdown.ts +350 -0
- package/src/blocks/lib/rich-text.ts +132 -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 +107 -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 +293 -0
- package/src/data/ChartAxis.astro +19 -0
- package/src/data/ChartContainer.astro +152 -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 +130 -0
- package/src/data/index.ts +10 -0
- package/src/data/internal/scale.ts +107 -0
- package/src/data/lib/chart.ts +459 -0
- package/src/data/lib/render.ts +219 -0
- package/src/data/lib/sparkline.ts +117 -0
- package/src/data/schema.ts +65 -0
- package/src/data/scripts/chart.ts +324 -0
- package/src/data/styles/chart.css +392 -0
- package/src/finishes/aurora.css +75 -0
- package/src/finishes/autumn.css +87 -0
- package/src/finishes/blueprint.css +69 -0
- package/src/finishes/brutalist.css +55 -0
- package/src/finishes/clay.css +48 -0
- package/src/finishes/day-cycle.css +46 -0
- package/src/finishes/fog.css +71 -0
- package/src/finishes/glass.css +149 -0
- package/src/finishes/holographic.css +91 -0
- package/src/finishes/night.css +77 -0
- package/src/finishes/paper.css +58 -0
- package/src/finishes/polished-glass.css +159 -0
- package/src/finishes/rain.css +84 -0
- package/src/finishes/scripts/day-cycle.ts +30 -0
- package/src/finishes/scripts/holographic.ts +37 -0
- package/src/finishes/scripts/spotlight.ts +30 -0
- package/src/finishes/spotlight.css +41 -0
- package/src/finishes/spring.css +80 -0
- package/src/finishes/terminal.css +49 -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 +86 -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 +278 -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 +109 -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 +75 -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 +91 -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/internal/image-plan.ts +82 -0
- package/src/primitives/internal/image.ts +129 -0
- package/src/primitives/internal/slider.ts +170 -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/motion.ts +68 -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 +59 -0
- package/src/seo/index.ts +10 -0
- package/src/seo/integration.ts +268 -0
- package/src/seo/internal/url.ts +68 -0
- package/src/seo/lib/jsonld.ts +342 -0
- package/src/seo/lib/meta.ts +205 -0
- package/src/seo/lib/redirects.ts +293 -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/schema.ts +43 -0
- package/src/tokens/base.css +71 -0
- package/src/tokens/tokens.css +210 -0
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
/* ---------- Shared type modifiers (Text, Heading, Label, Caption) ---------- */
|
|
6
|
+
:where(.sinn-type) { margin: 0; }
|
|
7
|
+
|
|
8
|
+
:where(.sinn-type[data-size='xs']) { font-size: var(--sinn-text-xs); }
|
|
9
|
+
:where(.sinn-type[data-size='s']) { font-size: var(--sinn-text-s); }
|
|
10
|
+
:where(.sinn-type[data-size='m']) { font-size: var(--sinn-text-m); }
|
|
11
|
+
:where(.sinn-type[data-size='l']) { font-size: var(--sinn-text-l); }
|
|
12
|
+
:where(.sinn-type[data-size='xl']) { font-size: var(--sinn-text-xl); }
|
|
13
|
+
:where(.sinn-type[data-size='2xl']) { font-size: var(--sinn-text-2xl); }
|
|
14
|
+
:where(.sinn-type[data-size='3xl']) { font-size: var(--sinn-text-3xl); }
|
|
15
|
+
:where(.sinn-type[data-size='4xl']) { font-size: var(--sinn-text-4xl); }
|
|
16
|
+
|
|
17
|
+
:where(.sinn-type[data-tone='muted']) { color: var(--sinn-color-text-muted); }
|
|
18
|
+
:where(.sinn-type[data-tone='accent']) { color: var(--sinn-color-accent-text); }
|
|
19
|
+
:where(.sinn-type[data-tone='danger']) { color: var(--sinn-color-danger-text); }
|
|
20
|
+
:where(.sinn-type[data-tone='success']) { color: var(--sinn-color-success-text); }
|
|
21
|
+
:where(.sinn-type[data-tone='warning']) { color: var(--sinn-color-warning-text); }
|
|
22
|
+
|
|
23
|
+
:where(.sinn-type[data-weight='regular']) { font-weight: var(--sinn-weight-regular); }
|
|
24
|
+
:where(.sinn-type[data-weight='medium']) { font-weight: var(--sinn-weight-medium); }
|
|
25
|
+
:where(.sinn-type[data-weight='semibold']) { font-weight: var(--sinn-weight-semibold); }
|
|
26
|
+
:where(.sinn-type[data-weight='bold']) { font-weight: var(--sinn-weight-bold); }
|
|
27
|
+
|
|
28
|
+
:where(.sinn-type[data-align='start']) { text-align: start; }
|
|
29
|
+
:where(.sinn-type[data-align='center']) { text-align: center; }
|
|
30
|
+
:where(.sinn-type[data-align='end']) { text-align: end; }
|
|
31
|
+
|
|
32
|
+
/* Single-line truncation, or clamp to N lines. Full text stays in the DOM for screen readers. */
|
|
33
|
+
:where(.sinn-type[data-truncate]) {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
}
|
|
38
|
+
:where(.sinn-type[data-lines]) {
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
-webkit-box-orient: vertical;
|
|
41
|
+
-webkit-line-clamp: var(--sinn-p-lines);
|
|
42
|
+
line-clamp: var(--sinn-p-lines);
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
:where(.sinn-type[data-lines='2']) { --sinn-p-lines: 2; }
|
|
46
|
+
:where(.sinn-type[data-lines='3']) { --sinn-p-lines: 3; }
|
|
47
|
+
:where(.sinn-type[data-lines='4']) { --sinn-p-lines: 4; }
|
|
48
|
+
:where(.sinn-type[data-lines='5']) { --sinn-p-lines: 5; }
|
|
49
|
+
|
|
50
|
+
:where(.sinn-type[data-measure]) { max-inline-size: var(--sinn-measure-prose); }
|
|
51
|
+
|
|
52
|
+
/* ---------- Text ---------- */
|
|
53
|
+
:where(.sinn-text) {
|
|
54
|
+
line-height: var(--sinn-leading-normal);
|
|
55
|
+
text-wrap: pretty;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ---------- Heading ---------- */
|
|
59
|
+
:where(.sinn-heading) {
|
|
60
|
+
font-family: var(--sinn-font-heading);
|
|
61
|
+
line-height: var(--sinn-leading-tight);
|
|
62
|
+
letter-spacing: var(--sinn-tracking-heading);
|
|
63
|
+
text-wrap: balance;
|
|
64
|
+
overflow-wrap: break-word;
|
|
65
|
+
}
|
|
66
|
+
:where(.sinn-heading:is([data-size='xs'], [data-size='s'], [data-size='m'])) {
|
|
67
|
+
line-height: var(--sinn-leading-snug);
|
|
68
|
+
letter-spacing: normal;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ---------- Label ---------- */
|
|
72
|
+
:where(.sinn-label) {
|
|
73
|
+
display: inline-block;
|
|
74
|
+
font-size: var(--sinn-text-s);
|
|
75
|
+
font-weight: var(--sinn-weight-medium);
|
|
76
|
+
line-height: var(--sinn-leading-snug);
|
|
77
|
+
}
|
|
78
|
+
:where(label.sinn-label) { cursor: default; }
|
|
79
|
+
:where(.sinn-label__required) {
|
|
80
|
+
margin-inline-start: 0.2em;
|
|
81
|
+
color: var(--sinn-color-danger-text);
|
|
82
|
+
}
|
|
83
|
+
:where(.sinn-label__optional) {
|
|
84
|
+
margin-inline-start: 0.35em;
|
|
85
|
+
color: var(--sinn-color-text-muted);
|
|
86
|
+
font-weight: var(--sinn-weight-regular);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* ---------- Caption ---------- */
|
|
90
|
+
:where(.sinn-caption) {
|
|
91
|
+
font-size: var(--sinn-text-s);
|
|
92
|
+
line-height: var(--sinn-leading-snug);
|
|
93
|
+
color: var(--sinn-color-text-muted);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ---------- Link ---------- */
|
|
97
|
+
:where(.sinn-link) {
|
|
98
|
+
color: var(--sinn-color-accent-text);
|
|
99
|
+
text-decoration-line: underline;
|
|
100
|
+
text-decoration-thickness: max(1px, 0.0625em);
|
|
101
|
+
text-underline-offset: 0.18em;
|
|
102
|
+
text-decoration-color: color-mix(in oklch, currentColor 55%, transparent);
|
|
103
|
+
border-radius: var(--sinn-radius-s);
|
|
104
|
+
transition:
|
|
105
|
+
text-decoration-color var(--sinn-duration-fast) var(--sinn-ease-standard),
|
|
106
|
+
text-decoration-thickness var(--sinn-duration-fast) var(--sinn-ease-standard);
|
|
107
|
+
}
|
|
108
|
+
:where(.sinn-link:hover) {
|
|
109
|
+
text-decoration-line: underline;
|
|
110
|
+
text-decoration-color: currentColor;
|
|
111
|
+
text-decoration-thickness: max(2px, 0.125em);
|
|
112
|
+
}
|
|
113
|
+
:where(.sinn-link:focus-visible) {
|
|
114
|
+
outline: var(--sinn-focus-width) solid var(--sinn-color-focus);
|
|
115
|
+
outline-offset: var(--sinn-focus-offset);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* A button styled as a link ("Cookie settings"): no button chrome. */
|
|
119
|
+
:where(button.sinn-link) {
|
|
120
|
+
appearance: none;
|
|
121
|
+
padding: 0;
|
|
122
|
+
border: 0;
|
|
123
|
+
background: none;
|
|
124
|
+
font: inherit;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
:where(.sinn-link[data-tone='neutral']) { color: var(--sinn-color-text); }
|
|
128
|
+
:where(.sinn-link[data-tone='inherit']) { color: inherit; }
|
|
129
|
+
|
|
130
|
+
:where(.sinn-link[data-underline='hover']),
|
|
131
|
+
:where(.sinn-link[data-underline='none']) { text-decoration-line: none; }
|
|
132
|
+
:where(.sinn-link[data-underline='none']:hover) { text-decoration-line: none; }
|
|
133
|
+
|
|
134
|
+
:where(.sinn-link[aria-current]:not([aria-current='false'])) { font-weight: var(--sinn-weight-semibold); }
|
|
135
|
+
|
|
136
|
+
:where(.sinn-link__icon) {
|
|
137
|
+
display: inline-block;
|
|
138
|
+
inline-size: 0.7em;
|
|
139
|
+
block-size: 0.7em;
|
|
140
|
+
margin-inline-start: 0.2em;
|
|
141
|
+
vertical-align: 0.05em;
|
|
142
|
+
}
|
|
143
|
+
:where(.sinn-link__icon:dir(rtl)) { transform: scaleX(-1); }
|
|
144
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
/*
|
|
6
|
+
* Components set `display`, and author CSS beats the browser's [hidden] rule,
|
|
7
|
+
* so `<Button hidden>` would stay visible without this. !important inside a
|
|
8
|
+
* layer outranks normal unlayered site CSS too, so `hidden` always wins.
|
|
9
|
+
*/
|
|
10
|
+
[hidden]:not([hidden='until-found']) { display: none !important; }
|
|
11
|
+
|
|
12
|
+
/* Visible to screen readers only. Used for icon-button names, "opens in new tab", loading text. */
|
|
13
|
+
.sinn-sr-only {
|
|
14
|
+
position: absolute;
|
|
15
|
+
inline-size: 1px;
|
|
16
|
+
block-size: 1px;
|
|
17
|
+
padding: 0;
|
|
18
|
+
margin: -1px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
clip-path: inset(50%);
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
border: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared prop vocabularies. Every value maps to a token in @sinnstack/ui,
|
|
5
|
+
* so components never emit inline styles (strict-CSP safe, see §9).
|
|
6
|
+
* Keep SPACE / MEASURE in sync with scripts/generate-scale-css.mjs.
|
|
7
|
+
*/
|
|
8
|
+
export const SPACE = ['none', '3xs', '2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'] as const;
|
|
9
|
+
export type Space = (typeof SPACE)[number];
|
|
10
|
+
|
|
11
|
+
export const MEASURE = ['xs', 's', 'm', 'l', 'xl'] as const;
|
|
12
|
+
export type Measure = (typeof MEASURE)[number];
|
|
13
|
+
|
|
14
|
+
export type Justify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
15
|
+
export type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
16
|
+
|
|
17
|
+
/** Tags that get `role="list"` restored when list styles are removed (Safari/VoiceOver). */
|
|
18
|
+
export const LIST_TAGS = new Set(['ul', 'ol']);
|
|
19
|
+
|
|
20
|
+
/* ---------- Typography ---------- */
|
|
21
|
+
export type TextSize = 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
22
|
+
/** Text colour: `default`, `muted`, `accent`, or a status from the shared scale (success · warning · danger). */
|
|
23
|
+
export type TextTone = 'default' | 'muted' | 'accent' | 'success' | 'warning' | 'danger';
|
|
24
|
+
export type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
25
|
+
export type TextAlign = 'start' | 'center' | 'end';
|
|
26
|
+
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
+
|
|
28
|
+
/* ---------- Controls ---------- */
|
|
29
|
+
export type ControlSize = 's' | 'm' | 'l';
|
|
30
|
+
export type ButtonVariant = 'solid' | 'soft' | 'outline' | 'ghost';
|
|
31
|
+
export type ButtonTone = 'accent' | 'neutral' | 'danger';
|
|
32
|
+
|
|
33
|
+
export interface ButtonStyleProps {
|
|
34
|
+
/** Visual weight. One `solid` per view for the primary action. */
|
|
35
|
+
variant?: ButtonVariant;
|
|
36
|
+
/** Color role. `danger` for destructive actions. */
|
|
37
|
+
tone?: ButtonTone;
|
|
38
|
+
size?: ControlSize;
|
|
39
|
+
/** Stretch to the container's inline size. */
|
|
40
|
+
fullWidth?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ---------- Events ---------- */
|
|
44
|
+
export interface SinnToggleChangeDetail {
|
|
45
|
+
pressed: boolean;
|
|
46
|
+
/** The Toggle's `value`, when it has a `name`. */
|
|
47
|
+
value?: string;
|
|
48
|
+
}
|
|
49
|
+
export type SinnToggleChangeEvent = CustomEvent<SinnToggleChangeDetail>;
|
|
50
|
+
|
|
51
|
+
declare global {
|
|
52
|
+
interface HTMLElementEventMap {
|
|
53
|
+
'sinn-toggle-change': SinnToggleChangeEvent;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ---------- Choice controls (Checkbox, Radio, Switch) ---------- */
|
|
58
|
+
|
|
59
|
+
export type ChoiceFieldProps = Omit<HTMLAttributes<'input'>, 'type' | 'size'> & {
|
|
60
|
+
/** Visible label. Or pass rich content in the default slot. */
|
|
61
|
+
label?: string;
|
|
62
|
+
/** Supporting text under the label, linked via aria-describedby. */
|
|
63
|
+
description?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Error message for this control (e.g. "You must accept the terms").
|
|
66
|
+
* For a group of radios or checkboxes, put the error on the Fieldset/ChoiceGroup instead.
|
|
67
|
+
*/
|
|
68
|
+
error?: string;
|
|
69
|
+
/** Sets aria-invalid without a message (e.g. when the group shows the message). */
|
|
70
|
+
invalid?: boolean;
|
|
71
|
+
/** Custom inline-validation messages (see Form validate="inline"). */
|
|
72
|
+
messages?: ValidationMessages;
|
|
73
|
+
size?: 's' | 'm' | 'l';
|
|
74
|
+
/** Put the label before the control (control at the row's end). */
|
|
75
|
+
labelPosition?: 'end' | 'start';
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/* ---------- Forms ---------- */
|
|
79
|
+
export type InputType =
|
|
80
|
+
| 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number'
|
|
81
|
+
| 'date' | 'datetime-local' | 'time' | 'month' | 'week';
|
|
82
|
+
|
|
83
|
+
/** Keys of ValidityState that can carry a custom message. */
|
|
84
|
+
export type ValidityKey =
|
|
85
|
+
| 'valueMissing' | 'typeMismatch' | 'patternMismatch' | 'tooShort' | 'tooLong'
|
|
86
|
+
| 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'badInput';
|
|
87
|
+
|
|
88
|
+
/** Custom validation messages, used by Form's inline validation instead of the browser's text. */
|
|
89
|
+
export type ValidationMessages = Partial<Record<ValidityKey, string>>;
|
|
90
|
+
|
|
91
|
+
/** Props every field-style control (Input, Textarea, Select, Checkbox…) accepts. */
|
|
92
|
+
export interface FieldProps {
|
|
93
|
+
/** Visible label. Omit only when the control is labelled another way (pass `aria-label`). */
|
|
94
|
+
label?: string;
|
|
95
|
+
/** Instructions shown under the label, linked with aria-describedby. */
|
|
96
|
+
description?: string;
|
|
97
|
+
/** Validation message (e.g. from the server). Sets aria-invalid. */
|
|
98
|
+
error?: string;
|
|
99
|
+
/** Keep the label for assistive tech but hide it visually. */
|
|
100
|
+
hideLabel?: boolean;
|
|
101
|
+
/** Show "(optional)" after the label. Pass a string to translate it. */
|
|
102
|
+
optional?: boolean | string;
|
|
103
|
+
messages?: ValidationMessages;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** What FormField passes to a function child, so custom controls get the same wiring. */
|
|
107
|
+
export interface FieldContext {
|
|
108
|
+
id: string;
|
|
109
|
+
descriptionId?: string;
|
|
110
|
+
errorId: string;
|
|
111
|
+
invalid: boolean;
|
|
112
|
+
required: boolean;
|
|
113
|
+
/** Spread onto the control: id, aria-describedby, aria-invalid, required, validation data attributes. */
|
|
114
|
+
attrs: Record<string, string | boolean | undefined>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface FormErrorItem {
|
|
118
|
+
/** id of the control to link to. */
|
|
119
|
+
field?: string;
|
|
120
|
+
message: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface SinnFormInvalidDetail {
|
|
124
|
+
controls: Array<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare global {
|
|
128
|
+
interface HTMLElementEventMap {
|
|
129
|
+
'sinn-form-invalid': CustomEvent<SinnFormInvalidDetail>;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface SelectOption {
|
|
134
|
+
value: string;
|
|
135
|
+
label: string;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface SelectOptionGroup {
|
|
139
|
+
label: string;
|
|
140
|
+
options: SelectOption[];
|
|
141
|
+
disabled?: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ---------- Navigation ---------- */
|
|
145
|
+
export interface NavItem {
|
|
146
|
+
href: string;
|
|
147
|
+
label: string;
|
|
148
|
+
/**
|
|
149
|
+
* How the current page is detected. `exact` (default) marks only this URL;
|
|
150
|
+
* `prefix` also marks pages under it (e.g. /services marks /services/hosting).
|
|
151
|
+
*/
|
|
152
|
+
match?: 'exact' | 'prefix';
|
|
153
|
+
/**
|
|
154
|
+
* Override URL detection: `'true'` marks a section that contains the current page (e.g. "Programs"
|
|
155
|
+
* while reading /services/hosting), `'page'` the page itself, `false` never.
|
|
156
|
+
*/
|
|
157
|
+
current?: boolean | 'page' | 'true';
|
|
158
|
+
/** One level of children, shown nested in vertical menus (sidebars, footers). */
|
|
159
|
+
items?: NavItem[];
|
|
160
|
+
newTab?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** One step in a Breadcrumbs trail. The last item is the current page (its href is ignored). */
|
|
164
|
+
export interface BreadcrumbItem {
|
|
165
|
+
label: string;
|
|
166
|
+
href?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface FooterSection {
|
|
170
|
+
title: string;
|
|
171
|
+
links: NavItem[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* ---------- Overlays ---------- */
|
|
175
|
+
/** Invoker commands: open/close dialogs and popovers from a button without JS. */
|
|
176
|
+
export type InvokerCommand =
|
|
177
|
+
| 'show-modal' | 'close' | 'request-close'
|
|
178
|
+
| 'show-popover' | 'hide-popover' | 'toggle-popover'
|
|
179
|
+
| `--${string}`;
|
|
180
|
+
|
|
181
|
+
export interface InvokerProps {
|
|
182
|
+
/** id of the dialog or popover this button controls. */
|
|
183
|
+
commandfor?: string;
|
|
184
|
+
command?: InvokerCommand;
|
|
185
|
+
/** id of a popover to toggle (Popover API). */
|
|
186
|
+
popovertarget?: string;
|
|
187
|
+
popovertargetaction?: 'toggle' | 'show' | 'hide';
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Props shared by Dialog, Drawer and Sheet. */
|
|
191
|
+
export interface ModalPanelProps extends Omit<HTMLAttributes<'dialog'>, 'title' | 'role'> {
|
|
192
|
+
/** Required: the dialog's accessible name. Use `hideTitle` to keep it for screen readers only. */
|
|
193
|
+
title: string;
|
|
194
|
+
hideTitle?: boolean;
|
|
195
|
+
titleLevel?: HeadingLevel;
|
|
196
|
+
/** Supporting text under the title, linked with aria-describedby. */
|
|
197
|
+
description?: string;
|
|
198
|
+
size?: 's' | 'm' | 'l' | 'xl' | 'full';
|
|
199
|
+
/**
|
|
200
|
+
* What closes it besides the close button and explicit close commands:
|
|
201
|
+
* `any` (Esc and backdrop click), `closerequest` (Esc only), `none` (neither; for alerts).
|
|
202
|
+
*/
|
|
203
|
+
dismissible?: 'any' | 'closerequest' | 'none';
|
|
204
|
+
/** Show the × button in the header. */
|
|
205
|
+
closeButton?: boolean;
|
|
206
|
+
closeLabel?: string;
|
|
207
|
+
/** Footer alignment. */
|
|
208
|
+
footerJustify?: 'end' | 'between' | 'stretch';
|
|
209
|
+
/** `alertdialog` for confirmations that interrupt (implies dismissible="none" unless set). */
|
|
210
|
+
role?: 'dialog' | 'alertdialog';
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
/** What Tooltip passes to its function child. */
|
|
215
|
+
export interface TooltipContext {
|
|
216
|
+
id: string;
|
|
217
|
+
/** Spread onto the trigger: aria-describedby or aria-labelledby. */
|
|
218
|
+
attrs: Record<string, string>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* ---------- Data display ---------- */
|
|
222
|
+
export type FormatKind =
|
|
223
|
+
| 'text'
|
|
224
|
+
| 'number'
|
|
225
|
+
| 'integer'
|
|
226
|
+
/** Compact above 10,000 (12.9K, 4.2M); full with grouping below (1,284). */
|
|
227
|
+
| 'compact'
|
|
228
|
+
| 'currency'
|
|
229
|
+
/** Fraction in, percent out: 0.124 → 12.4% */
|
|
230
|
+
| 'percent'
|
|
231
|
+
| 'date'
|
|
232
|
+
| 'datetime'
|
|
233
|
+
/** Signed number: +12, −3 */
|
|
234
|
+
| 'delta'
|
|
235
|
+
/** Signed percent from a fraction: 0.124 → +12.4% */
|
|
236
|
+
| 'delta-percent'
|
|
237
|
+
/** A measured quantity with a localized unit (`unit: 'mile'` → "25 mi"). */
|
|
238
|
+
| 'unit';
|
|
239
|
+
|
|
240
|
+
export interface FormatSpec {
|
|
241
|
+
kind: FormatKind;
|
|
242
|
+
/** ISO 4217 code for `currency`. Default USD. */
|
|
243
|
+
currency?: string;
|
|
244
|
+
/** Maximum fraction digits. */
|
|
245
|
+
digits?: number;
|
|
246
|
+
/** For number/currency: compact large values (true), never (false), or above 10,000 ('auto'). */
|
|
247
|
+
compact?: boolean | 'auto';
|
|
248
|
+
/** For `unit`: an Intl sanctioned unit ('mile', 'minute', 'kilogram', 'mile-per-hour'). */
|
|
249
|
+
unit?: string;
|
|
250
|
+
/** For `unit`: "25 mi" (short, default), "25 miles" (long) or "25mi" (narrow). */
|
|
251
|
+
unitDisplay?: 'short' | 'long' | 'narrow';
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type ValueFormat = FormatKind | FormatSpec;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Text tone for a value, from the shared status scale (success · warning · danger) plus `default`
|
|
258
|
+
* and `muted`. Always paired with an icon or sign, never colour alone.
|
|
259
|
+
* `good` and `bad` are the deprecated names for `success` and `danger`.
|
|
260
|
+
*/
|
|
261
|
+
export type ValueTone = 'default' | 'muted' | 'success' | 'warning' | 'danger' | 'good' | 'bad';
|
|
262
|
+
/** The tones a value can take after deprecated names are mapped. */
|
|
263
|
+
export type StatusTone = 'success' | 'warning' | 'danger';
|
|
264
|
+
|
|
265
|
+
export interface TableColumn<Row = Record<string, unknown>> {
|
|
266
|
+
/** Property of the row to show. */
|
|
267
|
+
key: string;
|
|
268
|
+
label: string;
|
|
269
|
+
/** How to format the value, or a function returning the display text. */
|
|
270
|
+
format?: ValueFormat | ((value: unknown, row: Row) => string);
|
|
271
|
+
/** Numbers: end-aligned, tabular figures. Inferred from numeric formats. */
|
|
272
|
+
numeric?: boolean;
|
|
273
|
+
align?: 'start' | 'center' | 'end';
|
|
274
|
+
/** Render this column's cells as row headers (`<th scope="row">`). Usually the first column. */
|
|
275
|
+
rowHeader?: boolean;
|
|
276
|
+
/** Hide the header text visually (e.g. an actions column). It stays for screen readers. */
|
|
277
|
+
hideLabel?: boolean;
|
|
278
|
+
/** Set to false to exclude from sorting when the table is sortable. */
|
|
279
|
+
sortable?: boolean;
|
|
280
|
+
/** Value used for sorting (defaults to the raw value). */
|
|
281
|
+
sortValue?: (row: Row) => string | number | null | undefined;
|
|
282
|
+
/** Inline data bar scaled to the column's maximum (or `barMax`). */
|
|
283
|
+
bar?: boolean;
|
|
284
|
+
barMax?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Color the value: 'delta' colors by sign (with an arrow), using `higherIsBetter`;
|
|
287
|
+
* or a function returning a tone per row.
|
|
288
|
+
*/
|
|
289
|
+
tone?: 'delta' | ((value: unknown, row: Row) => ValueTone);
|
|
290
|
+
higherIsBetter?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Screen-reader label for a toned value (function tones get a status icon plus this text,
|
|
293
|
+
* so the flag isn't color alone). Receives `success`, `warning` or `danger`.
|
|
294
|
+
* Default: Good / Warning / Flagged.
|
|
295
|
+
*/
|
|
296
|
+
toneLabel?: (tone: StatusTone) => string;
|
|
297
|
+
/** Render cells through the Table's `cell` slot function. */
|
|
298
|
+
slot?: boolean;
|
|
299
|
+
/** Hide the column when the table is narrower than s (30rem) or m (48rem). */
|
|
300
|
+
hideBelow?: 's' | 'm';
|
|
301
|
+
/** `min`: shrink to content; otherwise a fixed share. */
|
|
302
|
+
width?: 'auto' | 'min' | 's' | 'm' | 'l';
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface TableCellContext<Row = Record<string, unknown>> {
|
|
306
|
+
row: Row;
|
|
307
|
+
column: TableColumn<Row>;
|
|
308
|
+
value: unknown;
|
|
309
|
+
/** The formatted value. */
|
|
310
|
+
display: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface DescriptionItem {
|
|
314
|
+
term: string;
|
|
315
|
+
/** Plain description text. */
|
|
316
|
+
description?: string;
|
|
317
|
+
/** A value to format with `format`. */
|
|
318
|
+
value?: unknown;
|
|
319
|
+
format?: ValueFormat;
|
|
320
|
+
/** Secondary line under the description. */
|
|
321
|
+
detail?: string;
|
|
322
|
+
tone?: ValueTone;
|
|
323
|
+
/** Summary layout: the total row (bold, rule above). */
|
|
324
|
+
emphasis?: boolean;
|
|
325
|
+
/** Turns the description into a link. */
|
|
326
|
+
href?: string;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface ListMetaItem {
|
|
330
|
+
label: string;
|
|
331
|
+
/** Visually hidden prefix for context, e.g. "Updated". */
|
|
332
|
+
srLabel?: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* ---------- Segmented control, slider, disclosure, accordion, tabs ---------- */
|
|
336
|
+
export interface SegmentOption {
|
|
337
|
+
value: string;
|
|
338
|
+
label: string;
|
|
339
|
+
/**
|
|
340
|
+
* Trusted SVG markup shown before the label (rendered with set:html: never pass CMS or
|
|
341
|
+
* user input here). With `iconOnly`, the label becomes the accessible name.
|
|
342
|
+
*/
|
|
343
|
+
icon?: string;
|
|
344
|
+
disabled?: boolean;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface AccordionItem {
|
|
348
|
+
/** Anchor id for deep links (`/faq#cost` opens that item), and the name of its slot. */
|
|
349
|
+
id?: string;
|
|
350
|
+
title: string;
|
|
351
|
+
/** Plain-text body. For rich content, fill the slot named after `id` instead. */
|
|
352
|
+
content?: string;
|
|
353
|
+
open?: boolean;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface TabItem {
|
|
357
|
+
/** Panel id: becomes the deep link (`#pricing` selects the tab) and the name of its slot. */
|
|
358
|
+
id: string;
|
|
359
|
+
label: string;
|
|
360
|
+
/** Plain-text body. For rich content, fill the slot named after `id` instead. */
|
|
361
|
+
content?: string;
|
|
362
|
+
/** Short count or status after the label ("3", "New"). Part of the tab's name. */
|
|
363
|
+
badge?: string | number;
|
|
364
|
+
disabled?: boolean;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface SinnSliderChangeDetail {
|
|
368
|
+
/** One number, or [low, high] for a range. */
|
|
369
|
+
value: number | [number, number];
|
|
370
|
+
}
|
|
371
|
+
export type SinnSliderChangeEvent = CustomEvent<SinnSliderChangeDetail>;
|
|
372
|
+
|
|
373
|
+
export interface SinnTabChangeDetail {
|
|
374
|
+
id: string;
|
|
375
|
+
index: number;
|
|
376
|
+
previousId: string | null;
|
|
377
|
+
}
|
|
378
|
+
export type SinnTabChangeEvent = CustomEvent<SinnTabChangeDetail>;
|
|
379
|
+
|
|
380
|
+
declare global {
|
|
381
|
+
interface HTMLElementEventMap {
|
|
382
|
+
'sinn-slider-change': SinnSliderChangeEvent;
|
|
383
|
+
'sinn-tab-change': SinnTabChangeEvent;
|
|
384
|
+
}
|
|
385
|
+
}
|