@krizaka/ui 3.64.1 → 3.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-menu.d.ts +7 -3
- package/dist/account-menu.js +14 -10
- package/dist/account-menu.js.map +1 -1
- package/dist/app-frame/server.d.ts +123 -0
- package/dist/app-frame/server.js +109 -0
- package/dist/app-frame/server.js.map +1 -0
- package/dist/app-frame.d.ts +210 -0
- package/dist/app-frame.js +220 -0
- package/dist/app-frame.js.map +1 -0
- package/dist/desktop-window.d.ts +223 -0
- package/dist/desktop-window.js +261 -0
- package/dist/desktop-window.js.map +1 -0
- package/dist/file-upload.d.ts +2 -2
- package/dist/filter-bar.d.ts +3 -3
- package/dist/language-switch.d.ts +9 -9
- package/dist/native.d.ts +218 -3
- package/dist/native.js +1638 -1450
- package/dist/native.js.map +1 -1
- package/dist/theme.d.ts +3 -1
- package/dist/theme.js +4 -0
- package/dist/theme.js.map +1 -1
- package/package.json +47 -5
- package/registry/account-menu.json +22 -8
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +564 -0
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +3 -3
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +407 -0
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/app-frame/admin.d.ts +4 -0
- package/registry/examples/app-frame/admin.js +32 -0
- package/registry/examples/app-frame/admin.tsx +33 -0
- package/registry/examples/app-frame/app.d.ts +4 -0
- package/registry/examples/app-frame/app.js +53 -0
- package/registry/examples/app-frame/app.tsx +56 -0
- package/registry/examples/desktop-window/library.d.ts +4 -0
- package/registry/examples/desktop-window/library.js +49 -0
- package/registry/examples/desktop-window/library.tsx +58 -0
- package/registry/examples/form-flow/native/signup.d.ts +4 -0
- package/registry/examples/form-flow/native/signup.dark.png +0 -0
- package/registry/examples/form-flow/native/signup.js +26 -0
- package/registry/examples/form-flow/native/signup.light.png +0 -0
- package/registry/examples/form-flow/native/signup.tsx +23 -0
- package/registry/examples/grid/native/columns.d.ts +4 -0
- package/registry/examples/grid/native/columns.dark.png +0 -0
- package/registry/examples/grid/native/columns.js +23 -0
- package/registry/examples/grid/native/columns.light.png +0 -0
- package/registry/examples/grid/native/columns.tsx +20 -0
- package/registry/examples/grid/native/photos.d.ts +4 -0
- package/registry/examples/grid/native/photos.dark.png +0 -0
- package/registry/examples/grid/native/photos.js +14 -0
- package/registry/examples/grid/native/photos.light.png +0 -0
- package/registry/examples/grid/native/photos.tsx +18 -0
- package/registry/examples/grid/native/stats.d.ts +4 -0
- package/registry/examples/grid/native/stats.dark.png +0 -0
- package/registry/examples/grid/native/stats.js +22 -0
- package/registry/examples/grid/native/stats.light.png +0 -0
- package/registry/examples/grid/native/stats.tsx +24 -0
- package/registry/examples/list-detail/native/inbox.d.ts +4 -0
- package/registry/examples/list-detail/native/inbox.dark.png +0 -0
- package/registry/examples/list-detail/native/inbox.js +35 -0
- package/registry/examples/list-detail/native/inbox.light.png +0 -0
- package/registry/examples/list-detail/native/inbox.tsx +35 -0
- package/registry/examples/screen/native/dashboard.d.ts +4 -0
- package/registry/examples/screen/native/dashboard.dark.png +0 -0
- package/registry/examples/screen/native/dashboard.js +48 -0
- package/registry/examples/screen/native/dashboard.light.png +0 -0
- package/registry/examples/screen/native/dashboard.tsx +52 -0
- package/registry/examples/screen/native/settings-home.d.ts +4 -0
- package/registry/examples/screen/native/settings-home.dark.png +0 -0
- package/registry/examples/screen/native/settings-home.js +26 -0
- package/registry/examples/screen/native/settings-home.light.png +0 -0
- package/registry/examples/screen/native/settings-home.tsx +25 -0
- package/registry/examples/shop/hero-tv.js +1 -1
- package/registry/examples/shop/hero-tv.tsx +1 -1
- package/registry/examples/state-screen/native/empty.d.ts +4 -0
- package/registry/examples/state-screen/native/empty.dark.png +0 -0
- package/registry/examples/state-screen/native/empty.js +12 -0
- package/registry/examples/state-screen/native/empty.light.png +0 -0
- package/registry/examples/state-screen/native/empty.tsx +11 -0
- package/registry/examples/state-screen/native/error.d.ts +4 -0
- package/registry/examples/state-screen/native/error.dark.png +0 -0
- package/registry/examples/state-screen/native/error.js +21 -0
- package/registry/examples/state-screen/native/error.light.png +0 -0
- package/registry/examples/state-screen/native/error.tsx +17 -0
- package/registry/examples/state-screen/native/offline.d.ts +4 -0
- package/registry/examples/state-screen/native/offline.dark.png +0 -0
- package/registry/examples/state-screen/native/offline.js +15 -0
- package/registry/examples/state-screen/native/offline.light.png +0 -0
- package/registry/examples/state-screen/native/offline.tsx +12 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form-flow.json +152 -0
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/grid.json +262 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +314 -12
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list-detail.json +188 -0
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/onboarding.json +3 -0
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/screen.json +68 -4
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +5 -2
- package/registry/shop-composer.json +1 -1
- package/registry/shop.json +3 -3
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +4 -4
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/state-screen.json +224 -0
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +3 -3
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "app-frame",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "App frame",
|
|
5
|
+
"summary": "The one signed-in frame of a Krizaka web product: the rail (a bottom tab bar on a phone), the family's top bar and the account menu, composed from data — sections, account and the primary action. The frame owns what must not differ between products: the account menu's content and order, the preferences living in the menu, a place being on the rail or under the avatar, never both.",
|
|
6
|
+
"description": "The one signed-in frame of a Krizaka web product: the rail (a bottom tab bar on a phone), the family's top bar and the account menu, composed from data — sections, account and the primary action. The frame owns what must not differ between products: the account menu's content and order, the preferences living in the menu, a place being on the rail or under the avatar, never both.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"deprecated": null,
|
|
9
|
+
"category": "layouts",
|
|
10
|
+
"platforms": "web",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "n/a",
|
|
17
|
+
"reason": "On a phone the frame is a tab bar, a header and a screen: the native twin is the tabs shell template.",
|
|
18
|
+
"use": "tab-bar"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "yes"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"whenToUse": [
|
|
25
|
+
"Every signed-in screen of a product: Yomizaka, Akinaza, Orazaka — and each one's administration (`variant=\"admin\"`).",
|
|
26
|
+
"When a fourth product needs the frame: write its sections, not another header."
|
|
27
|
+
],
|
|
28
|
+
"whenNotToUse": [
|
|
29
|
+
{
|
|
30
|
+
"when": "A console with grouped sections, counts and keyboard shortcuts in a collapsing sidebar of words.",
|
|
31
|
+
"use": "app-shell"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"when": "A public page of a site.",
|
|
35
|
+
"use": "nav-bar"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"when": "A desktop window (Tauri) with a title bar.",
|
|
39
|
+
"use": "app-shell"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"bestPractices": [
|
|
43
|
+
"Pass the sections the product has: `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person (a permission, a feature not open). Five main sections at most: a phone's tab bar carries five.",
|
|
44
|
+
"The account menu is fixed: identity, Profile, Settings, Billing (only when you pass it), Administration (only for an admin), then Language and Theme, then Sign out. Settings is one entry that lands on the settings home, never a tab.",
|
|
45
|
+
"A place is on the rail or under the avatar, never both: a section with the id of an account link (`settings`, `billing`) leaves the rail.",
|
|
46
|
+
"The theme and the language are always in the menu, never in the header: a phone's header has no room. The theme is the `ThemeProvider`'s unless you pass `theme`.",
|
|
47
|
+
"Say the shared words with the shared vocabulary (`navWords`, EN/FR): Docs, Terms / Conditions d'utilisation, Settings / Réglages. Override one (`words`) only when the product truly says it otherwise (« Credits and usage »).",
|
|
48
|
+
"The public bar is the other half of the family: `publicBarLinks` gives its flat links, four at most — How it works · Pricing · Docs · Download.",
|
|
49
|
+
"The page inside is `<main id=\"content\">`; the frame does not draw it."
|
|
50
|
+
],
|
|
51
|
+
"accessibility": {
|
|
52
|
+
"keyboard": [
|
|
53
|
+
{
|
|
54
|
+
"keys": "Tab",
|
|
55
|
+
"action": "Moves through the rail's items, the search, the primary action and the account menu."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"keys": "↑ ↓ (rail) · ← → (tab bar)",
|
|
59
|
+
"action": "Moves between the rail's items."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"keys": "Enter / Space / Arrow down",
|
|
63
|
+
"action": "Opens the account menu; Arrow right opens Language or Theme, Esc goes back."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"keys": "⌘K / Ctrl+K",
|
|
67
|
+
"action": "Opens the search (the host's command palette)."
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"notes": [
|
|
71
|
+
"The rail is a `nav` named by `label`; the current section carries `aria-current=\"page\"`.",
|
|
72
|
+
"Exactly one brand mark is visible at every width (the rail's on a desktop, the top bar's on a phone).",
|
|
73
|
+
"A count on a section is said in words with `badgeLabel`."
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"related": [
|
|
77
|
+
"rail-nav",
|
|
78
|
+
"app-header",
|
|
79
|
+
"account-menu",
|
|
80
|
+
"app-shell",
|
|
81
|
+
"nav-bar"
|
|
82
|
+
],
|
|
83
|
+
"web": {
|
|
84
|
+
"entry": "@krizaka/ui/app-frame",
|
|
85
|
+
"import": "import { AppFrame, navWords, publicBarLinks, framePlaces } from \"@krizaka/ui/app-frame\";",
|
|
86
|
+
"props": [
|
|
87
|
+
{
|
|
88
|
+
"component": "AppFrame",
|
|
89
|
+
"description": "The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out.",
|
|
90
|
+
"props": [
|
|
91
|
+
{
|
|
92
|
+
"name": "account",
|
|
93
|
+
"type": "AppFrameAccount",
|
|
94
|
+
"default": null,
|
|
95
|
+
"description": "Who is signed in, the places under their avatar and Sign out.",
|
|
96
|
+
"required": true
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "children",
|
|
100
|
+
"type": "ReactNode",
|
|
101
|
+
"default": null,
|
|
102
|
+
"description": "The page, inside `RailNav.Body` under the top bar.",
|
|
103
|
+
"required": true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "homeHref",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"default": null,
|
|
109
|
+
"description": "Where the mark and the name lead (`/app`).",
|
|
110
|
+
"required": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "mark",
|
|
114
|
+
"type": "ReactNode",
|
|
115
|
+
"default": null,
|
|
116
|
+
"description": "The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone.",
|
|
117
|
+
"required": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "name",
|
|
121
|
+
"type": "string",
|
|
122
|
+
"default": null,
|
|
123
|
+
"description": "The product's name, as text in the top bar.",
|
|
124
|
+
"required": true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "sections",
|
|
128
|
+
"type": "readonly FrameSection[]",
|
|
129
|
+
"default": null,
|
|
130
|
+
"description": "The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person.",
|
|
131
|
+
"required": true
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "accent",
|
|
135
|
+
"type": "BrandId",
|
|
136
|
+
"default": null,
|
|
137
|
+
"description": "The product's brand: scopes its colours over the rail.",
|
|
138
|
+
"required": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "chips",
|
|
142
|
+
"type": "ReactNode",
|
|
143
|
+
"default": null,
|
|
144
|
+
"description": "Chips beside the name (`Dev`, `Local · Sovereign`).",
|
|
145
|
+
"required": false
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "currentId",
|
|
149
|
+
"type": "string",
|
|
150
|
+
"default": null,
|
|
151
|
+
"description": "The id of the section the person is in.",
|
|
152
|
+
"required": false
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "headerMark",
|
|
156
|
+
"type": "ReactNode",
|
|
157
|
+
"default": null,
|
|
158
|
+
"description": "The mark in the top bar below `md` (smaller). Defaults to `mark`.",
|
|
159
|
+
"required": false
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "label",
|
|
163
|
+
"type": "string",
|
|
164
|
+
"default": null,
|
|
165
|
+
"description": "The rail's accessible name. Defaults to the product's name.",
|
|
166
|
+
"required": false
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "language",
|
|
170
|
+
"type": "AppFrameLanguage",
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "The language row of the account menu; absent for a product with one language.",
|
|
173
|
+
"required": false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "linkAs",
|
|
177
|
+
"type": "ElementType<any, keyof IntrinsicElements>",
|
|
178
|
+
"default": null,
|
|
179
|
+
"description": "The router's link component (Next's `Link`) for the rail and the menu.",
|
|
180
|
+
"required": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "locale",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"default": "en",
|
|
186
|
+
"description": "`en` or `fr`: the words of the shared vocabulary.",
|
|
187
|
+
"required": false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "notifications",
|
|
191
|
+
"type": "ReactNode",
|
|
192
|
+
"default": null,
|
|
193
|
+
"description": "Notifications: an `AppHeaderCount`, or the trigger of the host's popover.",
|
|
194
|
+
"required": false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "primary",
|
|
198
|
+
"type": "ReactNode",
|
|
199
|
+
"default": null,
|
|
200
|
+
"description": "The one primary action of the app (« Check a document »).",
|
|
201
|
+
"required": false
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "search",
|
|
205
|
+
"type": "{ label: string; onOpen: () => void; }",
|
|
206
|
+
"default": null,
|
|
207
|
+
"description": "The search (⌘K): opens the app's command palette.",
|
|
208
|
+
"required": false
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "theme",
|
|
212
|
+
"type": "false | AppFrameTheme",
|
|
213
|
+
"default": null,
|
|
214
|
+
"description": "The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none.",
|
|
215
|
+
"required": false
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "variant",
|
|
219
|
+
"type": "\"app\" | \"admin\"",
|
|
220
|
+
"default": "app",
|
|
221
|
+
"description": "`admin`: the administration's frame — a chip says so, and the way into it is not offered again.",
|
|
222
|
+
"required": false
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "words",
|
|
226
|
+
"type": "Partial<NavWords>",
|
|
227
|
+
"default": null,
|
|
228
|
+
"description": "Overrides of the shared words, for a product that needs one different (use sparingly).",
|
|
229
|
+
"required": false
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"component": "ACCOUNT_LINK_IDS",
|
|
235
|
+
"description": "The places the account menu can hold, in the order the frame draws them.",
|
|
236
|
+
"props": []
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"component": "ACCOUNT_MENU_ORDER",
|
|
240
|
+
"description": "The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product.",
|
|
241
|
+
"props": []
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"component": "MAIN_SECTIONS_MAX",
|
|
245
|
+
"description": "The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar).",
|
|
246
|
+
"props": []
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"component": "PUBLIC_BAR_MAX",
|
|
250
|
+
"description": "The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3).",
|
|
251
|
+
"props": []
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"examples": [
|
|
255
|
+
{
|
|
256
|
+
"name": "app",
|
|
257
|
+
"title": "A product's signed-in app",
|
|
258
|
+
"description": "Yomizaka: four sections with a count, the search, the primary action « Check a document », and the account menu with Language and Theme.",
|
|
259
|
+
"template": true,
|
|
260
|
+
"purpose": "operate",
|
|
261
|
+
"why": "A person works in a few sections all day and finds their account, language and theme in the same place in every Krizaka product.",
|
|
262
|
+
"path": "examples/app-frame/app.tsx",
|
|
263
|
+
"module": "@krizaka/ui/registry/examples/app-frame/app",
|
|
264
|
+
"code": "\"use client\";\n\nimport { ProductLogo } from \"@krizaka/ui\";\nimport { AppFrame, type FrameSection } from \"@krizaka/ui/app-frame\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { Stat } from \"@krizaka/ui/stat\";\nimport type { Mode } from \"@krizaka/ui/theme\";\nimport { useState } from \"react\";\n\nconst icon = (d: string) => (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\nconst SECTIONS: FrameSection[] = [\n { id: \"home\", label: \"Home\", href: \"#home\", icon: icon(\"M4 11 12 4l8 7v9H4z\") },\n { id: \"files\", label: \"Applicant files\", href: \"#files\", icon: icon(\"M4 5h16v14H4zM8 9h8M8 13h5\"), badge: 3, badgeLabel: \"3 to decide\" },\n { id: \"documents\", label: \"Documents\", href: \"#documents\", icon: icon(\"M7 3h8l4 4v14H7zM15 3v4h4\") },\n { id: \"checks\", label: \"Checks\", href: \"#checks\", icon: icon(\"M5 12l4 4 10-10\") },\n];\n\n// TEMPLATE — The signed-in frame of a product (Yomizaka): the rail (a tab bar on a phone), the top bar with its search, the\n// one primary action and the account menu. Settings is under the avatar, so it is not a section. The product writes only its sections; the menu, its order and the preferences are the frame's.\nexport default function AppFrameApp() {\n const [language, setLanguage] = useState(\"en\");\n // Inside a ThemeProvider the frame reads the theme itself; here it is passed.\n const [mode, setMode] = useState<Mode>(\"system\");\n return (\n <AppFrame\n name=\"Yomizaka\"\n accent=\"yomizaka\"\n mark={<ProductLogo id=\"yomizaka\" size={26} animated={false} />}\n headerMark={<ProductLogo id=\"yomizaka\" size={22} animated={false} />}\n homeHref=\"#home\"\n sections={SECTIONS}\n currentId=\"home\"\n search={{ label: \"Search files and checks\", onOpen: () => {} }}\n primary={<Button size=\"sm\" shape=\"cut\">Check a document</Button>}\n account={{\n name: \"Eric Tremblay\",\n email: \"eric@example.com\",\n avatar: { defaultAvatar: { brand: \"yomizaka\", seed: \"eric\" } },\n links: { settings: { href: \"#settings\" }, profile: { href: \"#profile\" }, billing: { href: \"#billing\", label: \"Credits and usage\" } },\n onSignOut: () => {},\n }}\n language={{ value: language, onChange: setLanguage, options: [{ value: \"en\", label: \"English\" }, { value: \"fr\", label: \"Français\" }] }}\n theme={{ value: mode, onChange: setMode }}\n >\n <main id=\"content\" tabIndex={-1} className=\"grid gap-4 p-4 sm:grid-cols-3 md:p-6\">\n <Stat label=\"Files to decide\" value=\"3\" />\n <Stat label=\"Checks this month\" value=\"42\" />\n <Stat label=\"Credits left\" value=\"58\" />\n </main>\n </AppFrame>\n );\n}\n"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "admin",
|
|
268
|
+
"title": "The administration",
|
|
269
|
+
"description": "`variant=\"admin\"` in French: the same frame, a chip that says where you are, and no way into the administration offered again.",
|
|
270
|
+
"template": true,
|
|
271
|
+
"purpose": "operate",
|
|
272
|
+
"why": "An administrator moves from the app to its administration without the frame changing under them.",
|
|
273
|
+
"path": "examples/app-frame/admin.tsx",
|
|
274
|
+
"module": "@krizaka/ui/registry/examples/app-frame/admin",
|
|
275
|
+
"code": "\"use client\";\n\nimport { ProductLogo } from \"@krizaka/ui\";\nimport { AppFrame } from \"@krizaka/ui/app-frame\";\n\nconst icon = (d: string) => (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\n\n// The administration's frame (`variant=\"admin\"`): the same bar and menu, a chip that says where you are, and no way into the administration offered again.\nexport default function AppFrameAdmin() {\n return (\n <AppFrame\n variant=\"admin\"\n name=\"Akinaza\"\n accent=\"akinaza\"\n mark={<ProductLogo id=\"akinaza\" size={26} animated={false} />}\n homeHref=\"#overview\"\n locale=\"fr\"\n currentId=\"users\"\n sections={[\n { id: \"overview\", label: \"Vue d'ensemble\", href: \"#overview\", icon: icon(\"M4 11 12 4l8 7v9H4z\") },\n { id: \"users\", label: \"Personnes\", href: \"#users\", icon: icon(\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20a8 8 0 0 1 16 0\") },\n { id: \"audit\", label: \"Journal d'audit\", href: \"#audit\", icon: icon(\"M5 4h14v16H5zM9 9h6M9 13h6\") },\n ]}\n account={{ name: \"Nadia\", email: \"nadia@example.com\", links: { profile: { href: \"#profile\" }, settings: { href: \"#settings\" }, administration: { href: \"#admin\" } }, onSignOut: () => {} }}\n >\n <main id=\"content\" tabIndex={-1} className=\"p-4 text-sm text-fg-secondary md:p-6\">Les personnes inscrites.</main>\n </AppFrame>\n );\n}\n"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"native": null,
|
|
280
|
+
"files": [
|
|
281
|
+
{
|
|
282
|
+
"path": "app-frame/app-frame.tsx",
|
|
283
|
+
"content": "// Client (the rail's state, the account menu, the theme). THE signed-in frame of every Krizaka web product (audit F1, F2,\n// F6): the rail (a bottom tab bar on a phone) and the family's top bar, composed once from data. The product keeps its\n// list of sections; the frame owns the rest — the account menu's content and order, where the preferences live (always in\n// the menu: a header has no room for them on a phone), which place is on the rail and which is under the avatar.\nimport { AccountMenu, type AccountMenuLink } from \"@krizaka/ui/account-menu\";\nimport { AppHeader } from \"@krizaka/ui/app-header\";\nimport { AppHeaderSearch } from \"@krizaka/ui/app-header/search\";\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { RailNav } from \"@krizaka/ui/rail-nav\";\nimport { type Mode, useOptionalTheme } from \"@krizaka/ui/theme\";\nimport * as React from \"react\";\n\nimport type { BrandId } from \"../marks/ProductLogo\";\nimport { type AccountLinkId, framePlaces, type FrameSection, orderAccountLinks } from \"./contract\";\nimport { navVocabulary, type NavWords } from \"./vocabulary\";\n\nexport interface AppFrameAccountLink {\n href: string;\n /** Overrides the shared word (`Credits and usage` for billing where credits exist). */\n label?: string;\n icon?: React.ReactNode;\n}\n\nexport interface AppFrameAccount {\n name?: string;\n email?: string;\n /** `src`, or `defaultAvatar` (`{ brand, seed }`). */\n avatar?: React.ComponentProps<typeof AccountMenu>[\"avatar\"];\n /**\n * The places under the avatar. Pass the ones the product has: Billing only when it sells, Administration only for an\n * admin. The frame draws them in its order (Profile, Settings, Billing, Administration), Settings landing on the settings home.\n */\n links?: Partial<Record<AccountLinkId, AppFrameAccountLink>>;\n /** Called by Sign out. */\n onSignOut: () => void;\n}\n\nexport interface AppFrameLanguage {\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AppFrameTheme {\n value: Mode;\n onChange: (mode: Mode) => void;\n}\n\nexport interface AppFrameProps {\n /** The product's name, as text in the top bar. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone. */\n mark: React.ReactNode;\n /** The mark in the top bar below `md` (smaller). Defaults to `mark`. */\n headerMark?: React.ReactNode;\n /** Where the mark and the name lead (`/app`). */\n homeHref: string;\n /** The product's brand: scopes its colours over the rail. */\n accent?: BrandId;\n /** The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person. */\n sections: readonly FrameSection[];\n /** The id of the section the person is in. */\n currentId?: string;\n /** Who is signed in, the places under their avatar and Sign out. */\n account: AppFrameAccount;\n /** The one primary action of the app (« Check a document »). */\n primary?: React.ReactNode;\n /** The search (⌘K): opens the app's command palette. */\n search?: { label: string; onOpen: () => void };\n /** Notifications: an `AppHeaderCount`, or the trigger of the host's popover. */\n notifications?: React.ReactNode;\n /** Chips beside the name (`Dev`, `Local · Sovereign`). */\n chips?: React.ReactNode;\n /** `admin`: the administration's frame — a chip says so, and the way into it is not offered again. */\n variant?: \"app\" | \"admin\";\n /** The language row of the account menu; absent for a product with one language. */\n language?: AppFrameLanguage;\n /** The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none. */\n theme?: AppFrameTheme | false;\n /** `en` or `fr`: the words of the shared vocabulary. @default \"en\" */\n locale?: string;\n /** Overrides of the shared words, for a product that needs one different (use sparingly). */\n words?: Partial<NavWords>;\n /** The router's link component (Next's `Link`) for the rail and the menu. */\n linkAs?: React.ElementType;\n /** The page, inside `RailNav.Body` under the top bar. */\n children: React.ReactNode;\n /** The rail's accessible name. Defaults to the product's name. */\n label?: string;\n}\n\nconst MODES: readonly Mode[] = [\"light\", \"dark\", \"system\"];\n\nfunction useFrameTheme(theme: AppFrameProps[\"theme\"]): AppFrameTheme | null {\n const provided = useOptionalTheme();\n if (theme === false) return null;\n if (theme) return theme;\n return provided ? { value: provided.mode, onChange: provided.setMode } : null;\n}\n\n/** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */\nexport function AppFrame({\n name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant = \"app\", language, theme, locale = \"en\", words, linkAs: Link, children, label,\n}: AppFrameProps) {\n const w = { ...navVocabulary(locale), ...words };\n const admin = variant === \"admin\";\n const links = orderAccountLinks(account.links, admin);\n const places = framePlaces(sections, links.map((l) => l.id));\n const frameTheme = useFrameTheme(theme);\n const item = (section: FrameSection) => (\n <RailNav.Item\n key={section.id}\n asChild={Boolean(Link)}\n href={Link ? undefined : section.href}\n icon={section.icon}\n label={section.label}\n current={section.id === currentId}\n badge={section.badge}\n badgeLabel={section.badgeLabel}\n >\n {Link ? <Link href={section.href} /> : undefined}\n </RailNav.Item>\n );\n const menuLinks: AccountMenuLink[] = links.map(({ id, link }) => ({ id, label: link.label ?? w[id], href: link.href, icon: link.icon }));\n const modeLabels: Record<Mode, string> = { light: w.themeLight, dark: w.themeDark, system: w.themeSystem };\n return (\n <RailNav.Shell data-variant={variant}>\n <RailNav.Root\n label={label ?? name}\n accent={accent}\n mark={Link ? <Link href={homeHref} aria-label={name}>{mark}</Link> : <a href={homeHref} aria-label={name}>{mark}</a>}\n footer={places.foot.length > 0 ? places.foot.map(item) : undefined}\n >\n {places.main.map(item)}\n </RailNav.Root>\n <RailNav.Body>\n <AppHeader\n name={name}\n mark={headerMark ?? mark}\n href={Link ? undefined : homeHref}\n homeLink={Link ? <Link href={homeHref} /> : undefined}\n chips={\n <>\n {admin && <Badge tone=\"accent\">{w.administration}</Badge>}\n {chips}\n </>\n }\n search={search && <AppHeaderSearch label={search.label} onOpen={search.onOpen} />}\n notifications={notifications}\n primary={primary}\n account={\n <AccountMenu\n label={w.account}\n name={account.name}\n email={account.email}\n avatar={account.avatar}\n showName=\"lg\"\n links={menuLinks}\n linkAs={Link}\n language={language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange }}\n theme={frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value as Mode) } : undefined}\n signOut={{ label: w.signOut, onSelect: account.onSignOut }}\n />\n }\n />\n {children}\n </RailNav.Body>\n </RailNav.Shell>\n );\n}\n"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"path": "app-frame/contract.ts",
|
|
287
|
+
"content": "// Server-safe, pure. The rules of the signed-in frame, written once and tested (the audit's F1 and F2): what the account\n// menu holds and in which order, where a place lives (the rail or the avatar, never both), what a phone's tab bar can carry.\nimport type * as React from \"react\";\n\n/** The places the account menu can hold, in the order the frame draws them. */\nexport const ACCOUNT_LINK_IDS = [\"profile\", \"settings\", \"billing\", \"administration\"] as const;\nexport type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];\n\n/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */\nexport const ACCOUNT_MENU_ORDER = [\"identity\", \"profile\", \"settings\", \"billing\", \"administration\", \"language\", \"theme\", \"signOut\"] as const;\n\n/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */\nexport const MAIN_SECTIONS_MAX = 5;\n\nexport interface FrameSection {\n /** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */\n id: string;\n label: string;\n href: string;\n icon: React.ReactNode;\n /** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */\n gated?: boolean;\n /** A count on the icon. */\n badge?: string | number;\n /** The count in words (« 3 to decide »). */\n badgeLabel?: string;\n /** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default \"main\" */\n place?: \"main\" | \"foot\";\n}\n\nexport interface FramePlaces {\n main: FrameSection[];\n foot: FrameSection[];\n /** Sections left out of the rail because the account menu already holds that place (or because they are gated). */\n dropped: { id: string; reason: \"account\" | \"gated\" }[];\n}\n\n/**\n * Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,\n * never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).\n * A gated section leaves too.\n */\nexport function framePlaces(sections: readonly FrameSection[], accountLinks: readonly string[] = []): FramePlaces {\n const result: FramePlaces = { main: [], foot: [], dropped: [] };\n for (const section of sections) {\n if (section.gated) result.dropped.push({ id: section.id, reason: \"gated\" });\n else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: \"account\" });\n else result[section.place === \"foot\" ? \"foot\" : \"main\"].push(section);\n }\n return result;\n}\n\n/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */\nexport function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin = false): { id: AccountLinkId; link: T }[] {\n if (!links) return [];\n return ACCOUNT_LINK_IDS.flatMap((id) => {\n const link = links[id];\n // Inside the administration, the way into it is not offered again.\n return link && !(admin && id === \"administration\") ? [{ id, link }] : [];\n });\n}\n\n/** What is wrong with a frame's data, in words for the developer (empty: it is right). Used by the tests and by the dev warning. */\nexport function frameIssues(sections: readonly FrameSection[], accountLinks: readonly string[] = []): string[] {\n const issues: string[] = [];\n const ids = sections.map((s) => s.id);\n for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section \"${id}\" is declared twice.`);\n const places = framePlaces(sections, accountLinks);\n for (const { id, reason } of places.dropped) if (reason === \"account\") issues.push(`\"${id}\" is on the rail and under the avatar: a place is in one of them, so the rail drops it.`);\n if (places.main.length > MAIN_SECTIONS_MAX) issues.push(`${places.main.length} main sections: a phone's tab bar carries ${MAIN_SECTIONS_MAX} at most.`);\n return issues;\n}\n"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"path": "app-frame/index.ts",
|
|
291
|
+
"content": "/**\n * @krizaka/ui/app-frame — `AppFrame`: the one signed-in frame of every Krizaka web product (sections, account and the primary\n * action in; the rail — a tab bar on a phone —, the family's top bar and the account menu out, with the preferences always in\n * the menu), and the shared vocabulary and rules it is built on (also in `@krizaka/ui/app-frame/server`). Client.\n */\nexport { AppFrame, type AppFrameAccount, type AppFrameAccountLink, type AppFrameLanguage, type AppFrameProps, type AppFrameTheme } from \"./app-frame\";\nexport * from \"./server\";\n"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"path": "app-frame/meta.ts",
|
|
295
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"App frame\",\n summary: \"The one signed-in frame of a Krizaka web product: the rail (a bottom tab bar on a phone), the family's top bar and the account menu, composed from data — sections, account and the primary action. The frame owns what must not differ between products: the account menu's content and order, the preferences living in the menu, a place being on the rail or under the avatar, never both.\",\n status: \"beta\",\n category: \"layouts\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"On a phone the frame is a tab bar, a header and a screen: the native twin is the tabs shell template.\", use: \"tab-bar\" }, desktop: \"web\" },\n whenToUse: [\n \"Every signed-in screen of a product: Yomizaka, Akinaza, Orazaka — and each one's administration (`variant=\\\"admin\\\"`).\",\n \"When a fourth product needs the frame: write its sections, not another header.\",\n ],\n whenNotToUse: [\n { when: \"A console with grouped sections, counts and keyboard shortcuts in a collapsing sidebar of words.\", use: \"app-shell\" },\n { when: \"A public page of a site.\", use: \"nav-bar\" },\n { when: \"A desktop window (Tauri) with a title bar.\", use: \"app-shell\" },\n ],\n bestPractices: [\n \"Pass the sections the product has: `place: \\\"foot\\\"` puts one at the rail's foot; `gated` leaves one out for this person (a permission, a feature not open). Five main sections at most: a phone's tab bar carries five.\",\n \"The account menu is fixed: identity, Profile, Settings, Billing (only when you pass it), Administration (only for an admin), then Language and Theme, then Sign out. Settings is one entry that lands on the settings home, never a tab.\",\n \"A place is on the rail or under the avatar, never both: a section with the id of an account link (`settings`, `billing`) leaves the rail.\",\n \"The theme and the language are always in the menu, never in the header: a phone's header has no room. The theme is the `ThemeProvider`'s unless you pass `theme`.\",\n \"Say the shared words with the shared vocabulary (`navWords`, EN/FR): Docs, Terms / Conditions d'utilisation, Settings / Réglages. Override one (`words`) only when the product truly says it otherwise (« Credits and usage »).\",\n \"The public bar is the other half of the family: `publicBarLinks` gives its flat links, four at most — How it works · Pricing · Docs · Download.\",\n \"The page inside is `<main id=\\\"content\\\">`; the frame does not draw it.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves through the rail's items, the search, the primary action and the account menu.\" },\n { keys: \"↑ ↓ (rail) · ← → (tab bar)\", action: \"Moves between the rail's items.\" },\n { keys: \"Enter / Space / Arrow down\", action: \"Opens the account menu; Arrow right opens Language or Theme, Esc goes back.\" },\n { keys: \"⌘K / Ctrl+K\", action: \"Opens the search (the host's command palette).\" },\n ],\n notes: [\n \"The rail is a `nav` named by `label`; the current section carries `aria-current=\\\"page\\\"`.\",\n \"Exactly one brand mark is visible at every width (the rail's on a desktop, the top bar's on a phone).\",\n \"A count on a section is said in words with `badgeLabel`.\",\n ],\n },\n related: [\"rail-nav\", \"app-header\", \"account-menu\", \"app-shell\", \"nav-bar\"],\n web: {\n imports: [\"AppFrame\", \"navWords\", \"publicBarLinks\", \"framePlaces\"],\n examples: [\n { name: \"app\", title: \"A product's signed-in app\", description: \"Yomizaka: four sections with a count, the search, the primary action « Check a document », and the account menu with Language and Theme.\", template: true, purpose: \"operate\", why: \"A person works in a few sections all day and finds their account, language and theme in the same place in every Krizaka product.\" },\n { name: \"admin\", title: \"The administration\", description: \"`variant=\\\"admin\\\"` in French: the same frame, a chip that says where you are, and no way into the administration offered again.\", template: true, purpose: \"operate\", why: \"An administrator moves from the app to its administration without the frame changing under them.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"path": "app-frame/server.ts",
|
|
299
|
+
"content": "/**\n * @krizaka/ui/app-frame/server — the frame's data and rules, with no React and no directive: usable in a Server Component\n * (the footers and the public bar read the shared vocabulary there). `navWords` (EN/FR), `navWord`, `publicBarLinks`, the\n * account menu's fixed order and `framePlaces`.\n */\nexport { ACCOUNT_LINK_IDS, ACCOUNT_MENU_ORDER, type AccountLinkId, frameIssues, type FramePlaces, framePlaces, type FrameSection, MAIN_SECTIONS_MAX, orderAccountLinks } from \"./contract\";\nexport { type NavLocale, navVocabulary, navWord, type NavWordKey, type NavWords, navWords, PUBLIC_BAR_MAX, type PublicBarLink, publicBarLinks,type PublicBarSlot } from \"./vocabulary\";\n"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"path": "app-frame/vocabulary.ts",
|
|
303
|
+
"content": "// Server-safe: data and pure functions, no React. The words every Krizaka product says the same way (the audit's F4): the\n// frame's menus, the public bar's links and the footers read them, so « Docs », « Terms » and « Settings » never differ\n// between two products. English is the reference; a French key is required by the type.\nexport const navWords = {\n en: {\n docs: \"Docs\",\n terms: \"Terms\",\n privacy: \"Privacy\",\n settings: \"Settings\",\n billing: \"Billing\",\n profile: \"Profile\",\n administration: \"Administration\",\n account: \"Account\",\n language: \"Language\",\n theme: \"Theme\",\n themeLight: \"Light\",\n themeDark: \"Dark\",\n themeSystem: \"System\",\n signOut: \"Sign out\",\n howItWorks: \"How it works\",\n pricing: \"Pricing\",\n download: \"Download\",\n contact: \"Contact\",\n search: \"Search\",\n notifications: \"Notifications\",\n expand: \"Show the words\",\n collapse: \"Hide the words\",\n },\n fr: {\n docs: \"Docs\",\n terms: \"Conditions d'utilisation\",\n privacy: \"Confidentialité\",\n settings: \"Réglages\",\n billing: \"Facturation\",\n profile: \"Profil\",\n administration: \"Administration\",\n account: \"Compte\",\n language: \"Langue\",\n theme: \"Thème\",\n themeLight: \"Clair\",\n themeDark: \"Sombre\",\n themeSystem: \"Système\",\n signOut: \"Se déconnecter\",\n howItWorks: \"Comment ça marche\",\n pricing: \"Tarifs\",\n download: \"Télécharger\",\n contact: \"Contact\",\n search: \"Rechercher\",\n notifications: \"Notifications\",\n expand: \"Afficher les mots\",\n collapse: \"Masquer les mots\",\n },\n} as const satisfies Record<\"en\" | \"fr\", Record<string, string>>;\n\nexport type NavLocale = keyof typeof navWords;\nexport type NavWords = { [K in keyof (typeof navWords)[\"en\"]]: string };\nexport type NavWordKey = keyof NavWords;\n\n/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */\nexport function navVocabulary(locale: string = \"en\"): NavWords {\n return navWords[locale.toLowerCase().startsWith(\"fr\") ? \"fr\" : \"en\"];\n}\n\n/** One word of the shared vocabulary. */\nexport function navWord(locale: string | undefined, key: NavWordKey): string {\n return navVocabulary(locale)[key];\n}\n\n/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */\nexport const PUBLIC_BAR_MAX = 4;\n\nexport type PublicBarSlot = \"howItWorks\" | \"pricing\" | \"docs\" | \"download\";\nexport interface PublicBarLink {\n id: PublicBarSlot;\n label: string;\n href: string;\n}\n\n/**\n * The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the\n * product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.\n * Pass the address of each slot the product has; the words come from the shared vocabulary.\n */\nexport function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[] {\n const order: PublicBarSlot[] = [\"howItWorks\", \"pricing\", \"docs\", \"download\"];\n return order.flatMap((id) => {\n const href = hrefs[id];\n return href ? [{ id, label: navWord(locale, id), href }] : [];\n });\n}\n"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"path": "marks/AkinazaLogo.tsx",
|
|
307
|
+
"content": "import { AKINAZA as G } from \"./akinaza-geometry\";\nimport { a11y, familyMotion, type MarkProps, neutral, useIds } from \"./shared\";\n\nconst CSS = familyMotion(\"akm\", { ...G.motion, ...G.pulse });\n\n/**\n * The Akinaza mark, \"the cut log\": a log seen end-on in forest green, its year rings in light, cut at 45° by the beaver\n * (the Krizaka chamfer) with the fresh face in copper, and a copper heart that breathes — a shop built ring by ring.\n * One node, a coin, rides the dashed orbit. Below 48 px it crops to the emblem.\n */\nexport function AkinazaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"akm\", [\"glow\"] as const);\n const m = (cls: string) => (animated ? `akm-${cls}` : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={m(\"orbit\")}>\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.node.at[0]} cy={G.node.at[1]} r={G.node.r} fill={G.copper} />\n </g>\n <path d={G.log} fill={G.forest} />\n <path d={G.cut} fill={G.copper} />\n {G.rings.r.map((r) => (\n <circle key={r} cx={G.rings.cx} cy={G.rings.cy} r={r} stroke={G.highlight} strokeOpacity={G.rings.opacity} strokeWidth={G.rings.width} />\n ))}\n <g className={m(\"core\")}>\n <circle cx={G.heart.cx} cy={G.heart.cy} r={G.heart.r} fill={G.copper} />\n <circle cx={G.heart.cx} cy={G.heart.cy} r={G.heart.inner} fill={G.highlight} />\n </g>\n </svg>\n );\n}\n"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"path": "marks/KachizakaLogo.tsx",
|
|
311
|
+
"content": "import { KACHIZAKA as G } from \"./kachizaka-geometry\";\nimport { a11y, familyMotion, type MarkProps, neutral, useIds } from \"./shared\";\n\nconst CSS = familyMotion(\"kcm\", { ...G.motion, ...G.pulse });\n\n/**\n * The Kachizaka mark, \"the podium\": three steps cut at their outer corners, the winner in gold and the others in cobalt\n * (the brand's two colours, kept apart), under a gold diamond — the family's lit node — that breathes: a friendly\n * leaderboard where only points change hands. One node, the ball, rides the dashed orbit. Below 48 px it crops to the\n * emblem.\n *\n * @deprecated Paused product (2026-10-25); removed in the next major.\n */\nexport function KachizakaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"kcm\", [\"glow\"] as const);\n const m = (cls: string) => (animated ? `kcm-${cls}` : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={m(\"orbit\")}>\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.ball.at[0]} cy={G.ball.at[1]} r={G.ball.r} fill={G.gold} />\n </g>\n <path d={G.steps.second} fill={G.cobalt} />\n <path d={G.steps.first} fill={G.gold} />\n <path d={G.steps.third} fill={G.cobalt} />\n <g className={m(\"core\")}>\n <path d={G.node.d} fill={G.gold} stroke={G.gold} strokeWidth={G.node.soften} strokeLinejoin=\"round\" />\n <path d={G.node.light} fill={G.highlight} />\n </g>\n </svg>\n );\n}\n"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"path": "marks/KrizakaLogo.tsx",
|
|
315
|
+
"content": "import { KRIZAKA as G } from \"./krizaka-geometry\";\nimport { a11y, type MarkProps, neutral, useIds } from \"./shared\";\n\nconst CSS = `\n.kzm-spin { transform-origin: 200px 200px; animation: kzm-spin 30s linear infinite; }\n.kzm-pulse { transform-box: fill-box; transform-origin: center; animation: kzm-pulse 3.2s ease-in-out infinite; }\n@keyframes kzm-spin { to { transform: rotate(360deg); } }\n@keyframes kzm-pulse {\n 0%, 100% { filter: drop-shadow(0 0 6px hsla(217, 92%, 53%, .25)); opacity: .9; }\n 50% { filter: drop-shadow(0 0 14px hsla(217, 92%, 53%, .55)); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) { .kzm-spin, .kzm-pulse { animation: none; } }\n`;\n\n/**\n * The Krizaka mark: an ink hexagonal shield, open at one vertex where a blue node breaks out, around a blue core —\n * the parent of the family (Orochia's coiled serpent, Orazaka's shards). The orbit turns, the node and the core\n * breathe. The shield reads the host's text roles, so it is ink in both themes. Below 48 px it crops to the emblem.\n */\nexport function KrizakaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"kzm\", [\"ink\", \"blue\", \"glow\"] as const);\n const m = (cls: string) => (animated ? cls : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <linearGradient id={id.ink} gradientUnits=\"userSpaceOnUse\" x1={G.ink.x1} y1={G.ink.y1} x2={G.ink.x2} y2={G.ink.y2}>\n <stop offset=\"0%\" stopColor={neutral(\"--kz-text-secondary\", 60)} />\n <stop offset=\"100%\" stopColor={neutral(\"--kz-text-primary\", 92)} />\n </linearGradient>\n <linearGradient id={id.blue} gradientUnits=\"userSpaceOnUse\" x1={G.blue.x1} y1={G.blue.y1} x2={G.blue.x2} y2={G.blue.y2}>\n {G.blue.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx=\"200\" cy=\"200\" r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle className={m(\"kzm-spin\")} cx=\"200\" cy=\"200\" r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx=\"200\" cy=\"200\" r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g transform={`translate(${G.offset} ${G.offset})`}>\n <path d={G.shield} stroke={`url(#${id.ink})`} strokeWidth={G.stroke} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <g className={m(\"kzm-pulse\")}>\n <circle cx={G.node.cx} cy={G.node.cy} r={G.node.r} fill={`url(#${id.blue})`} />\n <circle cx={G.node.cx} cy={G.node.cy} r={G.node.inner} fill={G.highlight} />\n </g>\n <g className={m(\"kzm-pulse\")}>\n <circle cx={G.core.cx} cy={G.core.cy} r={G.core.r} fill={`url(#${id.blue})`} />\n <circle cx={G.core.cx} cy={G.core.cy} r={G.core.inner} fill={G.highlight} />\n </g>\n </g>\n </svg>\n );\n}\n"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"path": "marks/OrazakaLogo.tsx",
|
|
319
|
+
"content": "import { ORAZAKA as G } from \"./orazaka-geometry\";\nimport { a11y, type MarkProps, neutral, useIds, withAlpha } from \"./shared\";\n\nconst CSS = `\n.ozm-orbit { transform-origin: 200px 200px; animation: ozm-orbit 35s linear infinite; }\n.ozm-core { transform-box: fill-box; transform-origin: center; animation: ozm-core 3.2s ease-in-out infinite; }\n@keyframes ozm-orbit { to { transform: rotate(360deg); } }\n@keyframes ozm-core {\n 0%, 100% { filter: drop-shadow(0 0 6px ${withAlpha(G.pulse.color, G.pulse.low)}); opacity: .9; }\n 50% { filter: drop-shadow(0 0 14px ${withAlpha(G.pulse.color, G.pulse.high)}); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) { .ozm-orbit, .ozm-core { animation: none; } }\n`;\n\n/**\n * The Orazaka mark: three solid hexagonal shards in the Orazaka orange (the brand's mark\n * gradient of @krizaka/tokens, deep orange → orange, hue 26 — the same in dark and light) orbiting slowly around a core that breathes —\n * the family's grammar (dashed orbit, ring, bold emblem, bright core). Below 48 px it crops to the emblem.\n */\nexport function OrazakaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"ozm\", [\"gradient\", \"glow\"] as const);\n const fill = `url(#${id.gradient})`;\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <linearGradient id={id.gradient} gradientUnits=\"userSpaceOnUse\" x1={G.gradient.x1} y1={G.gradient.y1} x2={G.gradient.x2} y2={G.gradient.y2}>\n {G.gradient.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={animated ? \"ozm-orbit\" : undefined}>\n {G.shards.map((d) => (\n <path key={d} d={d} fill={fill} stroke={fill} strokeWidth={G.shardStroke} strokeLinejoin=\"round\" />\n ))}\n </g>\n <g className={animated ? \"ozm-core\" : undefined}>\n <circle cx={G.center} cy={G.center} r={G.core.r} fill={fill} />\n <circle cx={G.center} cy={G.center} r={G.core.inner} fill={G.highlight} />\n </g>\n </svg>\n );\n}\n"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"path": "marks/OrochiaLogo.tsx",
|
|
323
|
+
"content": "import { OROCHIA as G } from \"./orochia-geometry\";\nimport { a11y, type MarkProps, neutral, useIds } from \"./shared\";\n\nconst CSS = `\n.orom-spin { transform-origin: 180px 180px; animation: orom-spin 30s linear infinite; }\n.orom-slither { animation: orom-slither 2.4s linear infinite; }\n.orom-pulse { transform-box: view-box; animation: orom-pulse 3.2s ease-in-out infinite; }\n@keyframes orom-spin { to { transform: rotate(360deg); } }\n@keyframes orom-slither { to { stroke-dashoffset: -64; } }\n@keyframes orom-pulse {\n 0%, 100% { filter: drop-shadow(0 0 6px hsla(292, 84%, 61%, .25)); opacity: .9; }\n 50% { filter: drop-shadow(0 0 14px hsla(292, 84%, 61%, .55)); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) { .orom-spin, .orom-slither, .orom-pulse { animation: none; } }\n`;\n\n/**\n * The Orochia mark: the serpent (Orochi) coiled into an \"O\" around the flame it guards. The orbit turns, scales slide\n * along the body, the eye and the flame breathe. Below 48 px it crops to the serpent: the orbits would be hairlines.\n *\n * @deprecated Paused product (2026-10-25); removed in the next major.\n */\nexport function OrochiaLogo({ size = 36, animated = true, title, className }: MarkProps) {\n const id = useIds(\"orom\", [\"body\", \"flame\", \"glow\"] as const);\n const m = (cls: string) => (animated ? cls : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <linearGradient id={id.body} gradientUnits=\"userSpaceOnUse\" x1={G.body.x1} y1={G.body.y1} x2={G.body.x2} y2={G.body.y2}>\n {G.body.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <linearGradient id={id.flame} x1=\"50%\" y1=\"100%\" x2=\"50%\" y2=\"0%\">\n {G.flameGradient.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n <g transform={`translate(${G.offset} ${G.offset})`}>\n <circle cx=\"180\" cy=\"180\" r=\"170\" fill={`url(#${id.glow})`} />\n <circle className={m(\"orom-spin\")} cx=\"180\" cy=\"180\" r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx=\"180\" cy=\"180\" r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <path d={G.arc} stroke={`url(#${id.body})`} strokeWidth=\"22\" strokeLinecap=\"round\" />\n <path className={m(\"orom-slither\")} d={G.arc} stroke={G.scales.color} strokeOpacity={G.scales.opacity} strokeWidth={G.scales.width} strokeLinecap=\"round\" strokeDasharray={G.scales.dash} />\n <path d={G.neck} stroke={`url(#${id.body})`} strokeWidth=\"14\" strokeLinecap=\"round\" />\n <path d={G.tail} stroke={`url(#${id.body})`} strokeWidth=\"6\" strokeLinecap=\"round\" />\n <ellipse cx={G.head.cx} cy={G.head.cy} rx={G.head.rx} ry={G.head.ry} transform={`rotate(${G.head.rotate} ${G.head.cx} ${G.head.cy})`} fill={`url(#${id.body})`} />\n <path d={G.tongue.d} stroke={G.tongue.color} strokeWidth=\"3\" strokeLinecap=\"round\" />\n <circle className={m(\"orom-pulse\")} cx={G.eye.cx} cy={G.eye.cy} r={G.eye.r} fill={G.eye.color} />\n <path className={m(\"orom-pulse\")} transform={`translate(${G.flame.translate[0]} ${G.flame.translate[1]}) scale(${G.flame.scale})`} d={G.flame.d} fill={`url(#${id.flame})`} />\n </g>\n </svg>\n );\n}\n"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"path": "marks/ProductLogo.tsx",
|
|
327
|
+
"content": "import { AkinazaLogo } from \"./AkinazaLogo\";\nimport { KachizakaLogo } from \"./KachizakaLogo\";\nimport { KrizakaLogo } from \"./KrizakaLogo\";\nimport { OrazakaLogo } from \"./OrazakaLogo\";\nimport { OrochiaLogo } from \"./OrochiaLogo\";\nimport type { MarkProps } from \"./shared\";\nimport { YasakiaLogo } from \"./YasakiaLogo\";\nimport { YomizakaLogo } from \"./YomizakaLogo\";\nimport { YororisLogo } from \"./YororisLogo\";\n\n/**\n * A Krizaka brand. `orochia`, `yasakia`, `yororis` and `kachizaka` are paused products, kept so nothing published\n * breaks — see `PausedBrandId`.\n */\nexport type BrandId = \"krizaka\" | \"orazaka\" | \"orochia\" | \"yasakia\" | \"yororis\" | \"yomizaka\" | \"kachizaka\" | \"akinaza\";\n\n/** @deprecated Paused product (2026-10-25); removed in the next major. The brands of the paused products. */\nexport type PausedBrandId = \"orochia\" | \"yasakia\" | \"yororis\" | \"kachizaka\";\n\n/** The mark of a Krizaka brand by id — for navigation, cards and lists driven by data. */\nexport function ProductLogo({ id, ...props }: MarkProps & { /** The brand: `krizaka`, `orazaka`, `yomizaka` or `akinaza` (`orochia`, `yasakia`, `yororis`, `kachizaka`: deprecated, paused products; `yazakia`: the old name of `yasakia`). */ id: BrandId | \"yazakia\" }) {\n if (id === \"krizaka\") return <KrizakaLogo {...props} />;\n if (id === \"orazaka\") return <OrazakaLogo {...props} />;\n if (id === \"yasakia\" || id === \"yazakia\") return <YasakiaLogo {...props} />;\n if (id === \"yororis\") return <YororisLogo {...props} />;\n if (id === \"yomizaka\") return <YomizakaLogo {...props} />;\n if (id === \"kachizaka\") return <KachizakaLogo {...props} />;\n if (id === \"akinaza\") return <AkinazaLogo {...props} />;\n return <OrochiaLogo {...props} />;\n}\n"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"path": "marks/YasakiaLogo.tsx",
|
|
331
|
+
"content": "import { a11y, familyMotion, type MarkProps, neutral, useIds } from \"./shared\";\nimport { YASAKIA as G } from \"./yasakia-geometry\";\n\nconst CSS = familyMotion(\"yzm\", { ...G.motion, ...G.pulse });\n\n/**\n * The Yasakia mark, \"one conversation\": one speech bubble with a tail on each side (turned 180°, never mirrored, so it\n * can never read as a face) in the Yasakia gradient (emerald → turquoise, the same in dark and light), and the spark\n * inside it — the family's lit node — that breathes: talk first, both ways. One node rides the dashed orbit. Below 48 px\n * it crops to the emblem.\n *\n * @deprecated Paused product (2026-10-25); removed in the next major.\n */\nexport function YasakiaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"yzm\", [\"gradient\", \"glow\"] as const);\n const fill = `url(#${id.gradient})`;\n const m = (cls: string) => (animated ? `yzm-${cls}` : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <linearGradient id={id.gradient} gradientUnits=\"userSpaceOnUse\" x1={G.gradient.x1} y1={G.gradient.y1} x2={G.gradient.x2} y2={G.gradient.y2}>\n {G.gradient.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={m(\"orbit\")}>\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.node.at[0]} cy={G.node.at[1]} r={G.node.r} fill={fill} />\n </g>\n <circle cx={G.bubble.cx} cy={G.bubble.cy} r={G.bubble.r} fill={fill} />\n <path d={G.tails.join(\" \")} fill={fill} />\n <g className={m(\"core\")}>\n <path d={G.spark.d} fill={G.highlight} stroke={G.highlight} strokeWidth={G.spark.soften} strokeLinejoin=\"round\" />\n </g>\n </svg>\n );\n}\n\n/** @deprecated Yazakia was renamed Yasakia (2026-10): use `YasakiaLogo`. Kept for one minor version. */\nexport const YazakiaLogo = YasakiaLogo;\n"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"path": "marks/YomizakaLogo.tsx",
|
|
335
|
+
"content": "import { a11y, familyMotion, type MarkProps, neutral, useIds } from \"./shared\";\nimport { YOMIZAKA as G } from \"./yomizaka-geometry\";\n\nconst CSS = familyMotion(\"ymm\", { ...G.motion, ...G.pulse });\n\n/**\n * The Yomizaka mark, \"the watch\": the owl — two lenses at the family stroke under one calm brow, its pupils glancing\n * down the line it reads — in the Yomizaka gradient (ink → indigo, the same in dark and light). The pupils are the lit\n * cores and breathe; one node, a page, rides the dashed orbit. Below 48 px it crops to the emblem.\n */\nexport function YomizakaLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"ymm\", [\"gradient\", \"glow\"] as const);\n const fill = `url(#${id.gradient})`;\n const m = (cls: string) => (animated ? `ymm-${cls}` : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <linearGradient id={id.gradient} gradientUnits=\"userSpaceOnUse\" x1={G.gradient.x1} y1={G.gradient.y1} x2={G.gradient.x2} y2={G.gradient.y2}>\n {G.gradient.stops.map(([offset, color]) => (\n <stop key={offset} offset={offset} stopColor={color} />\n ))}\n </linearGradient>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={m(\"orbit\")}>\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.node.at[0]} cy={G.node.at[1]} r={G.node.r} fill={fill} />\n </g>\n <path d={G.brow} stroke={fill} strokeWidth={G.stroke} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n {G.lenses.map((l) => (\n <circle key={l.cx} cx={l.cx} cy={l.cy} r={l.r} stroke={fill} strokeWidth={G.stroke} />\n ))}\n <g className={m(\"core\")}>\n {G.pupils.map((p) => (\n <g key={p.cx}>\n <circle cx={p.cx} cy={p.cy} r={p.r} fill={fill} />\n <circle cx={p.cx} cy={p.cy} r={p.inner} fill={G.highlight} />\n </g>\n ))}\n </g>\n </svg>\n );\n}\n"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"path": "marks/YororisLogo.tsx",
|
|
339
|
+
"content": "import { a11y, familyMotion, type MarkProps, neutral, useIds } from \"./shared\";\nimport { YORORIS as G } from \"./yororis-geometry\";\n\nconst CSS = familyMotion(\"yrm\", { ...G.motion, ...G.pulse });\n\n/**\n * The Yororis mark, \"held\": two open hands, two sage arcs of one circle, cup a warm sand core without closing on it —\n * held, given room, free to go. The core breathes, the slowest breath of the family; one node, the moment, rides the\n * dashed orbit. Below 48 px it crops to the emblem.\n *\n * @deprecated Paused product (2026-10-25); removed in the next major.\n */\nexport function YororisLogo({ size = 32, animated = true, title, className }: MarkProps) {\n const id = useIds(\"yrm\", [\"glow\"] as const);\n const m = (cls: string) => (animated ? `yrm-${cls}` : undefined);\n return (\n <svg width={size} height={size} viewBox={size < 48 ? G.croppedViewBox : G.viewBox} fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} {...a11y(title)}>\n <style>{CSS}</style>\n <defs>\n <radialGradient id={id.glow} cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stopColor={G.glow.color} stopOpacity={G.glow.opacity} />\n <stop offset=\"100%\" stopColor={G.glow.color} stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {size >= 48 ? <circle cx={G.center} cy={G.center} r=\"190\" fill={`url(#${id.glow})`} /> : null /* cropped: the halo would show its square */}\n <circle cx={G.center} cy={G.center} r={G.ring.r} stroke={neutral(\"--kz-border-default\", 30)} strokeWidth={G.ring.width} opacity=\".35\" />\n <g className={m(\"orbit\")}>\n <circle cx={G.center} cy={G.center} r={G.orbit.r} stroke={neutral(\"--kz-border-strong\", 40)} strokeWidth={G.orbit.width} strokeDasharray={G.orbit.dash} opacity=\".6\" />\n <circle cx={G.node.at[0]} cy={G.node.at[1]} r={G.node.r} fill={G.sage} />\n </g>\n <path d={G.hands} stroke={G.sage} strokeWidth={G.stroke} strokeLinecap=\"round\" />\n <g className={m(\"core\")}>\n <circle cx={G.core.cx} cy={G.core.cy} r={G.core.r} fill={G.sand} />\n <circle cx={G.core.cx} cy={G.core.cy} r={G.core.inner} fill={G.highlight} />\n </g>\n </svg>\n );\n}\n"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"path": "marks/akinaza-geometry.ts",
|
|
343
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Akinaza mark's geometry — drawn by the web mark (AkinazaLogo) and the native one (AkinazaMark). The family's\n * grammar (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold solid emblem, a lit core;\n * below 48 px the view box crops to the emblem.\n *\n * The emblem is **the cut log** (2026-10-17): a log seen end-on, its year rings in light, cut at 45° by the beaver —\n * the cut is the Krizaka chamfer, its fresh face in copper — and a copper heart that breathes: a shop built ring by\n * ring, year after year. Forest and copper stay **apart** (blended they turn brown): they are the two stops of the\n * brand's mark gradient (`marks.akinaza` of @krizaka/tokens), each ≥ 3:1 on the page surfaces of both themes.\n *\n * Literal geometry (no clip, so web and native draw the same thing): the log is a circle r 96 centred (194, 206) — set\n * off the centre so the cut log sits optically centred — minus the segment beyond the 45° chord at 70 from its centre;\n * the copper face is the band between that chord and a parallel one at 58, bounded by the circle.\n */\nconst forest = marks.akinaza[0]![1];\n/** The copper end: the cut, the heart, the halo and its breath. */\nconst copper = marks.akinaza[marks.akinaza.length - 1]![1];\n\nexport const AKINAZA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"80 80 240 240\",\n center: 200,\n forest,\n copper,\n log: \"M197 110 L290 203 A96 96 0 1 1 197 110 Z\",\n /** The fresh face of the cut: a copper band along the chord. */\n cut: \"M197 110 L290 203 A96 96 0 0 1 289.1 219.1 L180.9 110.9 A96 96 0 0 1 197 110 Z\",\n /** The year rings, in light, inside the band. */\n rings: { cx: 194, cy: 206, r: [52, 28], width: 7, opacity: 0.42 },\n heart: { cx: 194, cy: 206, r: 16, inner: 5.4 },\n highlight: \"#fff7ed\",\n gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.akinaza },\n /** A coin: one node on the orbit, that turns with it. */\n node: { r: 9, at: [200, 40] as const },\n glow: { color: copper, opacity: 0.16 },\n pulse: { color: copper, low: 0.3, high: 0.65 },\n motion: { spin: 32, breath: 3.8 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"path": "marks/kachizaka-geometry.ts",
|
|
347
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Kachizaka mark's geometry — drawn by the web mark (KachizakaLogo) and the native one (KachizakaMark). The family's\n * grammar (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold solid emblem, a lit core;\n * below 48 px the view box crops to the emblem.\n *\n * The emblem is **the podium** (2026-10-17): three steps, their outer corners wearing the Krizaka cut, the winner in\n * gold and the others in cobalt, under the family's lit node (a diamond) that breathes — a friendly leaderboard where\n * only points change hands. The two colours of the brand stay **apart** (cobalt plays, gold wins): blended, cobalt →\n * gold turns grey. They are the two stops of the brand's mark gradient (`marks.kachizaka` of @krizaka/tokens), each\n * ≥ 3:1 on the page surfaces of both themes.\n */\nconst cobalt = marks.kachizaka[0]![1];\n/** The gold end: the winner, the node, the halo and its breath. */\nconst gold = marks.kachizaka[marks.kachizaka.length - 1]![1];\n\nexport const KACHIZAKA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"80 80 240 240\",\n center: 200,\n cobalt,\n gold,\n /** The steps: second (left, cut top-left), first (centre, both top corners cut, in gold), third (right, cut top-right). */\n steps: {\n second: \"M102 240 L122 220 H162 V296 H102 Z\",\n first: \"M170 192 L188 174 H212 L230 192 V296 H170 Z\",\n third: \"M238 248 H278 L298 268 V296 H238 Z\",\n },\n /** The lit node over the winner: a gold diamond (half-diagonal 22, softened by a 6-unit round stroke), its light inside. */\n node: { d: \"M200 102 L222 124 L200 146 L178 124 Z\", light: \"M200 116.1 L207.9 124 L200 131.9 L192.1 124 Z\", soften: 6 },\n highlight: \"#fffbea\",\n gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.kachizaka },\n /** The ball: one node on the orbit, that turns with it. */\n ball: { r: 9, at: [200, 40] as const },\n glow: { color: gold, opacity: 0.18 },\n pulse: { color: gold, low: 0.35, high: 0.75 },\n motion: { spin: 28, breath: 3.2 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"path": "marks/krizaka-geometry.ts",
|
|
351
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Krizaka mark's geometry — the one description drawn by the web mark (KrizakaLogo) and the native one\n * (KrizakaMark). Built on the Orochia mark's grammar (docs: packages/tokens/BRAND.md, \"Marks\"): a 360×360 artwork at\n * (20, 20) in a 400×400 view box, one bold stroke (22) drawn as an open figure, an end that breaks out as a node, a\n * core, a dashed orbit and a ring; below 48 px the view box crops to the emblem.\n *\n * Krizaka is the parent: the hexagonal shield is **ink** (the host's text roles), the node and the core carry the\n * Krizaka blue (`marks.krizaka` of @krizaka/tokens: the brand's accent hsl(208 46% 45%) → its text tint hsl(206 58% 72%)).\n */\nexport const KRIZAKA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"86 82 228 228\",\n offset: 20,\n /** The shield: a pointy-top hexagon (r 92 around 180,180), open at its upper-right edge. */\n shield: \"M259.7,134 L259.7,226 L180,272 L100.3,226 L100.3,134 L180,88 L212,106.5\",\n stroke: 22,\n ink: { x1: 70, y1: 290, x2: 290, y2: 70 },\n blue: { x1: 180, y1: 180, x2: 300, y2: 60, stops: marks.krizaka },\n /** The vertex where the shield opens: a node (the serpent's head in Orochia's grammar). */\n node: { cx: 259.7, cy: 134, r: 19, inner: 6 },\n core: { cx: 180, cy: 180, r: 24, inner: 8 },\n highlight: \"#ddeaf4\",\n glow: { color: marks.krizaka[0]![1], opacity: 0.16 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"path": "marks/orazaka-geometry.ts",
|
|
355
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Orazaka mark's geometry — drawn by the web mark (OrazakaLogo) and the native one (OrazakaMark). The same\n * grammar as Orochia and Krizaka (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold\n * emblem in the brand gradient, a bright core; below 48 px the view box crops to the emblem.\n *\n * The emblem keeps the original idea — three hexagonal shards orbiting a core — drawn as solid shards (the weight of\n * Orochia's body) in the Orazaka orange: the brand's mark gradient (`marks.orazaka` of @krizaka/tokens, the same source\n * as the accent), deep orange → orange on the accent's hue 26 — never the amber of --kz-warning (hue 38). Every stop\n * reads ≥ 3:1 on the page surfaces of both themes (tested in @krizaka/tokens), so one mark serves dark and light.\n */\n/** The bright end of the gradient: the halo and the core's glow. */\nconst orange = marks.orazaka[marks.orazaka.length - 1]![1];\n\nexport const ORAZAKA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"76 76 248 248\",\n center: 200,\n /**\n * The three shards — a hexagon's cap (from the original 132-unit drawing), scaled ×1.9 around the centre and turned\n * 0°, 120°, 240° — in view-box coordinates, so that one gradient runs across all three.\n */\n shards: [\n \"M154.4,121.2 L200,94.7 L245.6,121.2 L245.6,154.4 L226.6,165.4 L226.6,132.2 L200,116.8 L173.4,132.2 L173.4,165.4 L154.4,154.4 Z\",\n \"M291.1,199.9 L291.2,252.6 L245.5,278.9 L216.7,262.3 L216.6,240.3 L245.4,257 L272.1,241.6 L272,210.9 L243.2,194.3 L262.3,183.3 Z\",\n \"M154.5,278.9 L108.8,252.6 L108.9,199.9 L137.7,183.3 L156.8,194.3 L128,210.9 L127.9,241.6 L154.6,257 L183.4,240.3 L183.3,262.3 Z\",\n ],\n shardStroke: 5.7,\n gradient: { x1: 90, y1: 310, x2: 310, y2: 90, stops: marks.orazaka },\n core: { r: 21, inner: 7.6 },\n highlight: \"#fff7ed\",\n glow: { color: orange, opacity: 0.16 },\n /** The core's breathing shadow (web), in the mark's orange. */\n pulse: { color: orange, low: 0.3, high: 0.6 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"path": "marks/orochia-geometry.ts",
|
|
359
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Orochia mark's geometry — the one description of the serpent and its flame, drawn by the web mark (SVG in the\n * DOM, OrochiaLogo) and the native one (react-native-svg, @krizaka/ui/native). Coordinates are in the 360×360 artwork,\n * placed at (20, 20) in a 400×400 view box; below 48 px the view box crops to the serpent. The body's gradient is the\n * brand's mark gradient (`marks.orochia` of @krizaka/tokens).\n */\nexport const OROCHIA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"86 82 228 228\",\n offset: 20,\n body: { x1: 70, y1: 290, x2: 290, y2: 70, stops: marks.orochia },\n flameGradient: { stops: [[\"0%\", \"#a855f7\"], [\"100%\", \"#f9a8d4\"]] },\n glow: { color: \"#d946ef\", opacity: 0.18 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n arc: \"M259.8,142.8 A88,88 0 1 1 142.8,100.2\",\n neck: \"M142.8,100.2 A88,88 0 0 1 187.7,92.3\",\n tail: \"M187.7,92.3 A88,88 0 0 1 221.3,102.3\",\n scales: { color: \"#fdf4ff\", opacity: 0.45, width: 3, dash: \"2 14\" },\n head: { cx: 253.9, cy: 130.1, rx: 13, ry: 20, rotate: -25 },\n tongue: { d: \"M245.4,112.0 L242.0,104.8 L235.0,101.5 M242.0,104.8 L244.0,97.3\", color: \"#f472b6\" },\n eye: { cx: 256.3, cy: 123.5, r: 4.5, color: \"#fdf4ff\" },\n flame: {\n translate: [127, 120] as const,\n scale: 4.4,\n d: \"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z\",\n },\n} as const;\n"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"path": "marks/shared.ts",
|
|
363
|
+
"content": "import { useId } from \"react\";\n\nexport interface MarkProps {\n /** Width and height in pixels. */\n size?: number;\n /** Orbit, pulse and shimmer. Off with `false`; always off under prefers-reduced-motion. */\n animated?: boolean;\n /** An accessible name (the mark becomes an image); without it the mark is decorative. */\n title?: string;\n className?: string;\n}\n\n/** A neutral stroke: the host's `--kz-*` token when it has one, else the text colour at a low opacity. */\nexport const neutral = (token: string, percent: number) => `var(${token}, color-mix(in srgb, currentColor ${percent}%, transparent))`;\n\n/** Ids unique per instance, so several marks on a page never share a gradient. */\nexport function useIds<K extends string>(prefix: string, keys: readonly K[]): Record<K, string> {\n const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n return Object.fromEntries(keys.map((k) => [k, `${prefix}-${k}-${uid}`])) as Record<K, string>;\n}\n\nexport const a11y = (title?: string) => (title ? { role: \"img\" as const, \"aria-label\": title } : { \"aria-hidden\": true as const });\n\n/** `#rrggbb` + an opacity → `#rrggbbaa` (a brand colour in a CSS shadow). */\nexport const withAlpha = (hex: string, opacity: number) => `${hex}${Math.round(opacity * 255).toString(16).padStart(2, \"0\")}`;\n\n/**\n * The family's motion (web), for a mark whose classes start with `prefix`: `<prefix>-orbit` turns the dashed orbit and\n * its node, `<prefix>-core` makes the lit core breathe (a shadow in the brand colour). Still under prefers-reduced-motion.\n */\nexport const familyMotion = (prefix: string, { spin, breath, color, low, high }: { spin: number; breath: number; color: string; low: number; high: number }) => `\n.${prefix}-orbit { transform-origin: 200px 200px; animation: ${prefix}-orbit ${spin}s linear infinite; }\n.${prefix}-core { transform-box: fill-box; transform-origin: center; animation: ${prefix}-core ${breath}s ease-in-out infinite; }\n@keyframes ${prefix}-orbit { to { transform: rotate(360deg); } }\n@keyframes ${prefix}-core {\n 0%, 100% { filter: drop-shadow(0 0 6px ${withAlpha(color, low)}); opacity: .92; }\n 50% { filter: drop-shadow(0 0 16px ${withAlpha(color, high)}); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) { .${prefix}-orbit, .${prefix}-core { animation: none; } }\n`;\n"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"path": "marks/yasakia-geometry.ts",
|
|
367
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Yasakia mark's geometry — drawn by the web mark (YasakiaLogo) and the native one (YasakiaMark). The family's\n * grammar (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold solid emblem in the\n * brand gradient, a lit core; below 48 px the view box crops to the emblem.\n *\n * The emblem is **one conversation** (2026-10-17): one speech bubble with a tail on each side — the conversation\n * belongs to both people, talk first — and the spark inside it, the family's lit node, breathes. The tails turn about\n * the centre (180°): the mark is symmetric by rotation, never by mirror, so it can never read as a face. The gradient\n * is the brand's mark gradient (`marks.yasakia` of @krizaka/tokens): emerald → turquoise, ≥ 3:1 on both themes.\n */\n/** The turquoise end of the gradient: the halo and the spark's breath. */\nconst turquoise = marks.yasakia[marks.yasakia.length - 1]![1];\n\nexport const YASAKIA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"80 80 240 240\",\n center: 200,\n bubble: { cx: 200, cy: 200, r: 86 },\n /** The two tails, out of the bubble at 115°–160° and, turned 180° about the centre, at 295°–340°. */\n tails: [\n \"M163.7 277.9 Q138 294 106 304 Q124 270 119.2 229.4 Z\",\n \"M236.3 122.1 Q262 106 294 96 Q276 130 280.8 170.6 Z\",\n ],\n /** The spark: a diamond of light (half-diagonal 24, softened by a 6-unit round stroke). */\n spark: { d: \"M200 176 L224 200 L200 224 L176 200 Z\", soften: 6 },\n highlight: \"#f0fdfa\",\n gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.yasakia },\n /** The two people: one node on the orbit, that turns with it. */\n node: { r: 9, at: [200, 40] as const },\n glow: { color: turquoise, opacity: 0.16 },\n pulse: { color: turquoise, low: 0.3, high: 0.6 },\n motion: { spin: 30, breath: 3.2 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"path": "marks/yomizaka-geometry.ts",
|
|
371
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Yomizaka mark's geometry — drawn by the web mark (YomizakaLogo) and the native one (YomizakaMark). The family's\n * grammar (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold emblem at the family\n * stroke (22) in the brand gradient, a lit core; below 48 px the view box crops to the emblem.\n *\n * The emblem is **the watch** (2026-10-17): the owl — the bird that reads documents and knows faces — drawn as two\n * lenses under one calm brow, its pupils glancing down the line it reads. The brow is a soft double curve (never a\n * sharp V: the owl is attentive, not stern). The pupils are the lit cores: they breathe. The gradient is the brand's\n * mark gradient (`marks.yomizaka` of @krizaka/tokens): ink → indigo, ≥ 3:1 on the page surfaces of both themes.\n */\n/** The indigo end of the gradient: the halo and the pupils' breath. */\nconst indigo = marks.yomizaka[marks.yomizaka.length - 1]![1];\n\nexport const YOMIZAKA = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"80 80 240 240\",\n center: 200,\n stroke: 22,\n /** The brow: two soft arcs that meet over the beak — calm, never a sharp V. */\n brow: \"M106 153 C130 125 176 129 200 159 C224 129 270 125 294 153\",\n /** The two lenses (rings at the family stroke). */\n lenses: [\n { cx: 146, cy: 223, r: 40 },\n { cx: 254, cy: 223, r: 40 },\n ],\n /** The pupils, glancing down-right (reading): the lit cores. */\n pupils: [\n { cx: 154, cy: 229, r: 15, inner: 5.1 },\n { cx: 262, cy: 229, r: 15, inner: 5.1 },\n ],\n highlight: \"#f4f5ff\",\n gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.yomizaka },\n /** One node, a page, rides the orbit. */\n node: { r: 9, at: [200, 40] as const },\n glow: { color: indigo, opacity: 0.18 },\n pulse: { color: indigo, low: 0.3, high: 0.6 },\n motion: { spin: 32, breath: 3.6 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"path": "marks/yororis-geometry.ts",
|
|
375
|
+
"content": "import { marks } from \"@krizaka/tokens/native\";\n\n/**\n * The Yororis mark's geometry — drawn by the web mark (YororisLogo) and the native one (YororisMark). The family's\n * grammar (packages/tokens/BRAND.md, \"Marks\"): 400×400 view box, dashed orbit and ring, a bold emblem at the family\n * stroke (22), a lit core; below 48 px the view box crops to the emblem.\n *\n * The emblem is **held** (2026-10-17): two open hands, drawn as two arcs of one circle, cup a warm core without\n * closing on it — held, given room, free to go. The arcs are sage, the core sand: the two stops of the brand's mark\n * gradient (`marks.yororis` of @krizaka/tokens), each ≥ 3:1 on the page surfaces of both themes. The slowest breath of\n * the family (4.2 s).\n */\nconst sand = marks.yororis[0]![1];\n/** The sage end: the hands, the halo. */\nconst sage = marks.yororis[marks.yororis.length - 1]![1];\n\nexport const YORORIS = {\n viewBox: \"0 0 400 400\",\n croppedViewBox: \"80 80 240 240\",\n center: 200,\n stroke: 22,\n sand,\n sage,\n /** The two hands: arcs of a circle r 92 centred (200, 162), from 196° to 104° and from 76° to −16°; open at the bottom and the top. */\n hands: \"M111.6 136.6 A92 92 0 0 0 177.7 251.3 M222.3 251.3 A92 92 0 0 0 288.4 136.6\",\n /** The warm core, held inside the hands. */\n core: { cx: 200, cy: 176, r: 30, inner: 10.2 },\n highlight: \"#fbf6ea\",\n gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.yororis },\n /** The moment: one node on the orbit — it comes round, then it goes. */\n node: { r: 9, at: [200, 40] as const },\n glow: { color: sage, opacity: 0.18 },\n pulse: { color: sand, low: 0.3, high: 0.6 },\n motion: { spin: 36, breath: 4.2 },\n orbit: { r: 160, dash: \"8 8\", width: 1.5 },\n ring: { r: 134, width: 1 },\n} as const;\n"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"path": "meta.ts",
|
|
379
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"meta-row\"\n | \"waveform\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"dependencies": [
|
|
383
|
+
"@krizaka/tokens@^3.65.0"
|
|
384
|
+
],
|
|
385
|
+
"registryDependencies": [
|
|
386
|
+
"account-menu",
|
|
387
|
+
"app-header",
|
|
388
|
+
"badge",
|
|
389
|
+
"rail-nav",
|
|
390
|
+
"theme"
|
|
391
|
+
],
|
|
392
|
+
"demo": {
|
|
393
|
+
"path": "examples/app-frame/app.tsx",
|
|
394
|
+
"content": "\"use client\";\n\nimport { ProductLogo } from \"@krizaka/ui\";\nimport { AppFrame, type FrameSection } from \"@krizaka/ui/app-frame\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { Stat } from \"@krizaka/ui/stat\";\nimport type { Mode } from \"@krizaka/ui/theme\";\nimport { useState } from \"react\";\n\nconst icon = (d: string) => (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\nconst SECTIONS: FrameSection[] = [\n { id: \"home\", label: \"Home\", href: \"#home\", icon: icon(\"M4 11 12 4l8 7v9H4z\") },\n { id: \"files\", label: \"Applicant files\", href: \"#files\", icon: icon(\"M4 5h16v14H4zM8 9h8M8 13h5\"), badge: 3, badgeLabel: \"3 to decide\" },\n { id: \"documents\", label: \"Documents\", href: \"#documents\", icon: icon(\"M7 3h8l4 4v14H7zM15 3v4h4\") },\n { id: \"checks\", label: \"Checks\", href: \"#checks\", icon: icon(\"M5 12l4 4 10-10\") },\n];\n\n// TEMPLATE — The signed-in frame of a product (Yomizaka): the rail (a tab bar on a phone), the top bar with its search, the\n// one primary action and the account menu. Settings is under the avatar, so it is not a section. The product writes only its sections; the menu, its order and the preferences are the frame's.\nexport default function AppFrameApp() {\n const [language, setLanguage] = useState(\"en\");\n // Inside a ThemeProvider the frame reads the theme itself; here it is passed.\n const [mode, setMode] = useState<Mode>(\"system\");\n return (\n <AppFrame\n name=\"Yomizaka\"\n accent=\"yomizaka\"\n mark={<ProductLogo id=\"yomizaka\" size={26} animated={false} />}\n headerMark={<ProductLogo id=\"yomizaka\" size={22} animated={false} />}\n homeHref=\"#home\"\n sections={SECTIONS}\n currentId=\"home\"\n search={{ label: \"Search files and checks\", onOpen: () => {} }}\n primary={<Button size=\"sm\" shape=\"cut\">Check a document</Button>}\n account={{\n name: \"Eric Tremblay\",\n email: \"eric@example.com\",\n avatar: { defaultAvatar: { brand: \"yomizaka\", seed: \"eric\" } },\n links: { settings: { href: \"#settings\" }, profile: { href: \"#profile\" }, billing: { href: \"#billing\", label: \"Credits and usage\" } },\n onSignOut: () => {},\n }}\n language={{ value: language, onChange: setLanguage, options: [{ value: \"en\", label: \"English\" }, { value: \"fr\", label: \"Français\" }] }}\n theme={{ value: mode, onChange: setMode }}\n >\n <main id=\"content\" tabIndex={-1} className=\"grid gap-4 p-4 sm:grid-cols-3 md:p-6\">\n <Stat label=\"Files to decide\" value=\"3\" />\n <Stat label=\"Checks this month\" value=\"42\" />\n <Stat label=\"Credits left\" value=\"58\" />\n </main>\n </AppFrame>\n );\n}\n"
|
|
395
|
+
},
|
|
396
|
+
"props": [
|
|
397
|
+
{
|
|
398
|
+
"component": "AppFrame",
|
|
399
|
+
"description": "The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out.",
|
|
400
|
+
"props": [
|
|
401
|
+
{
|
|
402
|
+
"name": "account",
|
|
403
|
+
"type": "AppFrameAccount",
|
|
404
|
+
"default": null,
|
|
405
|
+
"description": "Who is signed in, the places under their avatar and Sign out.",
|
|
406
|
+
"required": true
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "children",
|
|
410
|
+
"type": "ReactNode",
|
|
411
|
+
"default": null,
|
|
412
|
+
"description": "The page, inside `RailNav.Body` under the top bar.",
|
|
413
|
+
"required": true
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "homeHref",
|
|
417
|
+
"type": "string",
|
|
418
|
+
"default": null,
|
|
419
|
+
"description": "Where the mark and the name lead (`/app`).",
|
|
420
|
+
"required": true
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "mark",
|
|
424
|
+
"type": "ReactNode",
|
|
425
|
+
"default": null,
|
|
426
|
+
"description": "The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone.",
|
|
427
|
+
"required": true
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "name",
|
|
431
|
+
"type": "string",
|
|
432
|
+
"default": null,
|
|
433
|
+
"description": "The product's name, as text in the top bar.",
|
|
434
|
+
"required": true
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"name": "sections",
|
|
438
|
+
"type": "readonly FrameSection[]",
|
|
439
|
+
"default": null,
|
|
440
|
+
"description": "The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person.",
|
|
441
|
+
"required": true
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"name": "accent",
|
|
445
|
+
"type": "BrandId",
|
|
446
|
+
"default": null,
|
|
447
|
+
"description": "The product's brand: scopes its colours over the rail.",
|
|
448
|
+
"required": false
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"name": "chips",
|
|
452
|
+
"type": "ReactNode",
|
|
453
|
+
"default": null,
|
|
454
|
+
"description": "Chips beside the name (`Dev`, `Local · Sovereign`).",
|
|
455
|
+
"required": false
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "currentId",
|
|
459
|
+
"type": "string",
|
|
460
|
+
"default": null,
|
|
461
|
+
"description": "The id of the section the person is in.",
|
|
462
|
+
"required": false
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "headerMark",
|
|
466
|
+
"type": "ReactNode",
|
|
467
|
+
"default": null,
|
|
468
|
+
"description": "The mark in the top bar below `md` (smaller). Defaults to `mark`.",
|
|
469
|
+
"required": false
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "label",
|
|
473
|
+
"type": "string",
|
|
474
|
+
"default": null,
|
|
475
|
+
"description": "The rail's accessible name. Defaults to the product's name.",
|
|
476
|
+
"required": false
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "language",
|
|
480
|
+
"type": "AppFrameLanguage",
|
|
481
|
+
"default": null,
|
|
482
|
+
"description": "The language row of the account menu; absent for a product with one language.",
|
|
483
|
+
"required": false
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "linkAs",
|
|
487
|
+
"type": "ElementType<any, keyof IntrinsicElements>",
|
|
488
|
+
"default": null,
|
|
489
|
+
"description": "The router's link component (Next's `Link`) for the rail and the menu.",
|
|
490
|
+
"required": false
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "locale",
|
|
494
|
+
"type": "string",
|
|
495
|
+
"default": "en",
|
|
496
|
+
"description": "`en` or `fr`: the words of the shared vocabulary.",
|
|
497
|
+
"required": false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "notifications",
|
|
501
|
+
"type": "ReactNode",
|
|
502
|
+
"default": null,
|
|
503
|
+
"description": "Notifications: an `AppHeaderCount`, or the trigger of the host's popover.",
|
|
504
|
+
"required": false
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "primary",
|
|
508
|
+
"type": "ReactNode",
|
|
509
|
+
"default": null,
|
|
510
|
+
"description": "The one primary action of the app (« Check a document »).",
|
|
511
|
+
"required": false
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "search",
|
|
515
|
+
"type": "{ label: string; onOpen: () => void; }",
|
|
516
|
+
"default": null,
|
|
517
|
+
"description": "The search (⌘K): opens the app's command palette.",
|
|
518
|
+
"required": false
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "theme",
|
|
522
|
+
"type": "false | AppFrameTheme",
|
|
523
|
+
"default": null,
|
|
524
|
+
"description": "The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none.",
|
|
525
|
+
"required": false
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"name": "variant",
|
|
529
|
+
"type": "\"app\" | \"admin\"",
|
|
530
|
+
"default": "app",
|
|
531
|
+
"description": "`admin`: the administration's frame — a chip says so, and the way into it is not offered again.",
|
|
532
|
+
"required": false
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "words",
|
|
536
|
+
"type": "Partial<NavWords>",
|
|
537
|
+
"default": null,
|
|
538
|
+
"description": "Overrides of the shared words, for a product that needs one different (use sparingly).",
|
|
539
|
+
"required": false
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"component": "ACCOUNT_LINK_IDS",
|
|
545
|
+
"description": "The places the account menu can hold, in the order the frame draws them.",
|
|
546
|
+
"props": []
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"component": "ACCOUNT_MENU_ORDER",
|
|
550
|
+
"description": "The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product.",
|
|
551
|
+
"props": []
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"component": "MAIN_SECTIONS_MAX",
|
|
555
|
+
"description": "The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar).",
|
|
556
|
+
"props": []
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"component": "PUBLIC_BAR_MAX",
|
|
560
|
+
"description": "The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3).",
|
|
561
|
+
"props": []
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
}
|