@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.
Files changed (306) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +373 -0
  3. package/README.md +188 -2
  4. package/docs/blocks.md +373 -0
  5. package/docs/data.md +128 -0
  6. package/docs/finishes.md +165 -0
  7. package/docs/motion.md +166 -0
  8. package/docs/primitives.md +510 -0
  9. package/docs/seo.md +191 -0
  10. package/docs/tokens.md +122 -0
  11. package/package.json +132 -3
  12. package/scripts/check-contrast.mjs +180 -0
  13. package/src/blocks/BlockRenderer.astro +60 -0
  14. package/src/blocks/CTABanner.astro +121 -0
  15. package/src/blocks/CTAPair.astro +110 -0
  16. package/src/blocks/CardGrid.astro +167 -0
  17. package/src/blocks/ConsentEmbed.astro +125 -0
  18. package/src/blocks/ConsentManager.astro +147 -0
  19. package/src/blocks/ConsentScript.astro +47 -0
  20. package/src/blocks/ContactCard.astro +164 -0
  21. package/src/blocks/ContactForm.astro +224 -0
  22. package/src/blocks/ErrorPage.astro +242 -0
  23. package/src/blocks/FAQ.astro +135 -0
  24. package/src/blocks/FeatureGrid.astro +148 -0
  25. package/src/blocks/Hero.astro +171 -0
  26. package/src/blocks/HeroCarousel.astro +220 -0
  27. package/src/blocks/HighlightCards.astro +107 -0
  28. package/src/blocks/LocationHours.astro +311 -0
  29. package/src/blocks/LogoCloud.astro +135 -0
  30. package/src/blocks/MaintenancePage.astro +173 -0
  31. package/src/blocks/MediaText.astro +177 -0
  32. package/src/blocks/PageHeader.astro +126 -0
  33. package/src/blocks/ProseSection.astro +98 -0
  34. package/src/blocks/Reviews.astro +194 -0
  35. package/src/blocks/RichText.astro +58 -0
  36. package/src/blocks/StatsBand.astro +117 -0
  37. package/src/blocks/Steps.astro +141 -0
  38. package/src/blocks/Testimonials.astro +144 -0
  39. package/src/blocks/Topbar.astro +158 -0
  40. package/src/blocks/cms/card-grid.ts +48 -0
  41. package/src/blocks/cms/consent.ts +16 -0
  42. package/src/blocks/cms/contact-card.ts +46 -0
  43. package/src/blocks/cms/contact-form.ts +37 -0
  44. package/src/blocks/cms/cta-banner.ts +27 -0
  45. package/src/blocks/cms/cta-pair.ts +30 -0
  46. package/src/blocks/cms/data-base.ts +5 -0
  47. package/src/blocks/cms/data.ts +257 -0
  48. package/src/blocks/cms/faq.ts +38 -0
  49. package/src/blocks/cms/feature-grid.ts +47 -0
  50. package/src/blocks/cms/fixtures.ts +591 -0
  51. package/src/blocks/cms/hero-carousel.ts +36 -0
  52. package/src/blocks/cms/hero.ts +33 -0
  53. package/src/blocks/cms/highlight-cards.ts +41 -0
  54. package/src/blocks/cms/images.ts +37 -0
  55. package/src/blocks/cms/index.ts +59 -0
  56. package/src/blocks/cms/location-hours.ts +67 -0
  57. package/src/blocks/cms/logo-cloud.ts +36 -0
  58. package/src/blocks/cms/media-text.ts +26 -0
  59. package/src/blocks/cms/page-header.ts +27 -0
  60. package/src/blocks/cms/pages.ts +35 -0
  61. package/src/blocks/cms/prose-section.ts +25 -0
  62. package/src/blocks/cms/reviews.ts +50 -0
  63. package/src/blocks/cms/schema-dsl.ts +134 -0
  64. package/src/blocks/cms/schema.ts +794 -0
  65. package/src/blocks/cms/shared.ts +63 -0
  66. package/src/blocks/cms/stats-band.ts +35 -0
  67. package/src/blocks/cms/steps.ts +40 -0
  68. package/src/blocks/cms/testimonials.ts +46 -0
  69. package/src/blocks/cms/topbar.ts +27 -0
  70. package/src/blocks/cms/types.ts +27 -0
  71. package/src/blocks/consent.ts +14 -0
  72. package/src/blocks/icons.ts +47 -0
  73. package/src/blocks/index.ts +42 -0
  74. package/src/blocks/internal/Actions.astro +35 -0
  75. package/src/blocks/internal/BlockHeader.astro +45 -0
  76. package/src/blocks/internal/BlockShell.astro +58 -0
  77. package/src/blocks/internal/CarouselScript.astro +7 -0
  78. package/src/blocks/internal/ConsentEmbedScript.astro +7 -0
  79. package/src/blocks/internal/ConsentManagerScript.astro +7 -0
  80. package/src/blocks/internal/HoursScript.astro +7 -0
  81. package/src/blocks/internal/Placeholder.astro +13 -0
  82. package/src/blocks/internal/RichTextNode.astro +133 -0
  83. package/src/blocks/internal/StandaloneDocument.astro +53 -0
  84. package/src/blocks/internal/consent.ts +96 -0
  85. package/src/blocks/internal/fields.ts +18 -0
  86. package/src/blocks/internal/registry-contract.ts +67 -0
  87. package/src/blocks/internal/reviews.ts +22 -0
  88. package/src/blocks/internal/slug.ts +12 -0
  89. package/src/blocks/internal/util.ts +23 -0
  90. package/src/blocks/lib/contact.ts +92 -0
  91. package/src/blocks/lib/error-pages.ts +119 -0
  92. package/src/blocks/lib/faq.ts +37 -0
  93. package/src/blocks/lib/hours.ts +201 -0
  94. package/src/blocks/lib/maintenance.ts +129 -0
  95. package/src/blocks/lib/markdown.ts +350 -0
  96. package/src/blocks/lib/rich-text.ts +132 -0
  97. package/src/blocks/registry.ts +79 -0
  98. package/src/blocks/scripts/carousel.ts +218 -0
  99. package/src/blocks/scripts/consent-embed.ts +105 -0
  100. package/src/blocks/scripts/consent-manager.ts +112 -0
  101. package/src/blocks/scripts/consent-store.ts +86 -0
  102. package/src/blocks/scripts/error-page.ts +71 -0
  103. package/src/blocks/scripts/hours.ts +107 -0
  104. package/src/blocks/scripts/maintenance.ts +109 -0
  105. package/src/blocks/styles/blocks.css +1320 -0
  106. package/src/blocks/styles/consent.css +102 -0
  107. package/src/blocks/styles/faq.css +28 -0
  108. package/src/blocks/styles/location.css +92 -0
  109. package/src/blocks/styles/prose-section.css +13 -0
  110. package/src/blocks/styles/quotes.css +123 -0
  111. package/src/blocks/styles/rich-text.css +14 -0
  112. package/src/blocks/types.ts +293 -0
  113. package/src/data/ChartAxis.astro +19 -0
  114. package/src/data/ChartContainer.astro +152 -0
  115. package/src/data/ChartLegend.astro +25 -0
  116. package/src/data/ChartSeries.astro +14 -0
  117. package/src/data/ChartTable.astro +17 -0
  118. package/src/data/ChartTooltip.astro +20 -0
  119. package/src/data/Sparkline.astro +55 -0
  120. package/src/data/cms.ts +130 -0
  121. package/src/data/index.ts +10 -0
  122. package/src/data/internal/scale.ts +107 -0
  123. package/src/data/lib/chart.ts +459 -0
  124. package/src/data/lib/render.ts +219 -0
  125. package/src/data/lib/sparkline.ts +117 -0
  126. package/src/data/schema.ts +65 -0
  127. package/src/data/scripts/chart.ts +324 -0
  128. package/src/data/styles/chart.css +392 -0
  129. package/src/finishes/aurora.css +75 -0
  130. package/src/finishes/autumn.css +87 -0
  131. package/src/finishes/blueprint.css +69 -0
  132. package/src/finishes/brutalist.css +55 -0
  133. package/src/finishes/clay.css +48 -0
  134. package/src/finishes/day-cycle.css +46 -0
  135. package/src/finishes/fog.css +71 -0
  136. package/src/finishes/glass.css +149 -0
  137. package/src/finishes/holographic.css +91 -0
  138. package/src/finishes/night.css +77 -0
  139. package/src/finishes/paper.css +58 -0
  140. package/src/finishes/polished-glass.css +159 -0
  141. package/src/finishes/rain.css +84 -0
  142. package/src/finishes/scripts/day-cycle.ts +30 -0
  143. package/src/finishes/scripts/holographic.ts +37 -0
  144. package/src/finishes/scripts/spotlight.ts +30 -0
  145. package/src/finishes/spotlight.css +41 -0
  146. package/src/finishes/spring.css +80 -0
  147. package/src/finishes/terminal.css +49 -0
  148. package/src/motion/Marquee.astro +90 -0
  149. package/src/motion/MotionProvider.astro +50 -0
  150. package/src/motion/PageTransitions.astro +61 -0
  151. package/src/motion/Parallax.astro +44 -0
  152. package/src/motion/ParallaxLayer.astro +31 -0
  153. package/src/motion/RevealOnScroll.astro +59 -0
  154. package/src/motion/SceneRegistry.astro +38 -0
  155. package/src/motion/ScrollScene.astro +81 -0
  156. package/src/motion/index.ts +12 -0
  157. package/src/motion/integration.ts +48 -0
  158. package/src/motion/runtime/page-transitions.ts +68 -0
  159. package/src/motion/runtime/runtime.ts +180 -0
  160. package/src/motion/runtime/scenes.ts +248 -0
  161. package/src/motion/runtime/types.ts +103 -0
  162. package/src/motion/styles/motion.css +332 -0
  163. package/src/motion/transitions.ts +74 -0
  164. package/src/motion/virtual.d.ts +4 -0
  165. package/src/primitives/Accordion.astro +129 -0
  166. package/src/primitives/Breadcrumbs.astro +50 -0
  167. package/src/primitives/BulletList.astro +69 -0
  168. package/src/primitives/Button.astro +73 -0
  169. package/src/primitives/ButtonGroup.astro +54 -0
  170. package/src/primitives/Callout.astro +137 -0
  171. package/src/primitives/Caption.astro +35 -0
  172. package/src/primitives/Card.astro +72 -0
  173. package/src/primitives/CardContent.astro +24 -0
  174. package/src/primitives/CardFooter.astro +36 -0
  175. package/src/primitives/CardHeader.astro +86 -0
  176. package/src/primitives/Checkbox.astro +38 -0
  177. package/src/primitives/ChoiceGroup.astro +23 -0
  178. package/src/primitives/Cluster.astro +49 -0
  179. package/src/primitives/Container.astro +44 -0
  180. package/src/primitives/DescriptionList.astro +83 -0
  181. package/src/primitives/Dialog.astro +38 -0
  182. package/src/primitives/Disclosure.astro +67 -0
  183. package/src/primitives/Divider.astro +93 -0
  184. package/src/primitives/Drawer.astro +33 -0
  185. package/src/primitives/Fieldset.astro +80 -0
  186. package/src/primitives/Flex.astro +64 -0
  187. package/src/primitives/FocusRing.astro +63 -0
  188. package/src/primitives/FocusTrap.astro +64 -0
  189. package/src/primitives/Footer.astro +155 -0
  190. package/src/primitives/Form.astro +68 -0
  191. package/src/primitives/FormDescription.astro +26 -0
  192. package/src/primitives/FormError.astro +106 -0
  193. package/src/primitives/FormField.astro +72 -0
  194. package/src/primitives/Grid.astro +64 -0
  195. package/src/primitives/Heading.astro +45 -0
  196. package/src/primitives/IconButton.astro +48 -0
  197. package/src/primitives/Image.astro +125 -0
  198. package/src/primitives/Input.astro +86 -0
  199. package/src/primitives/Label.astro +50 -0
  200. package/src/primitives/Link.astro +81 -0
  201. package/src/primitives/LinkButton.astro +66 -0
  202. package/src/primitives/List.astro +39 -0
  203. package/src/primitives/ListItem.astro +178 -0
  204. package/src/primitives/MediaObject.astro +66 -0
  205. package/src/primitives/MetricCard.astro +278 -0
  206. package/src/primitives/NavLink.astro +81 -0
  207. package/src/primitives/NavMenu.astro +109 -0
  208. package/src/primitives/Navbar.astro +197 -0
  209. package/src/primitives/Panel.astro +153 -0
  210. package/src/primitives/Picture.astro +167 -0
  211. package/src/primitives/Popover.astro +95 -0
  212. package/src/primitives/Prose.astro +45 -0
  213. package/src/primitives/Radio.astro +21 -0
  214. package/src/primitives/Rating.astro +135 -0
  215. package/src/primitives/ReducedMotion.astro +90 -0
  216. package/src/primitives/SegmentedControl.astro +132 -0
  217. package/src/primitives/Select.astro +109 -0
  218. package/src/primitives/Sheet.astro +45 -0
  219. package/src/primitives/SkipLink.astro +31 -0
  220. package/src/primitives/Slider.astro +186 -0
  221. package/src/primitives/Spacer.astro +35 -0
  222. package/src/primitives/Stack.astro +51 -0
  223. package/src/primitives/Surface.astro +70 -0
  224. package/src/primitives/Switch.astro +22 -0
  225. package/src/primitives/Table.astro +382 -0
  226. package/src/primitives/Tabs.astro +126 -0
  227. package/src/primitives/Text.astro +56 -0
  228. package/src/primitives/Textarea.astro +75 -0
  229. package/src/primitives/Thumbnail.astro +154 -0
  230. package/src/primitives/Toggle.astro +99 -0
  231. package/src/primitives/Tooltip.astro +50 -0
  232. package/src/primitives/VisuallyHidden.astro +29 -0
  233. package/src/primitives/index.ts +103 -0
  234. package/src/primitives/internal/AccordionScript.astro +7 -0
  235. package/src/primitives/internal/ChoiceField.astro +91 -0
  236. package/src/primitives/internal/FocusTrapScript.astro +8 -0
  237. package/src/primitives/internal/FormValidationScript.astro +10 -0
  238. package/src/primitives/internal/IndeterminateScript.astro +13 -0
  239. package/src/primitives/internal/ModalPanel.astro +114 -0
  240. package/src/primitives/internal/OverlayScript.astro +7 -0
  241. package/src/primitives/internal/ReducedMotionScript.astro +7 -0
  242. package/src/primitives/internal/SliderScript.astro +7 -0
  243. package/src/primitives/internal/SparklineScript.astro +7 -0
  244. package/src/primitives/internal/TableSortScript.astro +7 -0
  245. package/src/primitives/internal/TabsScript.astro +7 -0
  246. package/src/primitives/internal/TooltipScript.astro +7 -0
  247. package/src/primitives/internal/image-plan.ts +82 -0
  248. package/src/primitives/internal/image.ts +129 -0
  249. package/src/primitives/internal/slider.ts +170 -0
  250. package/src/primitives/lib/deprecate.ts +47 -0
  251. package/src/primitives/lib/focus-trap.ts +197 -0
  252. package/src/primitives/lib/focus.ts +60 -0
  253. package/src/primitives/lib/motion.ts +68 -0
  254. package/src/primitives/scripts/accordion.ts +123 -0
  255. package/src/primitives/scripts/form-validation.ts +225 -0
  256. package/src/primitives/scripts/overlay.ts +71 -0
  257. package/src/primitives/scripts/reduced-motion.ts +59 -0
  258. package/src/primitives/scripts/slider.ts +150 -0
  259. package/src/primitives/scripts/sparkline.ts +131 -0
  260. package/src/primitives/scripts/table-sort.ts +68 -0
  261. package/src/primitives/scripts/tabs.ts +151 -0
  262. package/src/primitives/scripts/tooltip.ts +28 -0
  263. package/src/primitives/styles/a11y.css +104 -0
  264. package/src/primitives/styles/accordion.css +53 -0
  265. package/src/primitives/styles/breadcrumbs.css +59 -0
  266. package/src/primitives/styles/bullet-list.css +89 -0
  267. package/src/primitives/styles/button.css +237 -0
  268. package/src/primitives/styles/choice.css +164 -0
  269. package/src/primitives/styles/cluster.css +24 -0
  270. package/src/primitives/styles/container.css +19 -0
  271. package/src/primitives/styles/data.css +849 -0
  272. package/src/primitives/styles/disclosure.css +140 -0
  273. package/src/primitives/styles/divider.css +50 -0
  274. package/src/primitives/styles/flex.css +42 -0
  275. package/src/primitives/styles/form.css +241 -0
  276. package/src/primitives/styles/grid.css +36 -0
  277. package/src/primitives/styles/media.css +247 -0
  278. package/src/primitives/styles/nav.css +792 -0
  279. package/src/primitives/styles/overlay.css +362 -0
  280. package/src/primitives/styles/prose.css +146 -0
  281. package/src/primitives/styles/scale.css +175 -0
  282. package/src/primitives/styles/segmented.css +165 -0
  283. package/src/primitives/styles/slider.css +170 -0
  284. package/src/primitives/styles/spacer.css +17 -0
  285. package/src/primitives/styles/stack.css +25 -0
  286. package/src/primitives/styles/surface.css +403 -0
  287. package/src/primitives/styles/tabs.css +223 -0
  288. package/src/primitives/styles/typography.css +144 -0
  289. package/src/primitives/styles/utilities.css +24 -0
  290. package/src/primitives/types.ts +385 -0
  291. package/src/primitives/utils.ts +254 -0
  292. package/src/seo/JSONLD.astro +35 -0
  293. package/src/seo/SEOHead.astro +47 -0
  294. package/src/seo/cms.ts +59 -0
  295. package/src/seo/index.ts +10 -0
  296. package/src/seo/integration.ts +268 -0
  297. package/src/seo/internal/url.ts +68 -0
  298. package/src/seo/lib/jsonld.ts +342 -0
  299. package/src/seo/lib/meta.ts +205 -0
  300. package/src/seo/lib/redirects.ts +293 -0
  301. package/src/seo/lib/robots.ts +33 -0
  302. package/src/seo/lib/rss.ts +98 -0
  303. package/src/seo/lib/sitemap.ts +105 -0
  304. package/src/seo/schema.ts +43 -0
  305. package/src/tokens/base.css +71 -0
  306. package/src/tokens/tokens.css +210 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,89 @@
