@krizaka/ui 2.9.0 → 3.0.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/README.md +44 -6
- package/dist/audio-player.js +1 -1
- package/dist/blocks.css +247 -0
- package/dist/catalogue-page.d.ts +34 -0
- package/dist/catalogue-page.js +26 -0
- package/dist/catalogue-page.js.map +1 -0
- package/dist/changelog-page.d.ts +50 -0
- package/dist/changelog-page.js +27 -0
- package/dist/changelog-page.js.map +1 -0
- package/dist/{chunk-EUPTXKH7.js → chunk-BRKMQ6JV.js} +2 -1
- package/dist/chunk-FDCMBWUU.js +168 -0
- package/dist/chunk-FDCMBWUU.js.map +1 -0
- package/dist/chunk-HCNOOPZE.js +210 -0
- package/dist/chunk-HCNOOPZE.js.map +1 -0
- package/dist/{chunk-NOVUREEC.js → chunk-JZPVUJIX.js} +25 -3
- package/dist/chunk-JZPVUJIX.js.map +1 -0
- package/dist/chunk-KNBYZGSQ.js +11 -0
- package/dist/chunk-KNBYZGSQ.js.map +1 -0
- package/dist/{chunk-X6TW3X6Y.js → chunk-LCZXS6AK.js} +2 -2
- package/dist/chunk-OGJI5X4W.js +157 -0
- package/dist/chunk-OGJI5X4W.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/component-page.d.ts +41 -0
- package/dist/component-page.js +17 -0
- package/dist/component-page.js.map +1 -0
- package/dist/contact-page.d.ts +31 -0
- package/dist/contact-page.js +26 -0
- package/dist/contact-page.js.map +1 -0
- package/dist/data-table.d.ts +284 -24
- package/dist/data-table.js +914 -121
- package/dist/data-table.js.map +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/docs-article-page.d.ts +54 -0
- package/dist/docs-article-page.js +29 -0
- package/dist/docs-article-page.js.map +1 -0
- package/dist/docs-hub-page.d.ts +72 -0
- package/dist/docs-hub-page.js +45 -0
- package/dist/docs-hub-page.js.map +1 -0
- package/dist/error-page.d.ts +22 -0
- package/dist/error-page.js +23 -0
- package/dist/error-page.js.map +1 -0
- package/dist/filter-bar.d.ts +12 -12
- package/dist/filter-bar.js +9 -145
- package/dist/filter-bar.js.map +1 -1
- package/dist/gallery-page.d.ts +50 -0
- package/dist/gallery-page.js +30 -0
- package/dist/gallery-page.js.map +1 -0
- package/dist/{geometry-CXrAW34x.d.ts → geometry-CbOU4rtL.d.ts} +4 -4
- package/dist/how-it-works-page.d.ts +48 -0
- package/dist/how-it-works-page.js +28 -0
- package/dist/how-it-works-page.js.map +1 -0
- package/dist/image-cropper.js +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +93 -5
- package/dist/index.js.map +1 -1
- package/dist/landing-page.d.ts +58 -0
- package/dist/landing-page.js +42 -0
- package/dist/landing-page.js.map +1 -0
- package/dist/legal-page.d.ts +34 -0
- package/dist/legal-page.js +18 -0
- package/dist/legal-page.js.map +1 -0
- package/dist/longform-page.d.ts +42 -0
- package/dist/longform-page.js +29 -0
- package/dist/longform-page.js.map +1 -0
- package/dist/mascot-quote.d.ts +4 -4
- package/dist/mascot-quote.js +23 -1
- package/dist/mascot-quote.js.map +1 -1
- package/dist/mascot-state.d.ts +2 -2
- package/dist/mascot-state.js +1 -1
- package/dist/mascot-state.js.map +1 -1
- package/dist/mascots.d.ts +4 -4
- package/dist/mascots.js +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/native/list.d.ts +95 -0
- package/dist/native/list.js +135 -0
- package/dist/native/list.js.map +1 -0
- package/dist/native.d.ts +16 -9
- package/dist/native.js +183 -74
- package/dist/native.js.map +1 -1
- package/dist/pricing-page.d.ts +62 -0
- package/dist/pricing-page.js +71 -0
- package/dist/pricing-page.js.map +1 -0
- package/dist/product-page.d.ts +83 -0
- package/dist/product-page.js +60 -0
- package/dist/product-page.js.map +1 -0
- package/dist/search-field.js +6 -160
- package/dist/search-field.js.map +1 -1
- package/dist/status-page.d.ts +42 -0
- package/dist/status-page.js +28 -0
- package/dist/status-page.js.map +1 -0
- package/dist/tag-input.js +2 -2
- package/dist/video-player.js +1 -1
- package/dist/video-trimmer.js +1 -1
- package/dist/virtual.d.ts +140 -0
- package/dist/virtual.js +19 -0
- package/dist/virtual.js.map +1 -0
- package/package.json +296 -10
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/alert.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/button.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +240 -0
- package/registry/changelog-page.json +226 -0
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.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/component-page.json +227 -0
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +212 -0
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +643 -49
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +242 -0
- package/registry/docs-hub-page.json +270 -0
- package/registry/docs-layout.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +183 -0
- package/registry/examples/catalogue-page/components.d.ts +4 -0
- package/registry/examples/catalogue-page/components.js +33 -0
- package/registry/examples/catalogue-page/components.tsx +36 -0
- package/registry/examples/changelog-page/releases.d.ts +4 -0
- package/registry/examples/changelog-page/releases.js +44 -0
- package/registry/examples/changelog-page/releases.tsx +39 -0
- package/registry/examples/component-page/button.d.ts +4 -0
- package/registry/examples/component-page/button.js +33 -0
- package/registry/examples/component-page/button.tsx +30 -0
- package/registry/examples/contact-page/team.d.ts +4 -0
- package/registry/examples/contact-page/team.js +39 -0
- package/registry/examples/contact-page/team.tsx +38 -0
- package/registry/examples/data-table/details.d.ts +4 -0
- package/registry/examples/data-table/details.js +33 -0
- package/registry/examples/data-table/details.tsx +31 -0
- package/registry/examples/data-table/filters.d.ts +4 -0
- package/registry/examples/data-table/filters.js +40 -0
- package/registry/examples/data-table/filters.tsx +40 -0
- package/registry/examples/data-table/grouped.d.ts +4 -0
- package/registry/examples/data-table/grouped.js +24 -0
- package/registry/examples/data-table/grouped.tsx +23 -0
- package/registry/examples/data-table/paginated.d.ts +4 -0
- package/registry/examples/data-table/paginated.js +23 -0
- package/registry/examples/data-table/paginated.tsx +22 -0
- package/registry/examples/data-table/pinned.d.ts +4 -0
- package/registry/examples/data-table/pinned.js +26 -0
- package/registry/examples/data-table/pinned.tsx +25 -0
- package/registry/examples/data-table/server.d.ts +4 -0
- package/registry/examples/data-table/server.js +40 -0
- package/registry/examples/data-table/server.tsx +40 -0
- package/registry/examples/data-table/virtualized.js +2 -2
- package/registry/examples/data-table/virtualized.tsx +3 -3
- package/registry/examples/docs-article-page/cli.d.ts +4 -0
- package/registry/examples/docs-article-page/cli.js +33 -0
- package/registry/examples/docs-article-page/cli.tsx +38 -0
- package/registry/examples/docs-hub-page/krizaka.d.ts +4 -0
- package/registry/examples/docs-hub-page/krizaka.js +46 -0
- package/registry/examples/docs-hub-page/krizaka.tsx +37 -0
- package/registry/examples/error-page/not-found.d.ts +4 -0
- package/registry/examples/error-page/not-found.js +24 -0
- package/registry/examples/error-page/not-found.tsx +19 -0
- package/registry/examples/gallery-page/made-here.d.ts +4 -0
- package/registry/examples/gallery-page/made-here.js +34 -0
- package/registry/examples/gallery-page/made-here.tsx +32 -0
- package/registry/examples/how-it-works-page/orazaka.d.ts +4 -0
- package/registry/examples/how-it-works-page/orazaka.js +30 -0
- package/registry/examples/how-it-works-page/orazaka.tsx +26 -0
- package/registry/examples/landing-page/krizaka.d.ts +4 -0
- package/registry/examples/landing-page/krizaka.js +44 -0
- package/registry/examples/landing-page/krizaka.tsx +44 -0
- package/registry/examples/legal-page/privacy.d.ts +4 -0
- package/registry/examples/legal-page/privacy.js +24 -0
- package/registry/examples/legal-page/privacy.tsx +19 -0
- package/registry/examples/list/native/default.d.ts +4 -0
- package/registry/examples/list/native/default.dark.png +0 -0
- package/registry/examples/list/native/default.js +33 -0
- package/registry/examples/list/native/default.light.png +0 -0
- package/registry/examples/list/native/default.tsx +31 -0
- package/registry/examples/list/native/infinite.d.ts +4 -0
- package/registry/examples/list/native/infinite.dark.png +0 -0
- package/registry/examples/list/native/infinite.js +30 -0
- package/registry/examples/list/native/infinite.light.png +0 -0
- package/registry/examples/list/native/infinite.tsx +35 -0
- package/registry/examples/list/native/states.d.ts +4 -0
- package/registry/examples/list/native/states.dark.png +0 -0
- package/registry/examples/list/native/states.js +26 -0
- package/registry/examples/list/native/states.light.png +0 -0
- package/registry/examples/list/native/states.tsx +21 -0
- package/registry/examples/longform-page/story.d.ts +4 -0
- package/registry/examples/longform-page/story.js +38 -0
- package/registry/examples/longform-page/story.tsx +35 -0
- package/registry/examples/mascots/crane.d.ts +4 -0
- package/registry/examples/mascots/crane.js +19 -0
- package/registry/examples/mascots/crane.tsx +18 -0
- package/registry/examples/mascots/flock.tsx +2 -1
- package/registry/examples/mascots/native/crane.d.ts +4 -0
- package/registry/examples/mascots/native/crane.dark.png +0 -0
- package/registry/examples/mascots/native/crane.js +21 -0
- package/registry/examples/mascots/native/crane.light.png +0 -0
- package/registry/examples/mascots/native/crane.tsx +18 -0
- package/registry/examples/pricing-page/credits.d.ts +4 -0
- package/registry/examples/pricing-page/credits.js +41 -0
- package/registry/examples/pricing-page/credits.tsx +33 -0
- package/registry/examples/product-page/orazaka.d.ts +4 -0
- package/registry/examples/product-page/orazaka.js +44 -0
- package/registry/examples/product-page/orazaka.tsx +36 -0
- package/registry/examples/status-page/building.d.ts +4 -0
- package/registry/examples/status-page/building.js +29 -0
- package/registry/examples/status-page/building.tsx +25 -0
- package/registry/examples/status-page/operational.d.ts +4 -0
- package/registry/examples/status-page/operational.js +26 -0
- package/registry/examples/status-page/operational.tsx +20 -0
- package/registry/examples/virtual/feed.d.ts +4 -0
- package/registry/examples/virtual/feed.js +26 -0
- package/registry/examples/virtual/feed.tsx +24 -0
- package/registry/examples/virtual/gallery.d.ts +4 -0
- package/registry/examples/virtual/gallery.js +31 -0
- package/registry/examples/virtual/gallery.tsx +28 -0
- package/registry/examples/virtual/messages.d.ts +4 -0
- package/registry/examples/virtual/messages.js +28 -0
- package/registry/examples/virtual/messages.tsx +28 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/gallery-page.json +256 -0
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +242 -0
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +356 -9
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +242 -0
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +199 -0
- package/registry/link-card.json +1 -1
- package/registry/list.json +249 -0
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +213 -0
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +6 -6
- package/registry/mascot-state.json +34 -34
- package/registry/mascots.json +41 -21
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +245 -0
- package/registry/product-page.json +319 -0
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +1 -1
- 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/settings-layout.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.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/status-page.json +263 -0
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +569 -0
- package/skills/data-table/SKILL.md +56 -0
- package/skills/native-list/SKILL.md +39 -0
- package/skills/virtual/SKILL.md +35 -0
- package/dist/chunk-NOVUREEC.js.map +0 -1
- /package/dist/{chunk-EUPTXKH7.js.map → chunk-BRKMQ6JV.js.map} +0 -0
- /package/dist/{chunk-X6TW3X6Y.js.map → chunk-LCZXS6AK.js.map} +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "list",
|
|
3
|
+
"type": "native",
|
|
4
|
+
"title": "List",
|
|
5
|
+
"summary": "A long list for React Native on FlashList v2 — separators, skeleton rows, empty and error states, pull to refresh, the next page loaded near the end through useInfiniteQuery of @krizaka/query.",
|
|
6
|
+
"description": "A long list for React Native on FlashList v2 — separators, skeleton rows, empty and error states, pull to refresh, the next page loaded near the end through useInfiniteQuery of @krizaka/query.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "data-display",
|
|
9
|
+
"platforms": "native",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"Any scrolling list of an app screen: notifications, messages, a feed, search results, payouts.",
|
|
12
|
+
"A paginated API (`useInfiniteList`): one hook, one component — pages, refresh and errors handled."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "On the web: the virtual list, or the data table for columns.",
|
|
17
|
+
"use": "virtual"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For a few items that never scroll: lay them out in a View.",
|
|
21
|
+
"use": "card"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"bestPractices": [
|
|
25
|
+
"Give `keyExtractor` an id: FlashList recycles the views by it.",
|
|
26
|
+
"Fetch with `useInfiniteList` (a `defineKeys` key, `krizakaFetch` in `queryFn`) and spread its `listProps` on `List`.",
|
|
27
|
+
"Render `error` with an `ErrorState` and a retry; give `empty` its words (`{ title, description, action }`).",
|
|
28
|
+
"Keep `renderItem` light (no state per item): views are recycled while the person scrolls."
|
|
29
|
+
],
|
|
30
|
+
"accessibility": {
|
|
31
|
+
"keyboard": [],
|
|
32
|
+
"notes": [
|
|
33
|
+
"The list is named by `label`; while the first page loads it is `aria-busy` and its skeleton rows are hidden from assistive technology.",
|
|
34
|
+
"An error is announced (`role=\"alert\"`); the spinner of the next page is named by `loadingMoreLabel`.",
|
|
35
|
+
"Pull to refresh is the system's control (tinted with the theme); `onRefresh` should also be reachable from a button for switch and voice access."
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"related": [
|
|
39
|
+
"virtual",
|
|
40
|
+
"empty-state",
|
|
41
|
+
"skeleton",
|
|
42
|
+
"spinner",
|
|
43
|
+
"pagination"
|
|
44
|
+
],
|
|
45
|
+
"web": null,
|
|
46
|
+
"native": {
|
|
47
|
+
"entry": "@krizaka/ui/native/list",
|
|
48
|
+
"import": "import { List, useInfiniteList } from \"@krizaka/ui/native/list\";",
|
|
49
|
+
"differences": [],
|
|
50
|
+
"props": [
|
|
51
|
+
{
|
|
52
|
+
"component": "List",
|
|
53
|
+
"description": "A long list on FlashList v2 (recycled views, 60 fps): separators, skeleton rows while the first page loads, an empty\nor error state in place of the items, pull to refresh tinted with the theme, the next page asked for near the end and\na spinner under the last item. With `useInfiniteList`, a paginated API is one hook and one component.",
|
|
54
|
+
"props": [
|
|
55
|
+
{
|
|
56
|
+
"name": "data",
|
|
57
|
+
"type": "readonly T[]",
|
|
58
|
+
"default": null,
|
|
59
|
+
"description": "The items (stable: a query's data, state).",
|
|
60
|
+
"required": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "keyExtractor",
|
|
64
|
+
"type": "(item: T, index: number) => string",
|
|
65
|
+
"default": null,
|
|
66
|
+
"description": "A stable key per item (an id): FlashList recycles the views by it.",
|
|
67
|
+
"required": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "label",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"default": null,
|
|
73
|
+
"description": "The accessible name of the list (\"Notifications\"), passed translated.",
|
|
74
|
+
"required": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "renderItem",
|
|
78
|
+
"type": "(item: T, index: number) => ReactElement<unknown, string | JSXElementConstructor<any>> | null",
|
|
79
|
+
"default": null,
|
|
80
|
+
"description": "Draws one item.",
|
|
81
|
+
"required": true
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "contentContainerStyle",
|
|
85
|
+
"type": "StyleProp<ViewStyle>",
|
|
86
|
+
"default": null,
|
|
87
|
+
"description": "Styles of the list's content (padding).",
|
|
88
|
+
"required": false
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "empty",
|
|
92
|
+
"type": "ReactNode | { title: string; description?: string; action?: ReactNode; }",
|
|
93
|
+
"default": null,
|
|
94
|
+
"description": "Shown when there is no item (an `EmptyState`, or its words: `{ title, description, action }`).",
|
|
95
|
+
"required": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "endReachedThreshold",
|
|
99
|
+
"type": "number",
|
|
100
|
+
"default": "0.5",
|
|
101
|
+
"description": "How far from the end `onEndReached` fires, in screens. Default 0.5.",
|
|
102
|
+
"required": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "error",
|
|
106
|
+
"type": "ReactNode",
|
|
107
|
+
"default": null,
|
|
108
|
+
"description": "A failure, shown in place of the items (an `ErrorState` with a retry).",
|
|
109
|
+
"required": false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "extraData",
|
|
113
|
+
"type": "unknown",
|
|
114
|
+
"default": null,
|
|
115
|
+
"description": "Extra data the items depend on (a selection): a change re-renders the visible items.",
|
|
116
|
+
"required": false
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "footer",
|
|
120
|
+
"type": "ReactElement<unknown, string | JSXElementConstructor<any>>",
|
|
121
|
+
"default": null,
|
|
122
|
+
"description": "Under the last item.",
|
|
123
|
+
"required": false
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "header",
|
|
127
|
+
"type": "ReactElement<unknown, string | JSXElementConstructor<any>>",
|
|
128
|
+
"default": null,
|
|
129
|
+
"description": "Above the first item (a title, filters): scrolls with the list.",
|
|
130
|
+
"required": false
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "loading",
|
|
134
|
+
"type": "boolean",
|
|
135
|
+
"default": null,
|
|
136
|
+
"description": "The first page is loading: skeleton rows (`loadingRows` of them) in place of the items.",
|
|
137
|
+
"required": false
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "loadingMore",
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"default": null,
|
|
143
|
+
"description": "The next page is loading: a spinner under the last item, named by `loadingMoreLabel`.",
|
|
144
|
+
"required": false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "loadingMoreLabel",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"default": "Loading more",
|
|
150
|
+
"description": "The name of that spinner (\"Loading more\"), passed translated.",
|
|
151
|
+
"required": false
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "loadingRows",
|
|
155
|
+
"type": "number",
|
|
156
|
+
"default": "6",
|
|
157
|
+
"description": "How many skeleton rows while loading. Default 6.",
|
|
158
|
+
"required": false
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "onEndReached",
|
|
162
|
+
"type": "(() => void)",
|
|
163
|
+
"default": null,
|
|
164
|
+
"description": "Called when the end comes near: load the next page.",
|
|
165
|
+
"required": false
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "onRefresh",
|
|
169
|
+
"type": "(() => void)",
|
|
170
|
+
"default": null,
|
|
171
|
+
"description": "Pull to refresh: called when the person pulls the list down.",
|
|
172
|
+
"required": false
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "ref",
|
|
176
|
+
"type": "Ref<FlashListRef<T>>",
|
|
177
|
+
"default": null,
|
|
178
|
+
"description": "The FlashList, for `scrollToIndex` / `scrollToOffset`.",
|
|
179
|
+
"required": false
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "refreshing",
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"default": "false",
|
|
185
|
+
"description": "The list is reloading after a pull: the system's spinner at the top.",
|
|
186
|
+
"required": false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "separator",
|
|
190
|
+
"type": "\"none\" | \"full\" | \"inset\"",
|
|
191
|
+
"default": "full",
|
|
192
|
+
"description": "A hairline between items: `full` (default), `inset` (aligned with the text after an avatar), `none`.",
|
|
193
|
+
"required": false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "style",
|
|
197
|
+
"type": "StyleProp<ViewStyle>",
|
|
198
|
+
"default": null,
|
|
199
|
+
"description": "Styles merged last, on the list.",
|
|
200
|
+
"required": false
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"examples": [
|
|
206
|
+
{
|
|
207
|
+
"name": "default",
|
|
208
|
+
"title": "Default",
|
|
209
|
+
"description": "Notifications with avatars, separators inset after the avatar.",
|
|
210
|
+
"path": "examples/list/native/default.tsx",
|
|
211
|
+
"module": "@krizaka/ui/registry/examples/list/native/default",
|
|
212
|
+
"code": "import { Avatar, Txt } from \"@krizaka/ui/native\";\nimport { List } from \"@krizaka/ui/native/list\";\nimport { View } from \"react-native\";\n\ntype Notification = { id: string; who: string; what: string; when: string };\nconst notifications: Notification[] = [\n { id: \"n1\", who: \"Elena Varga\", what: \"tipped your video “Sunset over Montréal”\", when: \"2 min\" },\n { id: \"n2\", who: \"Noah Petit\", what: \"started following you\", when: \"1 h\" },\n { id: \"n3\", who: \"Maya Chen\", what: \"commented: “The drone shot!”\", when: \"3 h\" },\n];\n\n// A FlashList v2 with the theme's separators, inset after the avatar.\nexport default function NativeListDefault() {\n return (\n <List\n label=\"Notifications\"\n data={notifications}\n keyExtractor={(n) => n.id}\n separator=\"inset\"\n renderItem={(n) => (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 12, paddingHorizontal: 16, paddingVertical: 12 }}>\n <Avatar alt={n.who} size=\"md\" />\n <View style={{ flex: 1 }}>\n <Txt>{`${n.who} ${n.what}`}</Txt>\n <Txt variant=\"caption\" tone=\"secondary\">{n.when}</Txt>\n </View>\n </View>\n )}\n />\n );\n}\n",
|
|
213
|
+
"screenshots": {
|
|
214
|
+
"dark": "examples/list/native/default.dark.png",
|
|
215
|
+
"light": "examples/list/native/default.light.png"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "infinite",
|
|
220
|
+
"title": "Infinite",
|
|
221
|
+
"description": "`useInfiniteList` on a paginated API (faked here with `configureKrizakaFetch`): the next page near the end, pull to refresh.",
|
|
222
|
+
"path": "examples/list/native/infinite.tsx",
|
|
223
|
+
"module": "@krizaka/ui/registry/examples/list/native/infinite",
|
|
224
|
+
"code": "import { configureKrizakaFetch, krizakaFetch, KrizakaQueryProvider } from \"@krizaka/query\";\nimport { Txt } from \"@krizaka/ui/native\";\nimport { List, useInfiniteList } from \"@krizaka/ui/native/list\";\nimport { useState } from \"react\";\n\ntype Page = { items: { id: string; title: string }[]; next: number | null };\n// The API, faked in the screen: 20 videos per page, 5 pages.\nasync function fakeApi(input: RequestInfo | URL) {\n const cursor = Number(new URL(String(input), \"https://api.example\").searchParams.get(\"cursor\"));\n const items = Array.from({ length: 20 }, (_, i) => ({ id: `v${cursor + i}`, title: `Video ${cursor + i + 1}` }));\n return Response.json({ items, next: cursor + 20 < 100 ? cursor + 20 : null } satisfies Page);\n}\n\nfunction Videos() {\n const { listProps, error } = useInfiniteList({\n queryKey: [\"videos\", \"feed\"],\n queryFn: ({ pageParam, signal }) => krizakaFetch(\"/api/videos\", { query: { cursor: pageParam }, signal }) as Promise<Page>,\n initialPageParam: 0,\n getNextPageParam: (last) => last.next,\n getItems: (page) => page.items,\n });\n return (\n <List label=\"Videos\" {...listProps} error={error ? <Txt>Could not load the videos.</Txt> : undefined} keyExtractor={(v) => v.id} renderItem={(v) => <Txt style={{ padding: 16 }}>{v.title}</Txt>} />\n );\n}\n\n// A paginated API as a list: the next page near the end, pull to refresh, the query of @krizaka/query.\nexport default function NativeListInfinite() {\n useState(() => configureKrizakaFetch({ fetch: fakeApi as typeof fetch }));\n return (\n <KrizakaQueryProvider>\n <Videos />\n </KrizakaQueryProvider>\n );\n}\n",
|
|
225
|
+
"screenshots": {
|
|
226
|
+
"dark": "examples/list/native/infinite.dark.png",
|
|
227
|
+
"light": "examples/list/native/infinite.light.png"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "states",
|
|
232
|
+
"title": "Loading and empty",
|
|
233
|
+
"description": "Skeleton rows while the first page loads; the empty state with what to do next.",
|
|
234
|
+
"path": "examples/list/native/states.tsx",
|
|
235
|
+
"module": "@krizaka/ui/registry/examples/list/native/states",
|
|
236
|
+
"code": "import { Button } from \"@krizaka/ui/native\";\nimport { List } from \"@krizaka/ui/native/list\";\nimport { View } from \"react-native\";\n\nconst NONE: { id: string }[] = [];\n\n// While the first page loads: skeleton rows. Nothing yet: the empty state and what to do next.\nexport default function NativeListStates() {\n return (\n <View style={{ gap: 24, width: \"100%\" }}>\n <List label=\"Messages\" data={NONE} keyExtractor={(m) => m.id} renderItem={() => null} loading loadingRows={3} />\n <List\n label=\"Messages\"\n data={NONE}\n keyExtractor={(m) => m.id}\n renderItem={() => null}\n empty={{ title: \"No message yet\", description: \"Say hello to a creator you follow.\", action: <Button label=\"Find creators\" size=\"sm\" /> }}\n />\n </View>\n );\n}\n",
|
|
237
|
+
"screenshots": {
|
|
238
|
+
"dark": "examples/list/native/states.dark.png",
|
|
239
|
+
"light": "examples/list/native/states.light.png"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"files": [],
|
|
245
|
+
"dependencies": [],
|
|
246
|
+
"registryDependencies": [],
|
|
247
|
+
"demo": null,
|
|
248
|
+
"props": []
|
|
249
|
+
}
|
package/registry/loader.json
CHANGED
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
"path": "meta.ts",
|
|
253
|
-
"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 krizaka.com renders as\n// /docs/ui/<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 | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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 templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
253
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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/**\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 */\nexport interface Example {\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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
254
254
|
}
|
|
255
255
|
],
|
|
256
256
|
"dependencies": [
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "longform-page",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Longform page",
|
|
5
|
+
"summary": "A long read — a story, an essay, a case: numbered chapters in a reading column, pull quotes in the margin, figures that break out.",
|
|
6
|
+
"description": "A long read — a story, an essay, a case: numbered chapters in a reading column, pull quotes in the margin, figures that break out.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "templates",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"A company's story, a case study, an essay.",
|
|
12
|
+
"Any text read from the top, chapter by chapter."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For a documentation article.",
|
|
17
|
+
"use": "docs-article-page"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For a policy.",
|
|
21
|
+
"use": "legal-page"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"bestPractices": [
|
|
25
|
+
"Chapters of three to six paragraphs; one pull quote at most each.",
|
|
26
|
+
"Figures carry a promise (a bird's quote, a schema), never decoration.",
|
|
27
|
+
"Words and content arrive as props; the motion is the platform's (`[data-reveal]`, still under reduced motion)."
|
|
28
|
+
],
|
|
29
|
+
"accessibility": {
|
|
30
|
+
"keyboard": [],
|
|
31
|
+
"notes": [
|
|
32
|
+
"Each chapter is a `section` named by its `h2`; the numbers are decorative.",
|
|
33
|
+
"The pull quote repeats the text: it adds nothing a reader would miss."
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"related": [
|
|
37
|
+
"mascot-quote",
|
|
38
|
+
"page-hero",
|
|
39
|
+
"legal-page"
|
|
40
|
+
],
|
|
41
|
+
"web": {
|
|
42
|
+
"entry": "@krizaka/ui/longform-page",
|
|
43
|
+
"import": "import { LongformPage } from \"@krizaka/ui/longform-page\";",
|
|
44
|
+
"props": [
|
|
45
|
+
{
|
|
46
|
+
"component": "LongformPage",
|
|
47
|
+
"description": "A long read: hero, then numbered chapters with pull quotes in the margin and figures that break out.",
|
|
48
|
+
"props": [
|
|
49
|
+
{
|
|
50
|
+
"name": "chapters",
|
|
51
|
+
"type": "readonly LongformChapter[]",
|
|
52
|
+
"default": null,
|
|
53
|
+
"description": "The chapters, in order.",
|
|
54
|
+
"required": true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "title",
|
|
58
|
+
"type": "ReactNode",
|
|
59
|
+
"default": null,
|
|
60
|
+
"description": "The page's `h1`.",
|
|
61
|
+
"required": true
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "aside",
|
|
65
|
+
"type": "ReactNode",
|
|
66
|
+
"default": null,
|
|
67
|
+
"description": "Beside the hero: the page's bird, an illustration.",
|
|
68
|
+
"required": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "back",
|
|
72
|
+
"type": "{ href: string; label: string; }",
|
|
73
|
+
"default": null,
|
|
74
|
+
"description": "The way back.",
|
|
75
|
+
"required": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "brand",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"default": null,
|
|
81
|
+
"description": "The brand the page wears (`.brand-<id>`).",
|
|
82
|
+
"required": false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "eyebrow",
|
|
86
|
+
"type": "ReactNode",
|
|
87
|
+
"default": null,
|
|
88
|
+
"description": "A mono line above the title.",
|
|
89
|
+
"required": false
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "lead",
|
|
93
|
+
"type": "ReactNode",
|
|
94
|
+
"default": null,
|
|
95
|
+
"description": "The standfirst.",
|
|
96
|
+
"required": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "linkAs",
|
|
100
|
+
"type": "LinkComponent",
|
|
101
|
+
"default": null,
|
|
102
|
+
"description": "The app's link component (Next's `Link`).",
|
|
103
|
+
"required": false
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"examples": [
|
|
109
|
+
{
|
|
110
|
+
"name": "story",
|
|
111
|
+
"title": "Our story",
|
|
112
|
+
"description": "Krizaka's story in chapters, a pull quote and the flamingo's rule.",
|
|
113
|
+
"template": true,
|
|
114
|
+
"path": "examples/longform-page/story.tsx",
|
|
115
|
+
"module": "@krizaka/ui/registry/examples/longform-page/story",
|
|
116
|
+
"code": "import { LongformPage } from \"@krizaka/ui/longform-page\";\nimport { MascotQuote } from \"@krizaka/ui/mascot-quote\";\nimport { Mascot } from \"@krizaka/ui/mascots\";\n\n// TEMPLATE — a long read (Krizaka's story): numbered chapters in a reading column, a sentence pulled into the margin,\n// a bird's quote breaking out under the text. Editorial, not cards; one column on a phone.\nexport default function LongformPageStory() {\n return (\n <LongformPage\n eyebrow=\"Our story\"\n title=\"Why a studio in Montréal builds its own AI\"\n lead=\"Three products, one rule: what is yours stays yours.\"\n aside={<Mascot bird=\"owl\" mood=\"welcome\" size={112} />}\n chapters={[\n {\n id: \"start\",\n title: \"It started with a lease\",\n pull: \"The prompt crossed the ocean before the answer came back.\",\n children: (\n <>\n <p>A notary asked a chatbot to summarise a lease. The answer was good; the lease was now on someone else's server.</p>\n <p>We built Orazaka so that question never has to leave the office.</p>\n </>\n ),\n },\n {\n id: \"creators\",\n title: \"Then came the creators\",\n children: <p>Orochia pays creators 90 % of what their fans spend, every Monday — no algorithm in between.</p>,\n figure: <MascotQuote bird=\"flamingo\" label=\"The flamingo's rule\">Whoever does the work gets paid first.</MascotQuote>,\n },\n ]}\n />\n );\n}\n"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"native": null,
|
|
121
|
+
"files": [
|
|
122
|
+
{
|
|
123
|
+
"path": "longform-page/index.ts",
|
|
124
|
+
"content": "/** @krizaka/ui/longform-page — `LongformPage`: A long read: numbered chapters, pull quotes in the margin, figures that break out. Server-safe; a page template. */\nexport { type LongformChapter,LongformPage, type LongformPageProps } from \"./longform-page\";\n"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"path": "longform-page/longform-page.tsx",
|
|
128
|
+
"content": "// Server-safe. A long read — a story, an essay, a case (blocks.css `.kz-tpl-chapters`): the hero, then chapters, each\n// with its big outlined number, its title, its text in a reading column, a pull quote in the margin and a figure that\n// breaks out to the margin's width; the contents as chips on a phone. Editorial, not cards.\nimport { Page } from \"@krizaka/ui/page\";\nimport type { LinkComponent } from \"@krizaka/ui/page-hero\";\nimport { PageHero } from \"@krizaka/ui/page-hero\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport interface LongformChapter {\n /** The chapter's anchor. */\n id: string;\n /** Its title. */\n title: React.ReactNode;\n /** Its text (paragraphs). */\n children: React.ReactNode;\n /** A sentence pulled into the margin. */\n pull?: React.ReactNode;\n /** A figure under the text (an image, a schema, a quote by a bird). */\n figure?: React.ReactNode;\n}\n\nexport type LongformPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The brand the page wears (`.brand-<id>`). */\n brand?: string;\n /** The way back. */\n back?: { href: string; label: string };\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The page's `h1`. */\n title: React.ReactNode;\n /** The standfirst. */\n lead?: React.ReactNode;\n /** Beside the hero: the page's bird, an illustration. */\n aside?: React.ReactNode;\n /** The chapters, in order. */\n chapters: readonly LongformChapter[];\n /** After the chapters: the end note, a call. */\n children?: React.ReactNode;\n /** The app's link component (Next's `Link`). */\n linkAs?: LinkComponent;\n};\n\n/** A long read: hero, then numbered chapters with pull quotes in the margin and figures that break out. */\nexport function LongformPage({ brand, back, eyebrow, title, lead, aside, chapters, linkAs, className, children, ...props }: LongformPageProps) {\n return (\n <div className={cn(brand && \"brand-\" + brand, className)} {...props}>\n <PageHero back={back} linkAs={linkAs} eyebrow={eyebrow} title={title} lead={lead} aside={aside} />\n <Page className=\"kz-tpl-longform\">\n <div className=\"kz-tpl-chapters\">\n {chapters.map((c, i) => (\n <section key={c.id} className=\"kz-tpl-chapter\" aria-labelledby={c.id} data-reveal=\"\">\n <span className=\"kz-tpl-chapter-n\" aria-hidden>\n {String(i + 1).padStart(2, \"0\")}\n </span>\n <div className=\"kz-tpl-chapter-body\">\n <h2 id={c.id}>{c.title}</h2>\n {c.children}\n </div>\n {c.pull && (\n <aside className=\"kz-tpl-chapter-aside\">\n <p className=\"kz-tpl-pull\">{c.pull}</p>\n </aside>\n )}\n {c.figure && <figure className=\"kz-tpl-chapter-figure\">{c.figure}</figure>}\n </section>\n ))}\n </div>\n {children}\n </Page>\n </div>\n );\n}\n"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"path": "longform-page/meta.ts",
|
|
132
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Longform page\",\n summary: \"A long read — a story, an essay, a case: numbered chapters in a reading column, pull quotes in the margin, figures that break out.\",\n status: \"beta\",\n category: \"templates\",\n platforms: \"web\",\n whenToUse: [\"A company's story, a case study, an essay.\", \"Any text read from the top, chapter by chapter.\"],\n whenNotToUse: [\n { when: \"For a documentation article.\", use: \"docs-article-page\" },\n { when: \"For a policy.\", use: \"legal-page\" },\n ],\n bestPractices: [\"Chapters of three to six paragraphs; one pull quote at most each.\", \"Figures carry a promise (a bird's quote, a schema), never decoration.\", \"Words and content arrive as props; the motion is the platform's (`[data-reveal]`, still under reduced motion).\"],\n accessibility: {\n keyboard: [],\n notes: [\"Each chapter is a `section` named by its `h2`; the numbers are decorative.\", \"The pull quote repeats the text: it adds nothing a reader would miss.\"],\n },\n related: [\"mascot-quote\", \"page-hero\", \"legal-page\"],\n web: {\n imports: [\"LongformPage\"],\n examples: [\n { name: \"story\", title: \"Our story\", description: \"Krizaka's story in chapters, a pull quote and the flamingo's rule.\", template: true },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"path": "meta.ts",
|
|
136
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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/**\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 */\nexport interface Example {\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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"dependencies": [],
|
|
140
|
+
"registryDependencies": [
|
|
141
|
+
"cn",
|
|
142
|
+
"page",
|
|
143
|
+
"page-hero"
|
|
144
|
+
],
|
|
145
|
+
"demo": {
|
|
146
|
+
"path": "examples/longform-page/story.tsx",
|
|
147
|
+
"content": "import { LongformPage } from \"@krizaka/ui/longform-page\";\nimport { MascotQuote } from \"@krizaka/ui/mascot-quote\";\nimport { Mascot } from \"@krizaka/ui/mascots\";\n\n// TEMPLATE — a long read (Krizaka's story): numbered chapters in a reading column, a sentence pulled into the margin,\n// a bird's quote breaking out under the text. Editorial, not cards; one column on a phone.\nexport default function LongformPageStory() {\n return (\n <LongformPage\n eyebrow=\"Our story\"\n title=\"Why a studio in Montréal builds its own AI\"\n lead=\"Three products, one rule: what is yours stays yours.\"\n aside={<Mascot bird=\"owl\" mood=\"welcome\" size={112} />}\n chapters={[\n {\n id: \"start\",\n title: \"It started with a lease\",\n pull: \"The prompt crossed the ocean before the answer came back.\",\n children: (\n <>\n <p>A notary asked a chatbot to summarise a lease. The answer was good; the lease was now on someone else's server.</p>\n <p>We built Orazaka so that question never has to leave the office.</p>\n </>\n ),\n },\n {\n id: \"creators\",\n title: \"Then came the creators\",\n children: <p>Orochia pays creators 90 % of what their fans spend, every Monday — no algorithm in between.</p>,\n figure: <MascotQuote bird=\"flamingo\" label=\"The flamingo's rule\">Whoever does the work gets paid first.</MascotQuote>,\n },\n ]}\n />\n );\n}\n"
|
|
148
|
+
},
|
|
149
|
+
"props": [
|
|
150
|
+
{
|
|
151
|
+
"component": "LongformPage",
|
|
152
|
+
"description": "A long read: hero, then numbered chapters with pull quotes in the margin and figures that break out.",
|
|
153
|
+
"props": [
|
|
154
|
+
{
|
|
155
|
+
"name": "chapters",
|
|
156
|
+
"type": "readonly LongformChapter[]",
|
|
157
|
+
"default": null,
|
|
158
|
+
"description": "The chapters, in order.",
|
|
159
|
+
"required": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "title",
|
|
163
|
+
"type": "ReactNode",
|
|
164
|
+
"default": null,
|
|
165
|
+
"description": "The page's `h1`.",
|
|
166
|
+
"required": true
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "aside",
|
|
170
|
+
"type": "ReactNode",
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "Beside the hero: the page's bird, an illustration.",
|
|
173
|
+
"required": false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "back",
|
|
177
|
+
"type": "{ href: string; label: string; }",
|
|
178
|
+
"default": null,
|
|
179
|
+
"description": "The way back.",
|
|
180
|
+
"required": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "brand",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"default": null,
|
|
186
|
+
"description": "The brand the page wears (`.brand-<id>`).",
|
|
187
|
+
"required": false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "eyebrow",
|
|
191
|
+
"type": "ReactNode",
|
|
192
|
+
"default": null,
|
|
193
|
+
"description": "A mono line above the title.",
|
|
194
|
+
"required": false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "lead",
|
|
198
|
+
"type": "ReactNode",
|
|
199
|
+
"default": null,
|
|
200
|
+
"description": "The standfirst.",
|
|
201
|
+
"required": false
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "linkAs",
|
|
205
|
+
"type": "LinkComponent",
|
|
206
|
+
"default": null,
|
|
207
|
+
"description": "The app's link component (Next's `Link`).",
|
|
208
|
+
"required": false
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"path": "meta.ts",
|
|
132
|
-
"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 krizaka.com renders as\n// /docs/ui/<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 | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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 templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
132
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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/**\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 */\nexport interface Example {\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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
133
133
|
}
|
|
134
134
|
],
|
|
135
135
|
"dependencies": [
|