@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
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Link,
|
|
5
|
+
cn,
|
|
6
|
+
type ContentHeadingLevel,
|
|
7
|
+
type LinkProps,
|
|
8
|
+
} from "@hraness/ui";
|
|
9
|
+
import * as stylex from "@stylexjs/stylex";
|
|
10
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
11
|
+
|
|
12
|
+
import { navigationRailStyles } from "./navigation-rail.stylex.js";
|
|
13
|
+
|
|
14
|
+
export interface NavigationRailProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
15
|
+
readonly "aria-label"?: string;
|
|
16
|
+
readonly footer?: ReactNode;
|
|
17
|
+
readonly header?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function NavigationRail({
|
|
21
|
+
"aria-label": ariaLabel = "Primary navigation",
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
footer,
|
|
25
|
+
header,
|
|
26
|
+
...props
|
|
27
|
+
}: NavigationRailProps) {
|
|
28
|
+
const rootPresentation = stylex.props(navigationRailStyles.rail);
|
|
29
|
+
const edgePresentation = stylex.props(navigationRailStyles.railEdge);
|
|
30
|
+
const navigationPresentation = stylex.props(navigationRailStyles.navigation);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<aside
|
|
34
|
+
{...rootPresentation}
|
|
35
|
+
{...props}
|
|
36
|
+
aria-label={ariaLabel}
|
|
37
|
+
className={cn(
|
|
38
|
+
"hraness-design-navigation-rail",
|
|
39
|
+
rootPresentation.className,
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
>
|
|
43
|
+
{header === undefined
|
|
44
|
+
? null
|
|
45
|
+
: (
|
|
46
|
+
<header
|
|
47
|
+
{...edgePresentation}
|
|
48
|
+
className={cn(
|
|
49
|
+
"hraness-design-navigation-rail__header",
|
|
50
|
+
edgePresentation.className,
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
{header}
|
|
54
|
+
</header>
|
|
55
|
+
)}
|
|
56
|
+
<nav
|
|
57
|
+
{...navigationPresentation}
|
|
58
|
+
aria-label={ariaLabel}
|
|
59
|
+
className={cn(
|
|
60
|
+
"hraness-design-navigation-rail__navigation",
|
|
61
|
+
navigationPresentation.className,
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</nav>
|
|
66
|
+
{footer === undefined
|
|
67
|
+
? null
|
|
68
|
+
: (
|
|
69
|
+
<footer
|
|
70
|
+
{...edgePresentation}
|
|
71
|
+
className={cn(
|
|
72
|
+
"hraness-design-navigation-rail__footer",
|
|
73
|
+
edgePresentation.className,
|
|
74
|
+
)}
|
|
75
|
+
>
|
|
76
|
+
{footer}
|
|
77
|
+
</footer>
|
|
78
|
+
)}
|
|
79
|
+
</aside>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface RailSectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
84
|
+
readonly title?: ReactNode;
|
|
85
|
+
readonly titleAs?: ContentHeadingLevel;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function RailSection({
|
|
89
|
+
children,
|
|
90
|
+
className,
|
|
91
|
+
title,
|
|
92
|
+
titleAs = "h2",
|
|
93
|
+
...props
|
|
94
|
+
}: RailSectionProps) {
|
|
95
|
+
const Heading = titleAs;
|
|
96
|
+
const rootPresentation = stylex.props(navigationRailStyles.section);
|
|
97
|
+
const titlePresentation = stylex.props(navigationRailStyles.sectionTitle);
|
|
98
|
+
const itemsPresentation = stylex.props(navigationRailStyles.sectionItems);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<section
|
|
102
|
+
{...rootPresentation}
|
|
103
|
+
{...props}
|
|
104
|
+
className={cn(
|
|
105
|
+
"hraness-design-rail-section",
|
|
106
|
+
rootPresentation.className,
|
|
107
|
+
className,
|
|
108
|
+
)}
|
|
109
|
+
>
|
|
110
|
+
{title === undefined
|
|
111
|
+
? null
|
|
112
|
+
: (
|
|
113
|
+
<Heading
|
|
114
|
+
{...titlePresentation}
|
|
115
|
+
className={cn(
|
|
116
|
+
"hraness-design-rail-section__title",
|
|
117
|
+
titlePresentation.className,
|
|
118
|
+
)}
|
|
119
|
+
>
|
|
120
|
+
{title}
|
|
121
|
+
</Heading>
|
|
122
|
+
)}
|
|
123
|
+
<div
|
|
124
|
+
{...itemsPresentation}
|
|
125
|
+
className={cn(
|
|
126
|
+
"hraness-design-rail-section__items",
|
|
127
|
+
itemsPresentation.className,
|
|
128
|
+
)}
|
|
129
|
+
>
|
|
130
|
+
{children}
|
|
131
|
+
</div>
|
|
132
|
+
</section>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface RailItemProps extends Omit<
|
|
137
|
+
LinkProps,
|
|
138
|
+
"children" | "className" | "xstyle"
|
|
139
|
+
> {
|
|
140
|
+
readonly badge?: ReactNode;
|
|
141
|
+
readonly className?: string;
|
|
142
|
+
readonly description?: ReactNode;
|
|
143
|
+
readonly icon?: ReactNode;
|
|
144
|
+
readonly isActive?: boolean;
|
|
145
|
+
readonly label: ReactNode;
|
|
146
|
+
/** Typed StyleX presentation applied after the RailItem recipe. */
|
|
147
|
+
readonly xstyle?: LinkProps["xstyle"];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function RailItem({
|
|
151
|
+
badge,
|
|
152
|
+
className,
|
|
153
|
+
description,
|
|
154
|
+
href,
|
|
155
|
+
icon,
|
|
156
|
+
isActive = false,
|
|
157
|
+
label,
|
|
158
|
+
xstyle,
|
|
159
|
+
...props
|
|
160
|
+
}: RailItemProps) {
|
|
161
|
+
const iconPresentation = stylex.props(navigationRailStyles.itemIcon);
|
|
162
|
+
const copyPresentation = stylex.props(navigationRailStyles.itemCopy);
|
|
163
|
+
const labelPresentation = stylex.props(navigationRailStyles.itemLabel);
|
|
164
|
+
const descriptionPresentation = stylex.props(
|
|
165
|
+
navigationRailStyles.itemDescription,
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Link
|
|
170
|
+
{...props}
|
|
171
|
+
aria-current={isActive ? "page" : undefined}
|
|
172
|
+
className={cn("hraness-design-rail-item", className)}
|
|
173
|
+
href={href}
|
|
174
|
+
xstyle={[
|
|
175
|
+
navigationRailStyles.item,
|
|
176
|
+
navigationRailStyles.itemNativeInteractionFallbacks,
|
|
177
|
+
isActive && navigationRailStyles.itemActive,
|
|
178
|
+
xstyle,
|
|
179
|
+
]}
|
|
180
|
+
>
|
|
181
|
+
{icon === undefined
|
|
182
|
+
? null
|
|
183
|
+
: (
|
|
184
|
+
<span
|
|
185
|
+
{...iconPresentation}
|
|
186
|
+
aria-hidden="true"
|
|
187
|
+
className={cn(
|
|
188
|
+
"hraness-design-rail-item__icon",
|
|
189
|
+
iconPresentation.className,
|
|
190
|
+
)}
|
|
191
|
+
>
|
|
192
|
+
{icon}
|
|
193
|
+
</span>
|
|
194
|
+
)}
|
|
195
|
+
<span
|
|
196
|
+
{...copyPresentation}
|
|
197
|
+
className={cn(
|
|
198
|
+
"hraness-design-rail-item__copy",
|
|
199
|
+
copyPresentation.className,
|
|
200
|
+
)}
|
|
201
|
+
>
|
|
202
|
+
<span
|
|
203
|
+
{...labelPresentation}
|
|
204
|
+
className={cn(
|
|
205
|
+
"hraness-design-rail-item__label",
|
|
206
|
+
labelPresentation.className,
|
|
207
|
+
)}
|
|
208
|
+
>
|
|
209
|
+
{label}
|
|
210
|
+
</span>
|
|
211
|
+
{description === undefined
|
|
212
|
+
? null
|
|
213
|
+
: (
|
|
214
|
+
<span
|
|
215
|
+
{...descriptionPresentation}
|
|
216
|
+
className={cn(
|
|
217
|
+
"hraness-design-rail-item__description",
|
|
218
|
+
descriptionPresentation.className,
|
|
219
|
+
)}
|
|
220
|
+
>
|
|
221
|
+
{description}
|
|
222
|
+
</span>
|
|
223
|
+
)}
|
|
224
|
+
</span>
|
|
225
|
+
{badge === undefined ? null : <span className="hraness-design-rail-item__badge">{badge}</span>}
|
|
226
|
+
</Link>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CSSProperties,
|
|
3
|
+
HTMLAttributes,
|
|
4
|
+
ReactNode,
|
|
5
|
+
} from "react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@hraness/ui";
|
|
8
|
+
import * as stylex from "@stylexjs/stylex";
|
|
9
|
+
|
|
10
|
+
import { effectsStyles } from "./effects.stylex.js";
|
|
11
|
+
import {
|
|
12
|
+
createParticleHaloRecipe,
|
|
13
|
+
type ProceduralColorRole,
|
|
14
|
+
type ProceduralEffectInput,
|
|
15
|
+
} from "./procedural-recipe.js";
|
|
16
|
+
|
|
17
|
+
type ProceduralStyle = CSSProperties & Record<`--hraness-design-${string}`, string | number>;
|
|
18
|
+
|
|
19
|
+
export type ParticleHaloProps = ProceduralEffectInput
|
|
20
|
+
& Omit<HTMLAttributes<HTMLDivElement>, "aria-hidden" | "children"> & Readonly<{
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
const colorVariables = {
|
|
25
|
+
highlight: "var(--hraness-design-procedural-highlight)",
|
|
26
|
+
key: "var(--hraness-design-procedural-key)",
|
|
27
|
+
shadow: "var(--hraness-design-procedural-shadow)",
|
|
28
|
+
support: "var(--hraness-design-procedural-support)",
|
|
29
|
+
} as const satisfies Readonly<Record<ProceduralColorRole, string>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Wraps ordinary semantic artwork in a deterministic decorative particle
|
|
33
|
+
* field. The children stay visible and remain the only meaningful content.
|
|
34
|
+
*/
|
|
35
|
+
export function ParticleHalo({
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
palette,
|
|
39
|
+
seed,
|
|
40
|
+
style,
|
|
41
|
+
variation,
|
|
42
|
+
...props
|
|
43
|
+
}: ParticleHaloProps) {
|
|
44
|
+
const recipe = createParticleHaloRecipe({
|
|
45
|
+
seed,
|
|
46
|
+
...(palette === undefined ? {} : { palette }),
|
|
47
|
+
...(variation === undefined ? {} : { variation }),
|
|
48
|
+
});
|
|
49
|
+
const rootStyle: ProceduralStyle = {
|
|
50
|
+
"--hraness-design-procedural-highlight": recipe.palette.highlight,
|
|
51
|
+
"--hraness-design-procedural-key": recipe.palette.key,
|
|
52
|
+
"--hraness-design-procedural-shadow": recipe.palette.shadow,
|
|
53
|
+
"--hraness-design-procedural-support": recipe.palette.support,
|
|
54
|
+
...style,
|
|
55
|
+
};
|
|
56
|
+
const rootPresentation = stylex.props(effectsStyles.particleRoot);
|
|
57
|
+
const fieldPresentation = stylex.props(effectsStyles.particleField);
|
|
58
|
+
const particlePresentation = stylex.props(effectsStyles.particle);
|
|
59
|
+
const contentPresentation = stylex.props(effectsStyles.particleContent);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
{...props}
|
|
64
|
+
className={cn(
|
|
65
|
+
"hraness-design-particle-halo",
|
|
66
|
+
rootPresentation.className,
|
|
67
|
+
className,
|
|
68
|
+
)}
|
|
69
|
+
data-recipe-version={recipe.version}
|
|
70
|
+
data-variation={recipe.variation}
|
|
71
|
+
style={rootStyle}
|
|
72
|
+
>
|
|
73
|
+
<span
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
className={cn(
|
|
76
|
+
"hraness-design-particle-halo__particles",
|
|
77
|
+
fieldPresentation.className,
|
|
78
|
+
)}
|
|
79
|
+
role="presentation"
|
|
80
|
+
>
|
|
81
|
+
{recipe.particles.map((particle, index) => {
|
|
82
|
+
const particleStyle: ProceduralStyle = {
|
|
83
|
+
"--hraness-design-particle-color": colorVariables[particle.color],
|
|
84
|
+
"--hraness-design-particle-delay": `${particle.delay}ms`,
|
|
85
|
+
"--hraness-design-particle-drift-x": `${particle.driftX}px`,
|
|
86
|
+
"--hraness-design-particle-drift-y": `${particle.driftY}px`,
|
|
87
|
+
"--hraness-design-particle-duration": `${particle.duration}ms`,
|
|
88
|
+
"--hraness-design-particle-opacity": particle.opacity,
|
|
89
|
+
"--hraness-design-particle-size": `${particle.size}px`,
|
|
90
|
+
"--hraness-design-particle-x": `${particle.x}%`,
|
|
91
|
+
"--hraness-design-particle-y": `${particle.y}%`,
|
|
92
|
+
};
|
|
93
|
+
return (
|
|
94
|
+
<i
|
|
95
|
+
className={cn(
|
|
96
|
+
"hraness-design-particle-halo__particle",
|
|
97
|
+
particlePresentation.className,
|
|
98
|
+
)}
|
|
99
|
+
key={index}
|
|
100
|
+
style={particleStyle}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
})}
|
|
104
|
+
</span>
|
|
105
|
+
<div
|
|
106
|
+
className={cn(
|
|
107
|
+
"hraness-design-particle-halo__content",
|
|
108
|
+
contentPresentation.className,
|
|
109
|
+
)}
|
|
110
|
+
>
|
|
111
|
+
{children}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|