@hraness/design-kit 0.31.1
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/ARTICLE_COPY.md +208 -0
- package/HERO_FIELDS.md +55 -0
- package/ICONS.md +56 -0
- package/LANTERN_MATERIAL.md +60 -0
- package/LICENSE +21 -0
- package/MARKETING_COPY.md +49 -0
- package/MARKETING_PRESET.md +108 -0
- package/PALETTES.md +90 -0
- package/PAPER_THEME.md +128 -0
- package/README.md +745 -0
- package/STATUS_PAGES.md +67 -0
- package/STYLE.md +245 -0
- package/WRITING.md +72 -0
- package/dist/browser/index.js +2345 -0
- package/dist/chunk-44djxk16.js +6872 -0
- package/dist/chunk-5gtx3pza.js +9 -0
- package/dist/chunk-77391vmq.js +454 -0
- package/dist/chunk-7b1586eb.js +1209 -0
- package/dist/chunk-8834fh4n.js +6 -0
- package/dist/chunk-9t8xyqte.js +870 -0
- package/dist/chunk-cejpzyfh.js +446 -0
- package/dist/chunk-eh71jz57.js +429 -0
- package/dist/chunk-evb02bc1.js +516 -0
- package/dist/chunk-h4k7yv6x.js +368 -0
- package/dist/chunk-he8eznb1.js +760 -0
- package/dist/chunk-mr1vdcjq.js +404 -0
- package/dist/chunk-wzvdn8ey.js +116 -0
- package/dist/fonts/nebula-sans/social-fonts.generated.js +53 -0
- package/dist/icons.js +48 -0
- package/dist/index.js +237 -0
- package/dist/launch.js +41 -0
- package/dist/mockups/client.js +422 -0
- package/dist/mockups/index.js +1850 -0
- package/dist/portfolio.js +1549 -0
- package/dist/provider-marks.js +19 -0
- package/dist/react/charts.js +11 -0
- package/dist/react/hero-backdrop.js +8 -0
- package/dist/react/index.js +7252 -0
- package/dist/react/platform-install.js +10 -0
- package/dist/react/server.js +137 -0
- package/dist/stylex-manifest.json +1 -0
- package/dist/stylex.css +5392 -0
- package/dist/syntax-highlighting.js +15 -0
- package/dist/testing.js +250 -0
- package/package.json +377 -0
- package/portfolio-inventory.json +31 -0
- package/scripts/check-lantern-material-snapshot.d.mts +26 -0
- package/scripts/check-lantern-material-snapshot.mjs +126 -0
- package/scripts/check-marketing-snapshot.d.mts +12 -0
- package/scripts/check-marketing-snapshot.mjs +58 -0
- package/scripts/lantern-material-snapshot.ts +101 -0
- package/scripts/marketing-textures.ts +48 -0
- package/scripts/paper-theme-snapshot.ts +97 -0
- package/scripts/product-marketing-snapshot.ts +149 -0
- package/src/appearance-menu.css +266 -0
- package/src/appearance.ts +32 -0
- package/src/article-html.ts +269 -0
- package/src/article.ts +686 -0
- package/src/browser/appearance-menu.ts +604 -0
- package/src/browser/artifact-share.ts +164 -0
- package/src/browser/design-palette.ts +197 -0
- package/src/browser/foil.ts +124 -0
- package/src/browser/hero-light.ts +11 -0
- package/src/browser/index.ts +29 -0
- package/src/browser/status-field.ts +432 -0
- package/src/browser/status-page.ts +100 -0
- package/src/browser/sticky-offset.ts +82 -0
- package/src/browser/theme-color-sync.ts +213 -0
- package/src/charts.css +7 -0
- package/src/compiler-components.css +34 -0
- package/src/compiler-foundation.css +18 -0
- package/src/compiler-palettes.css +7 -0
- package/src/compiler-tokens.css +342 -0
- package/src/components.css +3 -0
- package/src/design-gallery.css +431 -0
- package/src/effects.css +14 -0
- package/src/fonts/geist-mono/GeistMono[wght].woff2 +0 -0
- package/src/fonts/geist-mono/OFL.txt +93 -0
- package/src/fonts/geist-mono/PROVENANCE.md +12 -0
- package/src/fonts/instrument-serif/OFL.txt +93 -0
- package/src/fonts/instrument-serif/UPSTREAM.md +14 -0
- package/src/fonts/instrument-serif/instrument-serif-latin-400.woff2 +0 -0
- package/src/fonts/nebula-sans/LICENSE.txt +96 -0
- package/src/fonts/nebula-sans/NebulaSans-Black.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-BlackItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Bold.otf +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Bold.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-BoldItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Book.otf +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Book.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-BookItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Light.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-LightItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Medium.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-MediumItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-Semibold.woff2 +0 -0
- package/src/fonts/nebula-sans/NebulaSans-SemiboldItalic.woff2 +0 -0
- package/src/fonts/nebula-sans/PROVENANCE.md +14 -0
- package/src/fonts/nebula-sans/social-fonts.generated.ts +3873 -0
- package/src/fonts.css +106 -0
- package/src/icons/act60/act60.svg +5 -0
- package/src/icons/act60/application.svg +9 -0
- package/src/icons/act60/chapter-compare.svg +3 -0
- package/src/icons/act60/decree-residence.svg +6 -0
- package/src/icons/act60/estimate.svg +7 -0
- package/src/icons/act60/export-services.svg +4 -0
- package/src/icons/act60/investor.svg +13 -0
- package/src/icons/act60/presence.svg +7 -0
- package/src/icons/aicharts/aicharts.svg +6 -0
- package/src/icons/aicharts/cost-compare.svg +4 -0
- package/src/icons/aicharts/task-audio.svg +7 -0
- package/src/icons/aicharts/task-coding.svg +6 -0
- package/src/icons/aicharts/task-images.svg +3 -0
- package/src/icons/aicharts/task-reasoning.svg +9 -0
- package/src/icons/aicharts/task-research.svg +5 -0
- package/src/icons/aicharts/task-video.svg +4 -0
- package/src/icons/manifest.json +1371 -0
- package/src/icons/platonik/conversation.svg +3 -0
- package/src/icons/platonik/creature.svg +7 -0
- package/src/icons/platonik/economy.svg +4 -0
- package/src/icons/platonik/keep-light.svg +6 -0
- package/src/icons/platonik/platonik.svg +7 -0
- package/src/icons/platonik/spark-route.svg +15 -0
- package/src/icons/receipts/act60-retry.receipt.json +888 -0
- package/src/icons/receipts/act60.receipt.json +1366 -0
- package/src/icons/receipts/aicharts.receipt.json +1546 -0
- package/src/icons/receipts/platonik.receipt.json +1011 -0
- package/src/icons/receipts/roughday.receipt.json +770 -0
- package/src/icons/receipts/shared.receipt.json +1296 -0
- package/src/icons/receipts/slopcamera.receipt.json +1495 -0
- package/src/icons/receipts/soundfish-retry.receipt.json +460 -0
- package/src/icons/receipts/soundfish.receipt.json +1709 -0
- package/src/icons/receipts/sponge.receipt.json +1743 -0
- package/src/icons/receipts/stripe-history-retry.receipt.json +145 -0
- package/src/icons/receipts/stripe-history.receipt.json +1202 -0
- package/src/icons/receipts/wordcell.receipt.json +1924 -0
- package/src/icons/roughday/finance.svg +7 -0
- package/src/icons/roughday/roughday.svg +6 -0
- package/src/icons/roughday/technology.svg +4 -0
- package/src/icons/roughday/world.svg +4 -0
- package/src/icons/sets/act60.json +63 -0
- package/src/icons/sets/aicharts.json +63 -0
- package/src/icons/sets/platonik.json +39 -0
- package/src/icons/sets/roughday.json +25 -0
- package/src/icons/sets/shared.json +12 -0
- package/src/icons/sets/slopcamera.json +47 -0
- package/src/icons/sets/soundfish.json +43 -0
- package/src/icons/sets/sponge.json +51 -0
- package/src/icons/sets/stripe-history.json +39 -0
- package/src/icons/sets/wordcell.json +51 -0
- package/src/icons/shared/agent-skill.svg +4 -0
- package/src/icons/shared/cli.svg +5 -0
- package/src/icons/shared/privacy.svg +3 -0
- package/src/icons/shared/research.svg +7 -0
- package/src/icons/shared/sdk.svg +3 -0
- package/src/icons/slopcamera/diagram.svg +3 -0
- package/src/icons/slopcamera/direct-scene.svg +5 -0
- package/src/icons/slopcamera/edit-video.svg +17 -0
- package/src/icons/slopcamera/mcp.svg +3 -0
- package/src/icons/slopcamera/native-world.svg +3 -0
- package/src/icons/slopcamera/slopcamera.svg +11 -0
- package/src/icons/soundfish/agent-ui.svg +7 -0
- package/src/icons/soundfish/collaborate.svg +5 -0
- package/src/icons/soundfish/compose.svg +3 -0
- package/src/icons/soundfish/hear.svg +6 -0
- package/src/icons/soundfish/human-ui.svg +6 -0
- package/src/icons/soundfish/share.svg +3 -0
- package/src/icons/soundfish/soundfish.svg +6 -0
- package/src/icons/sponge/api.svg +3 -0
- package/src/icons/sponge/documents.svg +3 -0
- package/src/icons/sponge/library.svg +3 -0
- package/src/icons/sponge/one-question.svg +5 -0
- package/src/icons/sponge/people-direct.svg +5 -0
- package/src/icons/sponge/read.svg +3 -0
- package/src/icons/sponge/save.svg +4 -0
- package/src/icons/sponge/sponge.svg +7 -0
- package/src/icons/stripe-history/company-history.svg +3 -0
- package/src/icons/stripe-history/evidence.svg +4 -0
- package/src/icons/stripe-history/independence.svg +7 -0
- package/src/icons/stripe-history/publications.svg +11 -0
- package/src/icons/stripe-history/sources.svg +6 -0
- package/src/icons/stripe-history/stripe-history.svg +3 -0
- package/src/icons/wordcell/backlinks.svg +6 -0
- package/src/icons/wordcell/capture.svg +6 -0
- package/src/icons/wordcell/git-provenance.svg +4 -0
- package/src/icons/wordcell/kb.svg +4 -0
- package/src/icons/wordcell/markdown.svg +4 -0
- package/src/icons/wordcell/scopes.svg +3 -0
- package/src/icons/wordcell/search.svg +7 -0
- package/src/icons.generated.ts +734 -0
- package/src/icons.ts +51 -0
- package/src/index.ts +275 -0
- package/src/lantern-material.css +213 -0
- package/src/launch.ts +624 -0
- package/src/marketing-assets/UPSTREAM.md +18 -0
- package/src/marketing-assets/cells.svg +1 -0
- package/src/marketing-assets/grain.svg +1 -0
- package/src/marketing-forced-colors.css +12 -0
- package/src/mockups/client.tsx +415 -0
- package/src/mockups/core.tsx +318 -0
- package/src/mockups/frames.tsx +368 -0
- package/src/mockups/index.ts +14 -0
- package/src/mockups/surfaces.tsx +681 -0
- package/src/mockups.css +2607 -0
- package/src/palette-appearance.ts +45 -0
- package/src/palette-bridge.css +124 -0
- package/src/palette-color.ts +41 -0
- package/src/palette-system.css +721 -0
- package/src/palette-themes.ts +23 -0
- package/src/palette-tokens.stylex.ts +519 -0
- package/src/palettes.css +3 -0
- package/src/palettes.ts +161 -0
- package/src/paper-theme.css +244 -0
- package/src/plain-publication.css +1241 -0
- package/src/plain-site.css +397 -0
- package/src/platforms.ts +151 -0
- package/src/portfolio.generated.json +1595 -0
- package/src/portfolio.generated.ts +1596 -0
- package/src/portfolio.ts +226 -0
- package/src/product-marketing-foundation.css +433 -0
- package/src/product-marketing-preset.css +261 -0
- package/src/product-marketing.css +2186 -0
- package/src/provider-marks.generated.ts +112 -0
- package/src/provider-marks.ts +143 -0
- package/src/react/animated-rail-stage.stylex.ts +15 -0
- package/src/react/animated-rail-stage.tsx +51 -0
- package/src/react/app-shell.stylex.ts +104 -0
- package/src/react/app-shell.tsx +121 -0
- package/src/react/article.tsx +602 -0
- package/src/react/aurora-dots-background.tsx +34 -0
- package/src/react/charts.stylex.ts +563 -0
- package/src/react/charts.tsx +610 -0
- package/src/react/chat.stylex.ts +34 -0
- package/src/react/chat.tsx +155 -0
- package/src/react/design-gallery.tsx +943 -0
- package/src/react/design-palette.stylex.ts +124 -0
- package/src/react/design-palette.tsx +196 -0
- package/src/react/design-theme-context.tsx +41 -0
- package/src/react/effects.stylex.ts +325 -0
- package/src/react/fader.stylex.ts +71 -0
- package/src/react/fader.tsx +151 -0
- package/src/react/foil-card-math.ts +100 -0
- package/src/react/foil-card-surface.stylex.ts +326 -0
- package/src/react/foil-card-surface.tsx +742 -0
- package/src/react/foil-mark.tsx +35 -0
- package/src/react/foil.stylex.ts +163 -0
- package/src/react/haptics.ts +228 -0
- package/src/react/hero-backdrop.tsx +22 -0
- package/src/react/index.ts +38 -0
- package/src/react/keyboard-shortcuts.ts +228 -0
- package/src/react/lantern-material-gallery.tsx +166 -0
- package/src/react/lantern-material.stylex.ts +39 -0
- package/src/react/launch-beats.tsx +73 -0
- package/src/react/navigation-rail.stylex.ts +130 -0
- package/src/react/navigation-rail.tsx +228 -0
- package/src/react/particle-halo.tsx +115 -0
- package/src/react/phaser-dots.tsx +501 -0
- package/src/react/platform-icons.tsx +94 -0
- package/src/react/platform-install.stylex.ts +385 -0
- package/src/react/platform-install.tsx +389 -0
- package/src/react/playback-transport.stylex.ts +14 -0
- package/src/react/playback-transport.tsx +112 -0
- package/src/react/procedural-backdrop.tsx +192 -0
- package/src/react/procedural-recipe.ts +323 -0
- package/src/react/product-marketing.stylex.ts +4469 -0
- package/src/react/product-marketing.tsx +1611 -0
- package/src/react/production-data-preview-notice.stylex.ts +40 -0
- package/src/react/production-data-preview-notice.tsx +34 -0
- package/src/react/provider-mark.stylex.ts +132 -0
- package/src/react/provider-mark.tsx +120 -0
- package/src/react/relative-time.tsx +117 -0
- package/src/react/route-state.stylex.ts +39 -0
- package/src/react/route-state.tsx +350 -0
- package/src/react/server.ts +11 -0
- package/src/react/social-kit-panel.tsx +103 -0
- package/src/react/sticky-offset.tsx +33 -0
- package/src/react/surfaces.stylex.ts +179 -0
- package/src/react/surfaces.tsx +330 -0
- package/src/react/syntax-code.tsx +33 -0
- package/src/react/theme-color-sync.ts +1 -0
- package/src/react/theme-resolution.ts +11 -0
- package/src/react/theme.stylex.ts +276 -0
- package/src/react/theme.tsx +402 -0
- package/src/reading.css +72 -0
- package/src/relative-time.ts +185 -0
- package/src/reset.css +2 -0
- package/src/site-shell.css +16 -0
- package/src/status-page-html.ts +63 -0
- package/src/status-page.css +276 -0
- package/src/status-page.ts +323 -0
- package/src/styles.css +21 -0
- package/src/syntax-code-lexers.ts +303 -0
- package/src/syntax-highlighting.css +78 -0
- package/src/syntax-highlighting.ts +477 -0
- package/src/syntax-tokens.ts +33 -0
- package/src/testing.ts +307 -0
- package/src/tokens.css +3 -0
- package/src/typography.css +86 -0
- package/vendor/evilcharts/LICENSE +21 -0
- package/vendor/evilcharts/UPSTREAM.md +14 -0
- package/vendor/platform-marks/LICENSE +30 -0
- package/vendor/platform-marks/UPSTREAM.md +15 -0
- package/vendor/platform-marks/apple.svg +1 -0
- package/vendor/platform-marks/linux.svg +1 -0
- package/vendor/provider-marks/CRUSH-LICENSE.md +134 -0
- package/vendor/provider-marks/LICENSE +21 -0
- package/vendor/provider-marks/UPSTREAM.md +27 -0
- package/vendor/provider-marks/aider.svg +3 -0
- package/vendor/provider-marks/crush-heartbit.svg +8 -0
- package/vendor/provider-marks/lobehub/alibabacloud-color.svg +1 -0
- package/vendor/provider-marks/lobehub/alibabacloud.svg +1 -0
- package/vendor/provider-marks/lobehub/amp-color.svg +1 -0
- package/vendor/provider-marks/lobehub/amp.svg +1 -0
- package/vendor/provider-marks/lobehub/anthropic.svg +1 -0
- package/vendor/provider-marks/lobehub/claude-color.svg +1 -0
- package/vendor/provider-marks/lobehub/claude.svg +1 -0
- package/vendor/provider-marks/lobehub/claudecode-color.svg +1 -0
- package/vendor/provider-marks/lobehub/claudecode.svg +1 -0
- package/vendor/provider-marks/lobehub/codex-color.svg +1 -0
- package/vendor/provider-marks/lobehub/codex.svg +1 -0
- package/vendor/provider-marks/lobehub/cursor.svg +1 -0
- package/vendor/provider-marks/lobehub/deepseek-color.svg +1 -0
- package/vendor/provider-marks/lobehub/deepseek.svg +1 -0
- package/vendor/provider-marks/lobehub/devin-color.svg +1 -0
- package/vendor/provider-marks/lobehub/devin.svg +1 -0
- package/vendor/provider-marks/lobehub/gemini-color.svg +1 -0
- package/vendor/provider-marks/lobehub/gemini.svg +1 -0
- package/vendor/provider-marks/lobehub/geminicli-color.svg +1 -0
- package/vendor/provider-marks/lobehub/geminicli.svg +1 -0
- package/vendor/provider-marks/lobehub/goose.svg +1 -0
- package/vendor/provider-marks/lobehub/meta-color.svg +1 -0
- package/vendor/provider-marks/lobehub/meta.svg +1 -0
- package/vendor/provider-marks/lobehub/mistral-color.svg +1 -0
- package/vendor/provider-marks/lobehub/mistral.svg +1 -0
- package/vendor/provider-marks/lobehub/moonshot.svg +1 -0
- package/vendor/provider-marks/lobehub/nvidia-color.svg +1 -0
- package/vendor/provider-marks/lobehub/nvidia.svg +1 -0
- package/vendor/provider-marks/lobehub/openai.svg +1 -0
- package/vendor/provider-marks/lobehub/opencode.svg +1 -0
- package/vendor/provider-marks/lobehub/perplexity-color.svg +1 -0
- package/vendor/provider-marks/lobehub/perplexity.svg +1 -0
- package/vendor/provider-marks/lobehub/qwen-color.svg +1 -0
- package/vendor/provider-marks/lobehub/qwen.svg +1 -0
- package/vendor/provider-marks/lobehub/xai.svg +1 -0
- package/vendor/provider-marks/lobehub/zai.svg +1 -0
package/PALETTES.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Semantic palettes
|
|
2
|
+
|
|
3
|
+
Applications can opt into Paper, Catppuccin, Gruvbox, Rosé Pine, or Tokyo Night, with light, dark, and system appearance. Catppuccin dark is the default. Existing `DesignThemeProvider` consumers keep their existing appearance behavior until they opt in.
|
|
4
|
+
|
|
5
|
+
## Install and render
|
|
6
|
+
|
|
7
|
+
Install the explicit UI peer and import `@hraness/design-kit/styles.css` once for the full design system. Applications with their own fonts and reset can import `@hraness/design-kit/palettes.css` for the palette CSS and compiled compositions alone. Do not import both entries.
|
|
8
|
+
|
|
9
|
+
Render the initial document with `data-palette="catppuccin"`, `data-theme="dark"`, and the class returned by `getDesignPaletteTheme("catppuccin", "dark")`. This gives the page a complete palette before JavaScript runs.
|
|
10
|
+
|
|
11
|
+
Bundle an application-owned browser entry that calls `initDesignPalette()` from `@hraness/design-kit/browser`. Load that bundle as a same-origin, synchronous external script in the document head. It applies the saved preference before the page paints. It does not require inline scripts, inline styles, or a weaker content security policy.
|
|
12
|
+
|
|
13
|
+
Wrap React content in `DesignPaletteProvider` and retain one `ThemeMenuButton` as the final header action. The provider adopts the document's existing controller. The menu exposes separate Theme and Appearance radio groups. `useDesignPalette()` provides the preference and its resolved light or dark mode.
|
|
14
|
+
|
|
15
|
+
A product can use the browser controller without React. Its snapshot, subscription, and `setPreference` methods support native controls. Initialization is explicit; importing the browser package does not change the document or register listeners.
|
|
16
|
+
|
|
17
|
+
## Product defaults and static pages
|
|
18
|
+
|
|
19
|
+
Choose a default for the product family, then pass the same `defaultPreference`
|
|
20
|
+
to the head bootstrap and `DesignPaletteProvider`. For example,
|
|
21
|
+
`{ palette: "gruvbox", mode: "system" }` gives a writing suite a warm default
|
|
22
|
+
while preserving a visitor's saved choice. Keep browser theme-color metadata
|
|
23
|
+
aligned with the chosen palette and use `ThemeColorSync` for later changes.
|
|
24
|
+
|
|
25
|
+
For a system-first document, render `data-palette="gruvbox"` without a
|
|
26
|
+
`data-theme` attribute. The generated CSS uses `light-dark()` before JavaScript,
|
|
27
|
+
including when scripting is disabled. A concrete `data-theme="light"` or
|
|
28
|
+
`data-theme="dark"` takes precedence. Static palette islands use the same two
|
|
29
|
+
attributes; React portals retain their complete generated class.
|
|
30
|
+
|
|
31
|
+
The full and minimal foundations include this behavior. Static sites with an
|
|
32
|
+
existing stylesheet can import `@hraness/design-kit/palette-bridge.css`; it
|
|
33
|
+
includes `palette-system.css` and maps the raw values onto the semantic roles.
|
|
34
|
+
The narrower `palette-system.css` export contains only raw palette values and
|
|
35
|
+
color-scheme, for build pipelines that already supply their own role mapping.
|
|
36
|
+
Neither stylesheet needs a browser script or an animation runtime.
|
|
37
|
+
|
|
38
|
+
Plain reading surfaces inherit the selected palette through their existing
|
|
39
|
+
`--plain-*` roles. Put `data-palette` on the document, a containing element, or
|
|
40
|
+
the `.plain-site` surface itself. A nested boundary resolves its own palette
|
|
41
|
+
and appearance, including inside a neutral dark document. Standalone and
|
|
42
|
+
compiled foundations use the same precedence; products need no additional
|
|
43
|
+
color overrides.
|
|
44
|
+
|
|
45
|
+
## Preferences and embedded views
|
|
46
|
+
|
|
47
|
+
The controller stores only `{ "palette": "catppuccin", "mode": "dark" }` under `hraness-design-palette-v1` in the current origin's local storage. It supports all five palette identifiers and `light`, `dark`, or `system`. Invalid or inaccessible storage falls back to Catppuccin dark. Storage events synchronize other tabs, and system mode follows operating-system appearance changes.
|
|
48
|
+
|
|
49
|
+
Use `forcedPreference` for an embedded example or fixed preview in its own document. A document has one palette controller; conflicting nested providers are rejected. Forced providers do not persist preferences or adopt the parent document's controller. Each document still needs its initial attributes and compiled palette class. The host owns any propagation between iframe documents.
|
|
50
|
+
|
|
51
|
+
Portalled controls receive the resolved palette class through the shared portal theme context. React portal roots retain the complete generated palette class and resolved `data-theme` value. Authored static islands can use the attribute-only system contract described above. Color selection never changes typography, layout, or application data.
|
|
52
|
+
|
|
53
|
+
## StyleX and semantic roles
|
|
54
|
+
|
|
55
|
+
`src/palettes.ts` owns the source colors and their application adaptations. `bun run generate:palettes` writes the static system palette sheet and ten complete `stylex.createTheme` recipes against one `stylex.defineVars` contract in `src/palette-tokens.stylex.ts`. The build verifies that the generated source is current, then compiles the recipes with runtime CSS injection disabled.
|
|
56
|
+
|
|
57
|
+
The global CSS boundary maps existing `--primary`, `--danger`, `--warning`, `--success`, surface, text, focus, and `--ui-*` roles to the compiled `--hraness-palette-*` properties. Product CSS and shared controls consume the same values. Use semantic roles for meaning; keep text or an icon with each status so color is not its only cue.
|
|
58
|
+
|
|
59
|
+
Compiler adopters that own their typography import `@hraness/design-kit/compiler-palettes.css`. It includes the portable UI foundation and semantic palette bridge, without webfonts, marketing styles, or standalone atomic recipes. It supports the palette controller, `DesignPaletteMenuButton`, and portable UI primitives. Full design-kit compositions use `compiler-foundation.css`, which includes that minimal foundation plus the package's typography and presentation styles.
|
|
60
|
+
|
|
61
|
+
Both routes register the UI and design-kit manifests and link one finalized cross-package stylesheet after the foundation. The manifest binds `compiler-palettes.css`; the full foundation imports it once. Do not also load the standalone `palettes.css`, `styles.css`, or `stylex.css` entries.
|
|
62
|
+
|
|
63
|
+
This uses StyleX's documented [variable contract](https://stylexjs.com/docs/api/javascript/defineVars/) and [compiled theme classes](https://stylexjs.com/docs/learn/theming/creating-themes/). Applications consuming the precompiled package do not need another StyleX compiler configuration.
|
|
64
|
+
|
|
65
|
+
## Sources and contrast
|
|
66
|
+
|
|
67
|
+
| Theme | Light source | Dark source |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| [Catppuccin](https://catppuccin.com/palette/) | Latte | Mocha |
|
|
70
|
+
| [Gruvbox](https://github.com/morhetz/gruvbox/blob/master/colors/gruvbox.vim) | Light | Dark |
|
|
71
|
+
| [Rosé Pine](https://rosepinetheme.com/palette/) | Dawn | Rosé Pine |
|
|
72
|
+
| [Tokyo Night](https://github.com/folke/tokyonight.nvim/tree/main/extras/lua) | Day | Night |
|
|
73
|
+
|
|
74
|
+
These are interface adaptations of the upstream palettes. Backgrounds retain their source values. Text and control colors move toward black or white when necessary for readability across the background, surface, raised surface, and hover surface. Body text reaches 7:1, secondary text and semantic text reach at least 4.5:1, and control boundaries reach at least 3:1. Filled semantic actions also have a tested foreground pair. Subtle separators are decorative and do not serve as the sole boundary of an interactive control.
|
|
75
|
+
|
|
76
|
+
The recipe tests cover every supported color pair. Browser coverage checks actual inheritance, theme switching, storage, and overlays. Forced-colors mode uses system colors. Components remain responsible for appropriate labels, keyboard behavior, and focus visibility.
|
|
77
|
+
|
|
78
|
+
## Paper as a product default
|
|
79
|
+
|
|
80
|
+
Paper uses warm neutral backgrounds and one blue action color. Its source
|
|
81
|
+
backgrounds and typography follow the shared studio visual reference;
|
|
82
|
+
foreground, status, and control colors use the same readability adaptation
|
|
83
|
+
as the other palettes. Use `defaultPreference={{ palette: "paper", mode: "system" }}`
|
|
84
|
+
on both the bootstrap and `DesignPaletteProvider`. Existing saved palette
|
|
85
|
+
preferences win; `legacyStorageKey` migrates an existing light, dark, or system
|
|
86
|
+
choice. The package default remains Catppuccin dark.
|
|
87
|
+
|
|
88
|
+
The [portable Paper stylesheet](PAPER_THEME.md) is generated from these same
|
|
89
|
+
palette values. It supplies typography and marketing tokens to named-palette
|
|
90
|
+
consumers while a non-Paper palette retains its selected colors.
|
package/PAPER_THEME.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Paper theme
|
|
2
|
+
|
|
3
|
+
Paper shares warm neutral surfaces, Nebula Sans typography, a compact heading
|
|
4
|
+
scale, and blue actions across marketing sites and application defaults.
|
|
5
|
+
The CSS is generated from the `paper` semantic palette and shared marketing header paint.
|
|
6
|
+
Products retain their content, layout, functionality, and saved appearance.
|
|
7
|
+
|
|
8
|
+
## Portable CSS contract 1
|
|
9
|
+
|
|
10
|
+
Load `@hraness/design-kit/paper-theme.css` after existing theme styles, then set
|
|
11
|
+
`data-hraness-theme="paper"` on the document root or a complete subtree:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<html data-hraness-theme="paper" data-theme="light">
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The export has no imports, font requests, reset, JavaScript, layout recipes,
|
|
18
|
+
or dependency on React, UI, or a StyleX compiler. It uses standard CSS
|
|
19
|
+
`light-dark()`, supported by Chrome 123+, Firefox 120+, and Safari 17.5+.
|
|
20
|
+
Use the compiled palette route for applications whose existing CSS pipeline
|
|
21
|
+
does not preserve this function. A root without `data-theme`, or with
|
|
22
|
+
`data-theme="system"`, follows the operating system. Explicit `light` or
|
|
23
|
+
`dark` wins; a nested boundary without a mode inherits its ancestor's
|
|
24
|
+
`color-scheme`. Existing appearance controllers continue to own preferences.
|
|
25
|
+
|
|
26
|
+
The stylesheet declares semantic product roles (`--background`, `--foreground`,
|
|
27
|
+
`--surface`, `--surface-raised`, `--muted`, `--line`, `--control-border`,
|
|
28
|
+
`--primary`, status and inverse pairs), the corresponding `--ui-*` roles,
|
|
29
|
+
`--plain-*` publication aliases, and `--hraness-site-accent` with its foreground.
|
|
30
|
+
Control boundaries and secondary text are contrast adapted; subtle grid lines
|
|
31
|
+
remain decorative. Forced colors use system surface, text, and action colors. The `--plain-link`
|
|
32
|
+
alias uses `LinkText`; primary actions and focus retain `Highlight`.
|
|
33
|
+
Product CSS decides where to paint these roles, with one shared header correction.
|
|
34
|
+
The opted-in `.hraness-marketing-header` receives the same paint as current
|
|
35
|
+
marketing headers in `components.hraness-design-kit.legacy`. It retains the
|
|
36
|
+
82% surface tint and 14px blur, with separate standard and WebKit feature
|
|
37
|
+
queries so CSS optimization preserves both browser paths. An opaque surface
|
|
38
|
+
applies when neither path is supported, reduced transparency is preferred, or
|
|
39
|
+
forced colors are active. This rule changes paint only; header layout,
|
|
40
|
+
positioning, and interactions remain owned by the component. Loading a fresh
|
|
41
|
+
snapshot after an older marketing stylesheet applies the correction without
|
|
42
|
+
changing the installed component or compiler versions.
|
|
43
|
+
|
|
44
|
+
`--font-text`, `--font-heading`, and `--font-sans` use Nebula Sans with system
|
|
45
|
+
fallbacks. Code remains system monospace. Load the existing licensed font
|
|
46
|
+
assets separately, or keep an application's own font through later overrides.
|
|
47
|
+
The snapshot has no hidden font download.
|
|
48
|
+
|
|
49
|
+
Marketing roles inherit an 80rem measure, responsive gutter, restrained radii,
|
|
50
|
+
and shared rhythm. The optional size tokens are:
|
|
51
|
+
|
|
52
|
+
| Token | Default |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `--hraness-paper-heading-size` | `clamp(1.75rem, 3vw, 2.375rem)` |
|
|
55
|
+
| `--hraness-paper-section-heading-size` | `var(--hraness-type-h2-size, clamp(1.75rem, 1.45rem + .9vw, 2.125rem))`: the shared h2 size, never below 1.75rem |
|
|
56
|
+
| `--hraness-paper-summary-size` | `1rem` |
|
|
57
|
+
| `--hraness-paper-heading-leading` | `1.15` |
|
|
58
|
+
| `--hraness-paper-heading-tracking` | `-.035em` |
|
|
59
|
+
|
|
60
|
+
Current `ProductHero` and narrative section recipes read the size tokens with
|
|
61
|
+
their existing sizes as fallbacks. `ProductHero.eyebrow` is optional, so compact
|
|
62
|
+
pages can omit the extra label. Older pinned component versions can bind their
|
|
63
|
+
documented heading classes to these tokens in a small product-owned adapter.
|
|
64
|
+
The theme does not rewrite grids, navigation, mobile breakpoints, or app state.
|
|
65
|
+
If a publication stylesheet redeclares variables on a descendant, explicitly
|
|
66
|
+
opt that boundary in as well. Keep local exceptions in a separate stylesheet
|
|
67
|
+
after the snapshot.
|
|
68
|
+
|
|
69
|
+
## Palette-aware applications
|
|
70
|
+
|
|
71
|
+
The existing palette catalog now includes `paper`; its global default remains
|
|
72
|
+
Catppuccin dark. A product may choose Paper and System as its own default:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<DesignPaletteProvider
|
|
76
|
+
defaultPreference={{ palette: "paper", mode: "system" }}
|
|
77
|
+
legacyStorageKey="product-appearance"
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
</DesignPaletteProvider>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use the same options in `initDesignPalette` before the first paint and render
|
|
84
|
+
the initial Paper class from `getDesignPaletteTheme("paper", "light")` with
|
|
85
|
+
the corresponding initial attributes. A saved named palette takes precedence;
|
|
86
|
+
a valid legacy Light, Dark, or System preference migrates without changing its
|
|
87
|
+
mode. Do not use `forcedPreference` for an application's default.
|
|
88
|
+
|
|
89
|
+
When the Paper CSS boundary also has a non-Paper `data-palette`, the portable
|
|
90
|
+
stylesheet leaves its colors to the selected palette. Typography and rhythm
|
|
91
|
+
remain shared. Complete nested palette islands and portalled controls still
|
|
92
|
+
follow the existing [palette contract](PALETTES.md).
|
|
93
|
+
|
|
94
|
+
## Independent snapshots
|
|
95
|
+
|
|
96
|
+
Products may keep their current UI and compiler releases and vendor the exact
|
|
97
|
+
CSS file under `vendor/hraness-paper`. From a reviewed design-kit checkout:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
bun scripts/paper-theme-snapshot.ts --write /path/to/product/vendor/hraness-paper --source-commit FULL_40_CHARACTER_COMMIT
|
|
101
|
+
bun scripts/paper-theme-snapshot.ts --check /path/to/product/vendor/hraness-paper
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The installer reads `src/paper-theme.css` and `LICENSE` from that Git commit,
|
|
105
|
+
not from the working tree. It writes `paper-theme.css`, `LICENSE`, and
|
|
106
|
+
`provenance.json`, recording the repository, full source commit, public export,
|
|
107
|
+
contract version, source paths, and SHA-256 hashes of both artifacts. A missing
|
|
108
|
+
commit or unowned destination file fails. Existing snapshots must verify before
|
|
109
|
+
an intentional upgrade. The checker reads only the three local files and
|
|
110
|
+
detects edits to either artifact; it does not contact a service or update them.
|
|
111
|
+
Consumer checks can implement that small hash contract in their own runtime.
|
|
112
|
+
|
|
113
|
+
Contract 1 keeps existing semantic meanings and selectors stable. Additive
|
|
114
|
+
tokens and compatible paint corrections do not require a coordinated upgrade. A breaking token or selector
|
|
115
|
+
change requires a new contract and an explicit migration. Pin the package or
|
|
116
|
+
source commit independently in every product; upgrade and validate each on its
|
|
117
|
+
own schedule. Do not use sibling paths, mutable branches, or runtime CSS CDNs.
|
|
118
|
+
|
|
119
|
+
## Evidence
|
|
120
|
+
|
|
121
|
+
`src/palettes.test.ts` verifies every Paper text, control, and status contrast
|
|
122
|
+
pair. `src/browser/design-palette.test.ts` covers saved choices and legacy
|
|
123
|
+
appearance migration. `scripts/paper-theme-browser.ts` renders the standalone
|
|
124
|
+
gallery at desktop and phone sizes, checks light/dark islands, system mode,
|
|
125
|
+
palette isolation, marketing token inheritance, real native controls, optimized
|
|
126
|
+
header blur, opaque capability fallback, reduced transparency, and forced colors. `src/paper-theme.test.ts` verifies generated CSS and snapshot
|
|
127
|
+
integrity. The public `DesignSystemGallery` includes Paper specimens; load
|
|
128
|
+
`paper-theme.css` alongside the gallery stylesheet to display them.
|