1
+ # @sinnstack/ui
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 447a3ed: **SinnStackCMS schemas ship with the library.** Sites no longer hand-write a schema per block in `sinnstack.config.ts`.
8
+
9
+ - `@sinnstack/ui/blocks/schema`: `blockSchemas` (all 19 blocks, keyed by `_template`, for `fields.blocks({ types: blockSchemas })`), one export per block (`heroSchema`…), and the site settings the blocks read: `topbarSchema`, `consentSchema`, `errorPagesSchema` (together as `siteSettingsFields`). `withoutFields(schema, keys)` hides fields. Helpers for site blocks: `settingsField(keys)`, `actionsField(max)` and `blockSchema<Data>()`.
10
+ - `@sinnstack/ui/seo/schema`: `seoSchema` and `redirectsSchema`. `@sinnstack/ui/data/schema`: `chartSchema` and `sparklineSchema`. These replace the Tina `seoField`, `redirectsField`, `chartField` and `sparklineField`.
11
+ - The schemas are plain JSON in the CMS's field format, with no dependency on `@sinnstack/cms`. They're typed against the stored data shapes, so `astro check` fails on a field, field kind or select option a mapper doesn't read. A unit test checks that every block has a schema, that each block's settings match what its mapper reads, and that the defaults and fixtures fit.
12
+ - `seoProps(seo, fallback, { resolveImage })`: pass BlockRenderer's resolver so a share image picked in the CMS (`/src/assets/share.jpg`) becomes the built asset, cropped to 1200×630. Before, the path went out as a literal `og:image` URL, which 404s in production.
13
+ - **Rich text is Markdown.** Strings passed to RichText, ProseSection's `body` and FAQ answers are parsed as Markdown (headings, lists, quotes, code, tables, images, bold/italic/strike, links) into the same allowlisted node tree, so raw HTML still shows as text and unsafe URLs are still dropped. The schemas use SinnStackCMS's `markdown` field. Plain text is valid Markdown and renders as before, unless it contains Markdown syntax such as a line starting with `- ` or `1. `, or `*stars*`. Rich-text trees still render. `@sinnstack/ui/blocks/markdown` exports `markdownToRichText` and `richTextToMarkdown`: use the latter to move stored trees (e.g. from TinaCMS) into Markdown, which the CMS can edit.
14
+
15
+ - 447a3ed: **Breaking: TinaCMS support removed; the blocks now target SinnStackCMS.** The data → props mappers, data shapes, defaults, fixtures, `createImageResolver`, `topbarProps`, `consentProps`, `errorPageProps`, `seoProps`, `redirectMapFromCms` and `chartFromCms` are unchanged, and stored content keeps working.
16
+
17
+ - **Removed (Tina schema objects):** every `*Template` export and `blockTemplates` from `@sinnstack/ui/blocks/cms`, plus `settingsField`, `actionsField`, `topbarField`, `consentField`, `errorPagesField`, `maintenanceField`, and the `TinaField` / `TinaTemplate` / `TinaOption` types; `chartField` and `sparklineField` from `@sinnstack/ui/data/cms`; `seoField` and `redirectsField` from `@sinnstack/ui/seo/cms`. Block schemas now live in the site's `sinnstack.config.ts`.
18
+ - **`templateName` reads `_template` only.** Tina's GraphQL `__typename` is no longer recognised.
19
+ - **Click-to-edit is now `data-sinn-field`.** The blocks' `tina` prop (and the `TinaSource` type) is replaced by `fieldPath`. Pass `<BlockRenderer fieldPath="blocks">` in CMS previews and each section, field and list item gets its path in the content entry (`blocks.2`, `blocks.2.heading`, `blocks.2.items.0`). Item paths are the stored indices even when the mapper skips empty items. Without `fieldPath` nothing is annotated, so production HTML no longer carries editing attributes.
20
+ - Mapped list items and actions carry a `field` key (their path relative to the block). Plain prop usage can ignore it.
21
+ - `docs/tina.md` is gone; the CMS sections of the docs describe the stored data shapes instead.
22
+
23
+ - 1746514: Add finishes, a second theming choice next to palettes: a rendering style that works on top of any palette. Finishes are opt-in stylesheets under `@sinnstack/ui/finishes/<name>.css`, switched on with `<html data-finish="…">`; without the attribute nothing changes.
24
+
25
+ - **Glass** (`@sinnstack/ui/finishes/glass.css`, `data-finish="glass"`): frosted, translucent cards, panels, dialogs, popovers, navbar and footer over a soft backdrop drawn from the palette's accent colours. Tunable with `--sinn-finish-glass-*` tokens. Falls back to solid surfaces under `prefers-reduced-transparency: reduce` and in browsers without `backdrop-filter`.
26
+ - **Polished glass** (`@sinnstack/ui/finishes/polished-glass.css`, `data-finish="polished-glass"`): the bold version. Clear glass panels with a translucent rim, top highlight, drop shadow and strong blur, floating over a dimmed scene: the site's own image (`--sinn-finish-polished-glass-image`) or gradients from the palette's accent colours. Dark only: it sets `color-scheme: dark`, so every palette shows its own dark side and its dark-side contrast checks still hold.
27
+ - **Scene finishes** (`aurora`, `autumn`, `rain`, `fog`): decorative layers behind the page, gradients only, animated by transform, still under reduced motion. Aurora drifts blobs of the palette's `accent-soft`; Fog drifts bands of its `neutral-soft` (both fills palettes already guarantee text on); Autumn drops leaves under a warm glow and Rain slants streaks under a cool cast, in their own colours at low opacity, exposed as `--sinn-finish-*` tokens. Combine one scene with a glass finish: `data-finish="glass aurora"`.
28
+ - **Surface finishes** (`brutalist`, `clay`, `blueprint`, `paper`): Brutalist (square corners, thick borders and hard offset shadows in the text colour, buttons that press in), Soft / clay (large radii, layered soft shadows, borderless panels), Blueprint (a drafting grid from the palette's border tokens, thin borders, no shadows), Paper / print (fine grain and letterpress headings; the warm colours stay with the Paper palette).
29
+ - **Interactive finishes** (`spotlight`, `holographic`, `day-cycle`), each with a small optional script at `@sinnstack/ui/finishes/scripts/<name>` that only sets that finish's `--sinn-finish-*` variables: Spotlight (accent-soft light behind the page following the pointer), Holographic edges (an iridescent ring on hovered cards, its sheen turning toward the pointer), Day cycle (warm light placed by the visitor's local time, a faint cool glow at night).
30
+ - **More finishes:** Night (a dark-only starfield twinkling slowly, opacity-only), Spring (petals and pollen drifting in pale light), Terminal / CRT (faint scanlines and a phosphor glow in each element's own text colour; no flicker, off with `prefers-contrast: more`, forced colours and print).
31
+ - **Finish contract:** finishes may also set the library's non-colour tokens (radius, border width, shadow shapes, focus width), scoped to the finish; @keyframes are named `sinn-finish-<name>-*`.
32
+ a finish never declares a `--sinn-color-*` token and every rule is scoped to its `data-finish` value. `test/finishes/finish-contract.unit.mjs` enforces this.
33
+ - New guide: `docs/finishes.md`.
34
+
35
+ ### Patch Changes
36
+
37
+ - 447a3ed: SinnStackCMS compatibility.
38
+
39
+ - `safeHref` refuses a scheme with nothing after it (`https://`, `mailto:`, `tel:`, `sms:`), which rendered as a link to nowhere. The CMS's link check refuses the same values, and accepts `sms:` links and `tel:` links with an extension (`;ext=12`) or letters (`1-800-FLOWERS`), which the blocks render.
40
+ - LocationHours' "Map embed URL" field is a text field that must start with `https://`. It was a link field, so the CMS accepted page paths the block then ignored, leaving no map.
41
+
42
+ - 563c4f6: Fixes for static redirects, the Maintenance page notice, and type checking.
43
+
44
+ - **Redirects with params in static builds.** `sinnSeo` no longer breaks a static build with a redirect that has params (`/news/[slug]` → `/blog/[slug]`) when there's no page at the destination route. Astro builds those redirects from the destination page's `getStaticPaths` and failed with "getStaticPaths required" without one. The integration now leaves such a rule out of Astro's config and logs a warning naming it; the rule stays in the `RedirectMap` for `toRedirectsFile()`, `toVercel()` and the middleware. `output: 'server'` sites are unchanged.
45
+ - **MaintenancePage `noticeTone`.** It now takes every Callout tone (`info`, `success`, `warning`, `danger`, `neutral`). `accent`, which Callout never had, is deprecated and maps to `info`: before, an `accent` notice looked like `info` but lost its screen-reader prefix ("Note:").
46
+ - **`astro check` passes on the package (79 errors → 0).**
47
+ - MetricCard: `value! / target!` made the language server's .astro parser (`@astrojs/astro2tsx`) read a regex and miss the closing `---`, so the whole template was checked as TypeScript. Rewritten as `(value as number) / (target as number)`; builds were never affected.
48
+ - Table: the stacked layout's `role` helper now returns ARIA role names instead of `string`.
49
+ - LocationHours script: open/closed status is narrowed with `in`, which works without `strictNullChecks` (Astro's base tsconfig leaves it off).
50
+ - Input, Select, Textarea: `required` is passed to FormField as a boolean.
51
+ - Checkbox, Radio and Switch (`aria-invalid`), Divider (`role`), Image and Picture (`fetchpriority`): attribute values keep their literal types.
52
+ - **Input, Select, Textarea, Checkbox, Radio and Switch with `id={null}`** now generate an id, as they do when `id` is left out. Before, `null` got past the default and the description and error ids became `null-desc` and `null-error`.
53
+ - **The package is type-checked with Astro's `strict` preset.** The only changes it needed: the null id handling above, and `FormField`'s `class` and the blocks' `id` accepting `null`, which is how Astro types a missing attribute.
54
+ - **Internal:** private helpers moved from `lib/` to `internal/`, and the `exports` map uses one pattern per module for `lib/` helpers, with a test that checks every entry. Import paths are unchanged.
55
+
56
+ - 447a3ed: Fixes from a library-wide review.
57
+
58
+ - **Security: CMS links are checked everywhere.** Buttons (`actions`), feature, card and logo links, breadcrumbs, error-page links and a chart's source link now pass `safeHref`, like contact, topbar, review and rich-text links already did. Before, a stored `javascript:` URL in those fields rendered as a working link. `safeHref` also refuses values with control characters (`java<tab>script:` runs as `javascript:` in browsers) or backslashes, and protocol-relative `//host` links.
59
+ - **Security: CSV downloads.** Chart table cells that start like a spreadsheet formula (`=`, `+`, `-`, `@`) get a leading `'`, so opening the CSV can't run a formula from CMS text.
60
+ - StatsBand's mapper only accepts icon names from the icon set, like the other blocks. The component checks its own keys, so an icon named `constructor` can't print function source.
61
+ - FAQ answers carry `data-sinn-field` paths (`blocks.N.items.M.answer`) in CMS previews.
62
+ - Charts without an `id` get a sequential id instead of a random one, so identical builds produce identical HTML.
63
+ - Schemas: ProseSection's "Narrow column" and CTAPair's "Full width" checkboxes default to on, matching the components. A unit test keeps checkbox defaults in step with component defaults.
64
+ - Type contract: each registry mapper's output is checked against its component's props (`astro check`). The FeatureGrid, CardGrid and LogoCloud mappers now type their items.
65
+ - Docs: the FocusRing example no longer suggests `set:html` for CMS content.
66
+
67
+ - 447a3ed: Fixes from a second library review.
68
+
69
+ - **Security: open redirect in `RedirectMap.resolve` / `createRedirectMiddleware`.** Param values taken from the request path were put into the destination decoded, so with a rule like `/old/[slug]` → `/[slug]`, a request for `/old/%5Cevil.com` redirected to `/\evil.com`, which browsers follow to `evil.com`. Param values are now re-encoded (`\` becomes `%5C`; existing escapes are kept), and `$` sequences in them are no longer read as replacement patterns.
70
+ - `RedirectMap` reports a rule with an invalid full URL (e.g. a CSV row with `https://old site.com/x`) as an error instead of throwing from the constructor, so the other rules still load.
71
+ - `safeMediaUrl` (rich-text images) refuses backslashes and control characters, like `safeHref`.
72
+ - Charts: numeric `x` values (`[2019, 2020, 2021]`) are categories, not milliseconds since 1970. Before, a line chart of years showed every point as "1970" with no x labels. Pass `xType: 'time'` to have numbers read as timestamps.
73
+ - Text with `$&`, `` $` `` or `$'` in it no longer gets mangled when it fills a template: SEO titles (`titleTemplate`), LocationHours' map title and "Open in" link, ConsentEmbed's notice, Testimonials' "Read on {source}" and the Table sort announcement.
74
+
75
+ - 447a3ed: `service()` JSON-LD keeps the URL's fragment in its `@id`: `/services/#brakes` is `/services/#service-brakes`. It used to drop the fragment, so several services listed on one page all got `/services/#service` and search engines merged them into one node.
76
+
77
+ ## 0.2.0
78
+
79
+ ### Minor Changes
80
+
81
+ - The six 0.1 packages are now one package, `@sinnstack/ui`. Components, props, CSS and CMS fields are unchanged; only the import paths move.
82
+
83
+ - **New import paths.** `@sinnstack/tokens/tokens.css` and `base.css` become `@sinnstack/ui/tokens.css` and `@sinnstack/ui/base.css`. Every other entry keeps its name under its group: `@sinnstack/primitives/Button.astro` → `@sinnstack/ui/primitives/Button.astro`, `@sinnstack/blocks/cms` → `@sinnstack/ui/blocks/cms`, `@sinnstack/seo/integration` → `@sinnstack/ui/seo/integration`, and the same for `data` and `motion`. There is no root `@sinnstack/ui` import; import components from their own files.
84
+ - **Optional motion dependencies.** `gsap` and `lenis` are optional peer dependencies, so sites that don't use the motion group's scroll scenes or smooth scrolling don't install them. Sites that do use them run `pnpm add gsap lenis`. `lenis` was a regular dependency of `@sinnstack/motion` before.
85
+ - **Internal imports are relative.** The groups import each other by relative path, so the library resolves and type-checks as one unit. Blocks and charts no longer report unresolved `@sinnstack/primitives` imports under `astro check`.
86
+ - **One README** with install steps and a quickstart, and the six package READMEs move to `docs/` as the per-group guides.
87
+ - **Contrast checker** moves to `node_modules/@sinnstack/ui/scripts/check-contrast.mjs`.
88
+
89
+ To upgrade, replace the `@sinnstack/*` dependencies with `@sinnstack/ui` and find and replace `@sinnstack/tokens/` with `@sinnstack/ui/`, and `@sinnstack/primitives`, `blocks`, `seo`, `data` and `motion` with `@sinnstack/ui/primitives` and so on.
package/LICENSE ADDED
@@ -0,0 +1,373 @@
1
+ Mozilla Public License Version 2.0
2
+ ==================================
3
+
4
+ 1. Definitions
5
+ --------------
6
+
7
+ 1.1. "Contributor"
8
+ means each individual or legal entity that creates, contributes to
9
+ the creation of, or owns Covered Software.
10
+
11
+ 1.2. "Contributor Version"
12
+ means the combination of the Contributions of others (if any) used
13
+ by a Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+ means Covered Software of a particular Contributor.
17
+
18
+ 1.4. "Covered Software"
19
+ means Source Code Form to which the initial Contributor has attached
20
+ the notice in Exhibit A, the Executable Form of such Source Code
21
+ Form, and Modifications of such Source Code Form, in each case
22
+ including portions thereof.
23
+
24
+ 1.5. "Incompatible With Secondary Licenses"
25
+ means
26
+
27
+ (a) that the initial Contributor has attached the notice described
28
+ in Exhibit B to the Covered Software; or
29
+
30
+ (b) that the Covered Software was made available under the terms of
31
+ version 1.1 or earlier of the License, but not also under the
32
+ terms of a Secondary License.
33
+
34
+ 1.6. "Executable Form"
35
+ means any form of the work other than Source Code Form.
36
+
37
+ 1.7. "Larger Work"
38
+ means a work that combines Covered Software with other material, in
39
+ a separate file or files, that is not Covered Software.
40
+
41
+ 1.8. "License"
42
+ means this document.
43
+
44
+ 1.9. "Licensable"
45
+ means having the right to grant, to the maximum extent possible,
46
+ whether at the time of the initial grant or subsequently, any and
47
+ all of the rights conveyed by this License.
48
+
49
+ 1.10. "Modifications"
50
+ means any of the following:
51
+
52
+ (a) any file in Source Code Form that results from an addition to,
53
+ deletion from, or modification of the contents of Covered
54
+ Software; or
55
+
56
+ (b) any new file in Source Code Form that contains any Covered
57
+ Software.
58
+
59
+ 1.11. "Patent Claims" of a Contributor
60
+ means any patent claim(s), including without limitation, method,
61
+ process, and apparatus claims, in any patent Licensable by such
62
+ Contributor that would be infringed, but for the grant of the
63
+ License, by the making, using, selling, offering for sale, having
64
+ made, import, or transfer of either its Contributions or its
65
+ Contributor Version.
66
+
67
+ 1.12. "Secondary License"
68
+ means either the GNU General Public License, Version 2.0, the GNU
69
+ Lesser General Public License, Version 2.1, the GNU Affero General
70
+ Public License, Version 3.0, or any later versions of those
71
+ licenses.
72
+
73
+ 1.13. "Source Code Form"
74
+ means the form of the work preferred for making modifications.
75
+
76
+ 1.14. "You" (or "Your")
77
+ means an individual or a legal entity exercising rights under this
78
+ License. For legal entities, "You" includes any entity that
79
+ controls, is controlled by, or is under common control with You. For
80
+ purposes of this definition, "control" means (a) the power, direct
81
+ or indirect, to cause the direction or management of such entity,
82
+ whether by contract or otherwise, or (b) ownership of more than
83
+ fifty percent (50%) of the outstanding shares or beneficial
84
+ ownership of such entity.
85
+
86
+ 2. License Grants and Conditions
87
+ --------------------------------
88
+
89
+ 2.1. Grants
90
+
91
+ Each Contributor hereby grants You a world-wide, royalty-free,
92
+ non-exclusive license:
93
+
94
+ (a) under intellectual property rights (other than patent or trademark)
95
+ Licensable by such Contributor to use, reproduce, make available,
96
+ modify, display, perform, distribute, and otherwise exploit its
97
+ Contributions, either on an unmodified basis, with Modifications, or
98
+ as part of a Larger Work; and
99
+
100
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
101
+ for sale, have made, import, and otherwise transfer either its
102
+ Contributions or its Contributor Version.
103
+
104
+ 2.2. Effective Date
105
+
106
+ The licenses granted in Section 2.1 with respect to any Contribution
107
+ become effective for each Contribution on the date the Contributor first
108
+ distributes such Contribution.
109
+
110
+ 2.3. Limitations on Grant Scope
111
+
112
+ The licenses granted in this Section 2 are the only rights granted under
113
+ this License. No additional rights or licenses will be implied from the
114
+ distribution or licensing of Covered Software under this License.
115
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
116
+ Contributor:
117
+
118
+ (a) for any code that a Contributor has removed from Covered Software;
119
+ or
120
+
121
+ (b) for infringements caused by: (i) Your and any other third party's
122
+ modifications of Covered Software, or (ii) the combination of its
123
+ Contributions with other software (except as part of its Contributor
124
+ Version); or
125
+
126
+ (c) under Patent Claims infringed by Covered Software in the absence of
127
+ its Contributions.
128
+
129
+ This License does not grant any rights in the trademarks, service marks,
130
+ or logos of any Contributor (except as may be necessary to comply with
131
+ the notice requirements in Section 3.4).
132
+
133
+ 2.4. Subsequent Licenses
134
+
135
+ No Contributor makes additional grants as a result of Your choice to
136
+ distribute the Covered Software under a subsequent version of this
137
+ License (see Section 10.2) or under the terms of a Secondary License (if
138
+ permitted under the terms of Section 3.3).
139
+
140
+ 2.5. Representation
141
+
142
+ Each Contributor represents that the Contributor believes its
143
+ Contributions are its original creation(s) or it has sufficient rights
144
+ to grant the rights to its Contributions conveyed by this License.
145
+
146
+ 2.6. Fair Use
147
+
148
+ This License is not intended to limit any rights You have under
149
+ applicable copyright doctrines of fair use, fair dealing, or other
150
+ equivalents.
151
+
152
+ 2.7. Conditions
153
+
154
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155
+ in Section 2.1.
156
+
157
+ 3. Responsibilities
158
+ -------------------
159
+
160
+ 3.1. Distribution of Source Form
161
+
162
+ All distribution of Covered Software in Source Code Form, including any
163
+ Modifications that You create or to which You contribute, must be under
164
+ the terms of this License. You must inform recipients that the Source
165
+ Code Form of the Covered Software is governed by the terms of this
166
+ License, and how they can obtain a copy of this License. You may not
167
+ attempt to alter or restrict the recipients' rights in the Source Code
168
+ Form.
169
+
170
+ 3.2. Distribution of Executable Form
171
+
172
+ If You distribute Covered Software in Executable Form then:
173
+
174
+ (a) such Covered Software must also be made available in Source Code
175
+ Form, as described in Section 3.1, and You must inform recipients of
176
+ the Executable Form how they can obtain a copy of such Source Code
177
+ Form by reasonable means in a timely manner, at a charge no more
178
+ than the cost of distribution to the recipient; and
179
+
180
+ (b) You may distribute such Executable Form under the terms of this
181
+ License, or sublicense it under different terms, provided that the
182
+ license for the Executable Form does not attempt to limit or alter
183
+ the recipients' rights in the Source Code Form under this License.
184
+
185
+ 3.3. Distribution of a Larger Work
186
+
187
+ You may create and distribute a Larger Work under terms of Your choice,
188
+ provided that You also comply with the requirements of this License for
189
+ the Covered Software. If the Larger Work is a combination of Covered
190
+ Software with a work governed by one or more Secondary Licenses, and the
191
+ Covered Software is not Incompatible With Secondary Licenses, this
192
+ License permits You to additionally distribute such Covered Software
193
+ under the terms of such Secondary License(s), so that the recipient of
194
+ the Larger Work may, at their option, further distribute the Covered
195
+ Software under the terms of either this License or such Secondary
196
+ License(s).
197
+
198
+ 3.4. Notices
199
+
200
+ You may not remove or alter the substance of any license notices
201
+ (including copyright notices, patent notices, disclaimers of warranty,
202
+ or limitations of liability) contained within the Source Code Form of
203
+ the Covered Software, except that You may alter any license notices to
204
+ the extent required to remedy known factual inaccuracies.
205
+
206
+ 3.5. Application of Additional Terms
207
+
208
+ You may choose to offer, and to charge a fee for, warranty, support,
209
+ indemnity or liability obligations to one or more recipients of Covered
210
+ Software. However, You may do so only on Your own behalf, and not on
211
+ behalf of any Contributor. You must make it absolutely clear that any
212
+ such warranty, support, indemnity, or liability obligation is offered by
213
+ You alone, and You hereby agree to indemnify every Contributor for any
214
+ liability incurred by such Contributor as a result of warranty, support,
215
+ indemnity or liability terms You offer. You may include additional
216
+ disclaimers of warranty and limitations of liability specific to any
217
+ jurisdiction.
218
+
219
+ 4. Inability to Comply Due to Statute or Regulation
220
+ ---------------------------------------------------
221
+
222
+ If it is impossible for You to comply with any of the terms of this
223
+ License with respect to some or all of the Covered Software due to
224
+ statute, judicial order, or regulation then You must: (a) comply with
225
+ the terms of this License to the maximum extent possible; and (b)
226
+ describe the limitations and the code they affect. Such description must
227
+ be placed in a text file included with all distributions of the Covered
228
+ Software under this License. Except to the extent prohibited by statute
229
+ or regulation, such description must be sufficiently detailed for a
230
+ recipient of ordinary skill to be able to understand it.
231
+
232
+ 5. Termination
233
+ --------------
234
+
235
+ 5.1. The rights granted under this License will terminate automatically
236
+ if You fail to comply with any of its terms. However, if You become
237
+ compliant, then the rights granted under this License from a particular
238
+ Contributor are reinstated (a) provisionally, unless and until such
239
+ Contributor explicitly and finally terminates Your grants, and (b) on an
240
+ ongoing basis, if such Contributor fails to notify You of the
241
+ non-compliance by some reasonable means prior to 60 days after You have
242
+ come back into compliance. Moreover, Your grants from a particular
243
+ Contributor are reinstated on an ongoing basis if such Contributor
244
+ notifies You of the non-compliance by some reasonable means, this is the
245
+ first time You have received notice of non-compliance with this License
246
+ from such Contributor, and You become compliant prior to 30 days after
247
+ Your receipt of the notice.
248
+
249
+ 5.2. If You initiate litigation against any entity by asserting a patent
250
+ infringement claim (excluding declaratory judgment actions,
251
+ counter-claims, and cross-claims) alleging that a Contributor Version
252
+ directly or indirectly infringes any patent, then the rights granted to
253
+ You by any and all Contributors for the Covered Software under Section
254
+ 2.1 of this License shall terminate.
255
+
256
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257
+ end user license agreements (excluding distributors and resellers) which
258
+ have been validly granted by You or Your distributors under this License
259
+ prior to termination shall survive termination.
260
+
261
+ ************************************************************************
262
+ * *
263
+ * 6. Disclaimer of Warranty *
264
+ * ------------------------- *
265
+ * *
266
+ * Covered Software is provided under this License on an "as is" *
267
+ * basis, without warranty of any kind, either expressed, implied, or *
268
+ * statutory, including, without limitation, warranties that the *
269
+ * Covered Software is free of defects, merchantable, fit for a *
270
+ * particular purpose or non-infringing. The entire risk as to the *
271
+ * quality and performance of the Covered Software is with You. *
272
+ * Should any Covered Software prove defective in any respect, You *
273
+ * (not any Contributor) assume the cost of any necessary servicing, *
274
+ * repair, or correction. This disclaimer of warranty constitutes an *
275
+ * essential part of this License. No use of any Covered Software is *
276
+ * authorized under this License except under this disclaimer. *
277
+ * *
278
+ ************************************************************************
279
+
280
+ ************************************************************************
281
+ * *
282
+ * 7. Limitation of Liability *
283
+ * -------------------------- *
284
+ * *
285
+ * Under no circumstances and under no legal theory, whether tort *
286
+ * (including negligence), contract, or otherwise, shall any *
287
+ * Contributor, or anyone who distributes Covered Software as *
288
+ * permitted above, be liable to You for any direct, indirect, *
289
+ * special, incidental, or consequential damages of any character *
290
+ * including, without limitation, damages for lost profits, loss of *
291
+ * goodwill, work stoppage, computer failure or malfunction, or any *
292
+ * and all other commercial damages or losses, even if such party *
293
+ * shall have been informed of the possibility of such damages. This *
294
+ * limitation of liability shall not apply to liability for death or *
295
+ * personal injury resulting from such party's negligence to the *
296
+ * extent applicable law prohibits such limitation. Some *
297
+ * jurisdictions do not allow the exclusion or limitation of *
298
+ * incidental or consequential damages, so this exclusion and *
299
+ * limitation may not apply to You. *
300
+ * *
301
+ ************************************************************************
302
+
303
+ 8. Litigation
304
+ -------------
305
+
306
+ Any litigation relating to this License may be brought only in the
307
+ courts of a jurisdiction where the defendant maintains its principal
308
+ place of business and such litigation shall be governed by laws of that
309
+ jurisdiction, without reference to its conflict-of-law provisions.
310
+ Nothing in this Section shall prevent a party's ability to bring
311
+ cross-claims or counter-claims.
312
+
313
+ 9. Miscellaneous
314
+ ----------------
315
+
316
+ This License represents the complete agreement concerning the subject
317
+ matter hereof. If any provision of this License is held to be
318
+ unenforceable, such provision shall be reformed only to the extent
319
+ necessary to make it enforceable. Any law or regulation which provides
320
+ that the language of a contract shall be construed against the drafter
321
+ shall not be used to construe this License against a Contributor.
322
+
323
+ 10. Versions of the License
324
+ ---------------------------
325
+
326
+ 10.1. New Versions
327
+
328
+ Mozilla Foundation is the license steward. Except as provided in Section
329
+ 10.3, no one other than the license steward has the right to modify or
330
+ publish new versions of this License. Each version will be given a
331
+ distinguishing version number.
332
+
333
+ 10.2. Effect of New Versions
334
+
335
+ You may distribute the Covered Software under the terms of the version
336
+ of the License under which You originally received the Covered Software,
337
+ or under the terms of any subsequent version published by the license
338
+ steward.
339
+
340
+ 10.3. Modified Versions
341
+
342
+ If you create software not governed by this License, and you want to
343
+ create a new license for such software, you may create and use a
344
+ modified version of this License if you rename the license and remove
345
+ any references to the name of the license steward (except to note that
346
+ such modified license differs from this License).
347
+
348
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
349
+ Licenses
350
+
351
+ If You choose to distribute Source Code Form that is Incompatible With
352
+ Secondary Licenses under the terms of this version of the License, the
353
+ notice described in Exhibit B of this License must be attached.
354
+
355
+ Exhibit A - Source Code Form License Notice
356
+ -------------------------------------------
357
+
358
+ This Source Code Form is subject to the terms of the Mozilla Public
359
+ License, v. 2.0. If a copy of the MPL was not distributed with this
360
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
361
+
362
+ If it is not possible or desirable to put the notice in a particular
363
+ file, then You may include the notice in a location (such as a LICENSE
364
+ file in a relevant directory) where a recipient would be likely to look
365
+ for such a notice.
366
+
367
+ You may add additional accurate notices of copyright ownership.
368
+
369
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
370
+ ---------------------------------------------------------
371
+
372
+ This Source Code Form is "Incompatible With Secondary Licenses", as
373
+ defined by the Mozilla Public License, v. 2.0.
package/README.md CHANGED
@@ -1,3 +1,189 @@
1
- # Temporary Holding Version
1
+ # @sinnstack/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Astro components and design tokens for fast, accessible marketing sites.
4
+
5
+ - **Primitives**: layout, typography, buttons, form controls, cards, navigation, dialogs, tables and media.
6
+ - **Blocks**: ready-made page sections (Hero, FeatureGrid, FAQ, Testimonials, ContactForm, LocationHours and more), cookie consent, and 404 and maintenance pages, with CMS data mappers for SinnStackCMS.
7
+ - **SEO**: head tags, JSON-LD, sitemaps, RSS, robots.txt and redirects.
8
+ - **Data**: SVG charts and sparklines that work without JavaScript.
9
+ - **Motion** (optional): scroll reveals, parallax, marquees, page transitions and GSAP scroll scenes.
10
+
11
+ Everything renders static HTML on the server and works under a strict Content Security Policy. Pages only get JavaScript for features that need it.
12
+
13
+ ## Install
14
+
15
+ Requires Astro 5.10 or later.
16
+
17
+ ```sh
18
+ pnpm add @sinnstack/ui
19
+ ```
20
+
21
+ `npm install @sinnstack/ui` and `yarn add @sinnstack/ui` work too.
22
+
23
+ ## Quickstart
24
+
25
+ **1. Load the tokens once, in your root layout.**
26
+
27
+ ```astro
28
+ ---
29
+ // src/layouts/Base.astro
30
+ import '@sinnstack/ui/tokens.css';
31
+ import '@sinnstack/ui/base.css'; // optional page baseline; skip it if you have your own reset
32
+
33
+ const { title } = Astro.props;
34
+ ---
35
+ <html lang="en">
36
+ <head>
37
+ <meta charset="utf-8" />
38
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
39
+ <title>{title}</title>
40
+ </head>
41
+ <body>
42
+ <main id="main"><slot /></main>
43
+ </body>
44
+ </html>
45
+ ```
46
+
47
+ **2. Build a page from blocks.**
48
+
49
+ ```astro
50
+ ---
51
+ // src/pages/index.astro
52
+ import Base from '../layouts/Base.astro';
53
+ import Hero from '@sinnstack/ui/blocks/Hero.astro';
54
+ import FeatureGrid from '@sinnstack/ui/blocks/FeatureGrid.astro';
55
+ import CTABanner from '@sinnstack/ui/blocks/CTABanner.astro';
56
+ ---
57
+ <Base title="Acme Plumbing">
58
+ <Hero
59
+ heading="Plumbing done right the first time"
60
+ description="Licensed plumbers serving Fort Worth since 1998."
61
+ actions={[{ label: 'Book a visit', href: '/book' }, { label: 'Our services', href: '/services' }]}
62
+ />
63
+ <FeatureGrid
64
+ heading="What we do"
65
+ items={[
66
+ { title: 'Repairs', description: 'Leaks, clogs and broken fixtures.', icon: 'home' },
67
+ { title: 'Installations', description: 'Water heaters, fixtures and lines.', icon: 'bolt' },
68
+ { title: 'Emergencies', description: 'Available around the clock.', icon: 'clock' },
69
+ ]}
70
+ />
71
+ <CTABanner
72
+ heading="Need a plumber today?"
73
+ actions={[{ label: 'Call (817) 555-0100', href: 'tel:+18175550100' }]}
74
+ />
75
+ </Base>
76
+ ```
77
+
78
+ **3. Run it.** `pnpm astro dev`. That's a working page with light and dark themes, responsive layouts and accessible markup.
79
+
80
+ The library never sets inline styles or scripts. If your site sends a strict CSP header, also add these settings so Astro doesn't inline them either:
81
+
82
+ ```js
83
+ // astro.config.mjs
84
+ export default defineConfig({
85
+ build: { inlineStylesheets: 'never' },
86
+ vite: { build: { assetsInlineLimit: 0 } },
87
+ });
88
+ ```
89
+
90
+ ## Import components directly
91
+
92
+ Import each component from its own file, as in the quickstart:
93
+
94
+ ```astro
95
+ import Button from '@sinnstack/ui/primitives/Button.astro'; // ✓ ships Button's CSS
96
+ import { Button } from '@sinnstack/ui/primitives'; // works, but ships every primitive's CSS
97
+ ```
98
+
99
+ The group entries (`@sinnstack/ui/primitives`, `@sinnstack/ui/blocks`, …) re-export every component in the group. Astro adds the CSS of every component a page imports, used or not, so a page that imports one Button through the group entry gets the styles for all 68 primitives. With Astro 5.18, that was 3 KB of CSS (gzipped) for a direct import and 23 KB through `@sinnstack/ui/primitives`. JavaScript isn't affected: a component's script only ships on pages that render it.
100
+
101
+ ## What's in the package
102
+
103
+ | Import | What it gives you |
104
+ | --- | --- |
105
+ | `@sinnstack/ui/tokens.css` | Design tokens: colors (light and dark), spacing, type, radius, shadows, motion. **Required, once per site.** |
106
+ | `@sinnstack/ui/base.css` | Optional page baseline: box sizing, body type, responsive media, one focus ring. |
107
+ | `@sinnstack/ui/primitives/<Name>.astro` | Layout (`Container`, `Stack`, `Grid`…), type (`Heading`, `Text`, `Prose`), `Button`, form controls, `Card`, `Navbar`, `Footer`, `Dialog`, `Tabs`, `Accordion`, `Table`, `Image`… |
108
+ | `@sinnstack/ui/blocks/<Name>.astro` | Page sections: `Hero`, `HeroCarousel`, `PageHeader`, `FeatureGrid`, `CardGrid`, `Steps`, `MediaText`, `StatsBand`, `LogoCloud`, `Testimonials`, `Reviews`, `FAQ`, `ContactForm`, `ContactCard`, `LocationHours`, `CTABanner`, `CTAPair`, `Topbar`, consent, `ErrorPage`, `MaintenancePage`, `BlockRenderer` |
109
+ | `@sinnstack/ui/blocks/cms` | Data shapes, defaults, fixtures and CMS-to-props mappers for every block |
110
+ | `@sinnstack/ui/seo/<Name>.astro` | `SEOHead`, `JSONLD` |
111
+ | `@sinnstack/ui/seo/integration` | Astro integration: sitemaps built from your pages, robots.txt |
112
+ | `@sinnstack/ui/data/<Name>.astro` | `ChartContainer` and parts, `Sparkline` |
113
+ | `@sinnstack/ui/motion/<Name>.astro` | `RevealOnScroll`, `Parallax`, `Marquee`, `PageTransitions`, `MotionProvider`, `ScrollScene` |
114
+ | `@sinnstack/ui/finishes/<name>.css` | Optional finishes: a rendering style on top of any palette, switched on with `<html data-finish="…">`. Available: `glass`, `polished-glass`, the scenes `aurora`, `autumn`, `rain`, `fog`, `night`, `spring`, the `terminal` look, the surfaces `brutalist`, `clay`, `blueprint`, `paper`, and the interactive `spotlight`, `holographic`, `day-cycle` (with `@sinnstack/ui/finishes/scripts/<name>`). |
115
+
116
+ Every group also has helper modules (`@sinnstack/ui/seo/jsonld`, `@sinnstack/ui/blocks/hours`, `@sinnstack/ui/data/chart` and so on), listed in its guide. Files under a group's `internal/` folder are private and can't be imported.
117
+
118
+ ## Guides
119
+
120
+ Each guide is the full reference for one part of the library: props, variants, CMS fields and examples.
121
+
122
+ | Guide | Covers |
123
+ | --- | --- |
124
+ | [Tokens](docs/tokens.md) | Every token, theming a client site, checking contrast |
125
+ | [Primitives](docs/primitives.md) | Layout, typography, buttons, forms, surfaces, navigation, overlays, data display, media |
126
+ | [Blocks](docs/blocks.md) | Every section block, the block renderer, CMS setup, consent, error and maintenance pages |
127
+ | [SEO](docs/seo.md) | `SEOHead`, JSON-LD builders, the sitemap integration, RSS, redirects |
128
+ | [Data](docs/data.md) | Charts and sparklines, CMS chart fields |
129
+ | [Motion](docs/motion.md) | Reveals, parallax, marquees, page transitions, GSAP scenes |
130
+ | [Finishes](docs/finishes.md) | Glass, polished glass and future finishes: what they change, how they combine with palettes, tuning |
131
+
132
+ ## Theming
133
+
134
+ Override only the tokens you change, in a stylesheet loaded after `tokens.css`. Write colors with `light-dark()` so both themes stay covered:
135
+
136
+ ```css
137
+ /* src/styles/theme.css */
138
+ @layer sinn.tokens {
139
+ :root {
140
+ --sinn-font-heading: 'Inter', system-ui, sans-serif;
141
+ --sinn-color-accent: light-dark(#b03a0b, #fb923c);
142
+ --sinn-color-accent-contrast: light-dark(#ffffff, #1c1917);
143
+ --sinn-color-accent-soft: light-dark(#fff1e6, #431407);
144
+ --sinn-color-accent-text: light-dark(#9a3412, #fdba74);
145
+ }
146
+ }
147
+ ```
148
+
149
+ When you change a color, change all four of its tokens together (the fill, `-contrast`, `-soft` and `-text`) so text on each fill still reads.
150
+
151
+ Then check that your colors still meet WCAG contrast in both themes:
152
+
153
+ ```sh
154
+ node node_modules/@sinnstack/ui/scripts/check-contrast.mjs src/styles/theme.css
155
+ ```
156
+
157
+ All library styles sit in CSS cascade layers and use zero-specificity selectors, so your own CSS wins without `!important`.
158
+
159
+ ## Optional dependencies
160
+
161
+ Only the motion group's GSAP features need extra packages. Install them only if you use `MotionProvider` and `ScrollScene` or smooth scrolling:
162
+
163
+ ```sh
164
+ pnpm add gsap lenis
165
+ ```
166
+
167
+ `RevealOnScroll`, `Parallax`, `Marquee` and `PageTransitions` are CSS and platform features and need nothing extra. Even when installed, GSAP and Lenis load only when a scene is about to scroll into view, or at idle if smooth scrolling is on.
168
+
169
+ ## Upgrading from the separate packages (0.1)
170
+
171
+ Version 0.1 shipped as six packages. They're now one package, and each old package is a path inside it:
172
+
173
+ | 0.1 import | 0.2 import |
174
+ | --- | --- |
175
+ | `@sinnstack/tokens/tokens.css` | `@sinnstack/ui/tokens.css` |
176
+ | `@sinnstack/tokens/base.css` | `@sinnstack/ui/base.css` |
177
+ | `@sinnstack/primitives/…` | `@sinnstack/ui/primitives/…` |
178
+ | `@sinnstack/blocks/…` | `@sinnstack/ui/blocks/…` |
179
+ | `@sinnstack/seo/…` | `@sinnstack/ui/seo/…` |
180
+ | `@sinnstack/data/…` | `@sinnstack/ui/data/…` |
181
+ | `@sinnstack/motion/…` | `@sinnstack/ui/motion/…` |
182
+
183
+ Replace the six dependencies with `@sinnstack/ui`, then find and replace the import paths. Components, props and CMS fields are unchanged.
184
+
185
+ ## License
186
+
187
+ [Mozilla Public License 2.0](LICENSE). In short: you can use this package in any project, including closed-source and commercial sites, and your own code stays yours. If you change files from this library and distribute them, those changed files must stay under the MPL-2.0 and their source must be made available. This summary is not legal advice; the license text is the binding version.
188
+
189
+ Copyright © 2026 Jeffrey Jackson (Sinnstack).