@krizaka/ui 2.5.0 → 2.6.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 -1
- package/dist/action-bar.d.ts +38 -0
- package/dist/action-bar.js +52 -0
- package/dist/action-bar.js.map +1 -0
- package/dist/argument-card.d.ts +67 -0
- package/dist/argument-card.js +69 -0
- package/dist/argument-card.js.map +1 -0
- package/dist/audio-player.js +1 -1
- package/dist/block-link-BAg4eoZk.d.ts +12 -0
- package/dist/blocks.css +529 -0
- package/dist/button.js +5 -94
- package/dist/button.js.map +1 -1
- package/dist/card-grid.d.ts +42 -0
- package/dist/card-grid.js +47 -0
- package/dist/card-grid.js.map +1 -0
- package/dist/chunk-2AGSO3WH.js +20 -0
- package/dist/chunk-2AGSO3WH.js.map +1 -0
- package/dist/chunk-AB5D3KBG.js +37 -0
- package/dist/chunk-AB5D3KBG.js.map +1 -0
- package/dist/{chunk-YX6CNVJA.js → chunk-CPA5CF35.js} +1 -1
- package/dist/chunk-CPA5CF35.js.map +1 -0
- package/dist/chunk-K3SWZXYT.js +92 -0
- package/dist/chunk-K3SWZXYT.js.map +1 -0
- package/dist/{chunk-XUMJA5ZI.js → chunk-X6TW3X6Y.js} +2 -2
- package/dist/chunk-XCBVFMNV.js +41 -0
- package/dist/{chunk-YX6CNVJA.js.map → chunk-XCBVFMNV.js.map} +1 -1
- package/dist/chunk-XVLWVTQA.js +28 -0
- package/dist/chunk-XVLWVTQA.js.map +1 -0
- package/dist/chunk-Z6FUPB3Q.js +102 -0
- package/dist/chunk-Z6FUPB3Q.js.map +1 -0
- package/dist/code-block.d.ts +42 -0
- package/dist/code-block.js +202 -0
- package/dist/code-block.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cta-panel.d.ts +23 -0
- package/dist/cta-panel.js +20 -0
- package/dist/cta-panel.js.map +1 -0
- package/dist/data-table.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.d.ts +34 -0
- package/dist/decision-list.js +67 -0
- package/dist/decision-list.js.map +1 -0
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/link-card.d.ts +35 -0
- package/dist/link-card.js +46 -0
- package/dist/link-card.js.map +1 -0
- package/dist/mascot-quote.d.ts +42 -0
- package/dist/mascot-quote.js +267 -0
- package/dist/mascot-quote.js.map +1 -0
- package/dist/media-capture.js +1 -1
- package/dist/motion.css +25 -1
- package/dist/page-hero.d.ts +44 -0
- package/dist/page-hero.js +41 -0
- package/dist/page-hero.js.map +1 -0
- package/dist/page.d.ts +116 -0
- package/dist/page.js +17 -0
- package/dist/page.js.map +1 -0
- package/dist/pagination.js +25 -44
- package/dist/pagination.js.map +1 -1
- package/dist/pointer-light.d.ts +20 -0
- package/dist/pointer-light.js +12 -0
- package/dist/pointer-light.js.map +1 -0
- package/dist/search-field.js +1 -1
- package/dist/section-backdrop.js +4 -22
- package/dist/section-backdrop.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/terminal-replay.d.ts +68 -0
- package/dist/terminal-replay.js +231 -0
- package/dist/terminal-replay.js.map +1 -0
- package/dist/toc.d.ts +23 -0
- package/dist/toc.js +39 -0
- package/dist/toc.js.map +1 -0
- package/dist/video-player.js +1 -1
- package/package.json +192 -7
- package/registry/action-bar.json +205 -0
- package/registry/alert.json +1 -1
- package/registry/argument-card.json +327 -0
- package/registry/audio-player.json +2 -2
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +221 -0
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/code-block.json +262 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +154 -0
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +144 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/action-bar/buttons.d.ts +4 -0
- package/registry/examples/action-bar/buttons.js +22 -0
- package/registry/examples/action-bar/buttons.tsx +17 -0
- package/registry/examples/action-bar/icons.d.ts +4 -0
- package/registry/examples/action-bar/icons.js +24 -0
- package/registry/examples/action-bar/icons.tsx +23 -0
- package/registry/examples/argument-card/building-block.d.ts +4 -0
- package/registry/examples/argument-card/building-block.js +29 -0
- package/registry/examples/argument-card/building-block.tsx +29 -0
- package/registry/examples/argument-card/grid.d.ts +4 -0
- package/registry/examples/argument-card/grid.js +17 -0
- package/registry/examples/argument-card/grid.tsx +19 -0
- package/registry/examples/argument-card/unfold.d.ts +4 -0
- package/registry/examples/argument-card/unfold.js +26 -0
- package/registry/examples/argument-card/unfold.tsx +21 -0
- package/registry/examples/card-grid/products.d.ts +4 -0
- package/registry/examples/card-grid/products.js +16 -0
- package/registry/examples/card-grid/products.tsx +13 -0
- package/registry/examples/card-grid/reveal.d.ts +4 -0
- package/registry/examples/card-grid/reveal.js +13 -0
- package/registry/examples/card-grid/reveal.tsx +16 -0
- package/registry/examples/code-block/build-tools.d.ts +4 -0
- package/registry/examples/code-block/build-tools.js +30 -0
- package/registry/examples/code-block/build-tools.tsx +25 -0
- package/registry/examples/code-block/file.d.ts +4 -0
- package/registry/examples/code-block/file.js +17 -0
- package/registry/examples/code-block/file.tsx +13 -0
- package/registry/examples/cta-panel/discuss.d.ts +4 -0
- package/registry/examples/cta-panel/discuss.js +31 -0
- package/registry/examples/cta-panel/discuss.tsx +23 -0
- package/registry/examples/decision-list/product.d.ts +4 -0
- package/registry/examples/decision-list/product.js +35 -0
- package/registry/examples/decision-list/product.tsx +30 -0
- package/registry/examples/link-card/docs-hub.d.ts +4 -0
- package/registry/examples/link-card/docs-hub.js +18 -0
- package/registry/examples/link-card/docs-hub.tsx +20 -0
- package/registry/examples/link-card/external.d.ts +4 -0
- package/registry/examples/link-card/external.js +22 -0
- package/registry/examples/link-card/external.tsx +16 -0
- package/registry/examples/link-card/stack.d.ts +4 -0
- package/registry/examples/link-card/stack.js +26 -0
- package/registry/examples/link-card/stack.tsx +21 -0
- package/registry/examples/mascot-quote/callout.d.ts +4 -0
- package/registry/examples/mascot-quote/callout.js +11 -0
- package/registry/examples/mascot-quote/callout.tsx +10 -0
- package/registry/examples/mascot-quote/inline.d.ts +4 -0
- package/registry/examples/mascot-quote/inline.js +11 -0
- package/registry/examples/mascot-quote/inline.tsx +10 -0
- package/registry/examples/page/backdrop.d.ts +4 -0
- package/registry/examples/page/backdrop.js +23 -0
- package/registry/examples/page/backdrop.tsx +18 -0
- package/registry/examples/page/facts.d.ts +4 -0
- package/registry/examples/page/facts.js +24 -0
- package/registry/examples/page/facts.tsx +21 -0
- package/registry/examples/page/frame.d.ts +4 -0
- package/registry/examples/page/frame.js +15 -0
- package/registry/examples/page/frame.tsx +17 -0
- package/registry/examples/page/sections.d.ts +4 -0
- package/registry/examples/page/sections.js +14 -0
- package/registry/examples/page/sections.tsx +15 -0
- package/registry/examples/page-hero/building-block.d.ts +4 -0
- package/registry/examples/page-hero/building-block.js +24 -0
- package/registry/examples/page-hero/building-block.tsx +20 -0
- package/registry/examples/page-hero/hub.d.ts +4 -0
- package/registry/examples/page-hero/hub.js +21 -0
- package/registry/examples/page-hero/hub.tsx +15 -0
- package/registry/examples/pointer-light/list.d.ts +4 -0
- package/registry/examples/pointer-light/list.js +16 -0
- package/registry/examples/pointer-light/list.tsx +14 -0
- package/registry/examples/terminal-replay/at-rest.d.ts +4 -0
- package/registry/examples/terminal-replay/at-rest.js +32 -0
- package/registry/examples/terminal-replay/at-rest.tsx +26 -0
- package/registry/examples/terminal-replay/session.d.ts +4 -0
- package/registry/examples/terminal-replay/session.js +34 -0
- package/registry/examples/terminal-replay/session.tsx +28 -0
- package/registry/examples/toc/reading-page.d.ts +4 -0
- package/registry/examples/toc/reading-page.js +21 -0
- package/registry/examples/toc/reading-page.tsx +21 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +2 -2
- package/registry/glow-card.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +241 -1
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/link-card.json +279 -0
- package/registry/loader.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +191 -0
- package/registry/mascots.json +1 -1
- package/registry/media-capture.json +4 -4
- 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 +254 -0
- package/registry/page.json +497 -0
- package/registry/pagination.json +2 -2
- package/registry/pointer-light.json +119 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +3 -3
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/stat.json +1 -1
- 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 +317 -0
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +157 -0
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +4 -4
- package/registry/video-trimmer.json +3 -3
- /package/dist/{chunk-XUMJA5ZI.js.map → chunk-X6TW3X6Y.js.map} +0 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "page",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Page",
|
|
5
|
+
"summary": "The frame of every page: one width (`--kz-page-max`), one pair of gutters, one vertical rhythm — `Page`, `Section` (full-bleed, its heading, a hairline or the brand's backdrop as transition) and `SectionHeading`, with `Facts` and `Ticks`.",
|
|
6
|
+
"description": "The frame of every page: one width (`--kz-page-max`), one pair of gutters, one vertical rhythm — `Page`, `Section` (full-bleed, its heading, a hairline or the brand's backdrop as transition) and `SectionHeading`, with `Facts` and `Ticks`.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "blocks",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"Around every block of a site's page, so the navigation, the hero and each section share the same edges at any width.",
|
|
12
|
+
"To chain the sections of a page on one rhythm: `divider` for a transition on the same surface, `backdrop` for the brand's colour transition.",
|
|
13
|
+
"`Facts` for a few honest facts under a title (registry and version, a status in progress); `Ticks` for a translated sentence with code in it."
|
|
14
|
+
],
|
|
15
|
+
"whenNotToUse": [
|
|
16
|
+
{
|
|
17
|
+
"when": "Inside an app's screen, under its own shell: the app's layout already frames its content.",
|
|
18
|
+
"use": "page-header"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"when": "To frame one item on a page.",
|
|
22
|
+
"use": "card"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"bestPractices": [
|
|
26
|
+
"Import the blocks' stylesheet once, by package path, in the app's root layout: `import \"@krizaka/ui/blocks.css\"`.",
|
|
27
|
+
"One frame per site: set `--kz-page-max` once (72rem by default) and give the navigation the same width.",
|
|
28
|
+
"`size=\"narrow\"` for a column of text, `wide` for documentation with a sidebar — never a width of your own.",
|
|
29
|
+
"Give every titled section an `id`: it is its anchor and, through `aria-labelledby`, its name.",
|
|
30
|
+
"`reveal` on headings below the first screen only: what the visitor sees on arrival is painted at once."
|
|
31
|
+
],
|
|
32
|
+
"accessibility": {
|
|
33
|
+
"keyboard": [],
|
|
34
|
+
"notes": [
|
|
35
|
+
"A `Section` with a title is a `section` named by its heading (`aria-labelledby`); without one it is a plain region of the page.",
|
|
36
|
+
"`SectionHeading` renders a real `h2` (or `h3`): keep the outline in order — one `h1` per page, in the hero.",
|
|
37
|
+
"`Facts` is a list; a fact with `href` opens in a new tab. `Ticks` renders `code` elements, read as text."
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"related": [
|
|
41
|
+
"page-hero",
|
|
42
|
+
"section-backdrop",
|
|
43
|
+
"card-grid"
|
|
44
|
+
],
|
|
45
|
+
"web": {
|
|
46
|
+
"entry": "@krizaka/ui/page",
|
|
47
|
+
"import": "import { Page, Section, SectionHeading, Facts, Ticks } from \"@krizaka/ui/page\";",
|
|
48
|
+
"props": [
|
|
49
|
+
{
|
|
50
|
+
"component": "Facts",
|
|
51
|
+
"description": "Compact facts on one line — a dot that says the state, a few mono words. Links open in a new tab.",
|
|
52
|
+
"props": [
|
|
53
|
+
{
|
|
54
|
+
"name": "items",
|
|
55
|
+
"type": "readonly Fact[]",
|
|
56
|
+
"default": null,
|
|
57
|
+
"description": "The facts, in reading order.",
|
|
58
|
+
"required": true
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"component": "Page",
|
|
64
|
+
"description": "The page frame: centred, at most `--kz-page-max` wide, with the gutters of `--kz-page-gutter` (16 → 32 px).",
|
|
65
|
+
"props": [
|
|
66
|
+
{
|
|
67
|
+
"name": "as",
|
|
68
|
+
"type": "\"article\" | \"main\" | \"div\" | \"footer\" | \"header\" | \"section\"",
|
|
69
|
+
"default": "div",
|
|
70
|
+
"description": "The element: `div` (default), `main`, `header`, `footer`, `section` or `article`.",
|
|
71
|
+
"required": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "size",
|
|
75
|
+
"type": "PageSize",
|
|
76
|
+
"default": "default",
|
|
77
|
+
"description": "The width of the content: `default` (72rem, `--kz-page-max`), `narrow` (48rem, a reading column), `wide`\n(88rem, documentation with a sidebar), `full` (the gutters only).",
|
|
78
|
+
"required": false
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"component": "Section",
|
|
84
|
+
"description": "A section of a page: full-bleed (its backdrop reaches the edges), its content in the page frame, its heading on top.\nSections follow each other on one rhythm; a `divider` or a `backdrop` marks the transition.",
|
|
85
|
+
"props": [
|
|
86
|
+
{
|
|
87
|
+
"name": "actions",
|
|
88
|
+
"type": "ReactNode",
|
|
89
|
+
"default": null,
|
|
90
|
+
"description": "The heading's actions.",
|
|
91
|
+
"required": false
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "backdrop",
|
|
95
|
+
"type": "boolean | Omit<SectionBackdropProps, \"children\" | \"as\">",
|
|
96
|
+
"default": null,
|
|
97
|
+
"description": "The brand's colour transition behind the section (SectionBackdrop): `true`, or its props (`direction`, `grid`…).",
|
|
98
|
+
"required": false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "divider",
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"default": null,
|
|
104
|
+
"description": "A hairline above the section, inside the gutters: the transition between two sections of the same surface.",
|
|
105
|
+
"required": false
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "eyebrow",
|
|
109
|
+
"type": "ReactNode",
|
|
110
|
+
"default": null,
|
|
111
|
+
"description": "The heading's eyebrow.",
|
|
112
|
+
"required": false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "headingAlign",
|
|
116
|
+
"type": "\"center\" | \"start\"",
|
|
117
|
+
"default": "start",
|
|
118
|
+
"description": "The heading's alignment.",
|
|
119
|
+
"required": false
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "headingSize",
|
|
123
|
+
"type": "\"sm\" | \"md\"",
|
|
124
|
+
"default": "md",
|
|
125
|
+
"description": "The heading's size: `md` for a page that argues, `sm` for a reading page.",
|
|
126
|
+
"required": false
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "lead",
|
|
130
|
+
"type": "ReactNode",
|
|
131
|
+
"default": null,
|
|
132
|
+
"description": "The heading's lead.",
|
|
133
|
+
"required": false
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "reveal",
|
|
137
|
+
"type": "boolean",
|
|
138
|
+
"default": null,
|
|
139
|
+
"description": "The heading rises into place once (never on the first screen).",
|
|
140
|
+
"required": false
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "size",
|
|
144
|
+
"type": "PageSize",
|
|
145
|
+
"default": "default",
|
|
146
|
+
"description": "The width of the content.",
|
|
147
|
+
"required": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "spacing",
|
|
151
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
152
|
+
"default": "md",
|
|
153
|
+
"description": "The vertical space above and below: `sm` (a reading page), `md`, `lg` (a page's main moments).",
|
|
154
|
+
"required": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "title",
|
|
158
|
+
"type": "ReactNode",
|
|
159
|
+
"default": null,
|
|
160
|
+
"description": "The section's title: an `h2` (a `SectionHeading`), which names the section for assistive technology.",
|
|
161
|
+
"required": false
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"component": "SectionHeading",
|
|
167
|
+
"description": "The head of a section: eyebrow (mono, the accent), title, lead — and its actions on the right.",
|
|
168
|
+
"props": [
|
|
169
|
+
{
|
|
170
|
+
"name": "title",
|
|
171
|
+
"type": "ReactNode",
|
|
172
|
+
"default": null,
|
|
173
|
+
"description": "The title.",
|
|
174
|
+
"required": true
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "actions",
|
|
178
|
+
"type": "ReactNode",
|
|
179
|
+
"default": null,
|
|
180
|
+
"description": "Actions on the right of the heading (a link to everything, a filter).",
|
|
181
|
+
"required": false
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "align",
|
|
185
|
+
"type": "\"center\" | \"start\"",
|
|
186
|
+
"default": "start",
|
|
187
|
+
"description": "`center` for a heading that stands alone above a grid.",
|
|
188
|
+
"required": false
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "eyebrow",
|
|
192
|
+
"type": "ReactNode",
|
|
193
|
+
"default": null,
|
|
194
|
+
"description": "A short mono line above the title (the section's subject).",
|
|
195
|
+
"required": false
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "lead",
|
|
199
|
+
"type": "ReactNode",
|
|
200
|
+
"default": null,
|
|
201
|
+
"description": "One or two sentences under the title.",
|
|
202
|
+
"required": false
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "level",
|
|
206
|
+
"type": "2 | 3",
|
|
207
|
+
"default": "2",
|
|
208
|
+
"description": "The level of the title.",
|
|
209
|
+
"required": false
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "reveal",
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"default": null,
|
|
215
|
+
"description": "Rises into place once, as it enters the viewport (`[data-reveal]`, MotionObserver). Never on the first screen.",
|
|
216
|
+
"required": false
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "size",
|
|
220
|
+
"type": "\"sm\" | \"md\"",
|
|
221
|
+
"default": "md",
|
|
222
|
+
"description": "`md` for a section that argues, `sm` for a section of a reading page.",
|
|
223
|
+
"required": false
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"component": "Ticks",
|
|
229
|
+
"description": "A sentence of a message catalogue where words between backticks read as code — no markup in the translations.",
|
|
230
|
+
"props": [
|
|
231
|
+
{
|
|
232
|
+
"name": "children",
|
|
233
|
+
"type": "string",
|
|
234
|
+
"default": null,
|
|
235
|
+
"description": "A sentence where words between backticks are code: \"Every request carries a `requestId`.\"",
|
|
236
|
+
"required": true
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"examples": [
|
|
242
|
+
{
|
|
243
|
+
"name": "sections",
|
|
244
|
+
"title": "Sections",
|
|
245
|
+
"description": "Two sections on one rhythm, a hairline between them (`divider`).",
|
|
246
|
+
"path": "examples/page/sections.tsx",
|
|
247
|
+
"module": "@krizaka/ui/registry/examples/page/sections",
|
|
248
|
+
"code": "import { Section } from \"@krizaka/ui/page\";\n\n// Sections on one rhythm, in one frame: the same edges at every width. The hairline (`divider`) is the transition.\nexport default function PageSections() {\n return (\n <div className=\"w-full\">\n <Section id=\"why\" eyebrow=\"Why\" title=\"Nothing leaves your servers\" lead=\"Inference runs on your hardware; nothing calls home.\" spacing=\"sm\">\n <p className=\"text-sm text-fg-secondary\">Local models by default, one governed pipeline, zero telemetry.</p>\n </Section>\n <Section id=\"how\" eyebrow=\"How\" title=\"One pipeline, every request\" spacing=\"sm\" divider>\n <p className=\"text-sm text-fg-secondary\">Every request crosses the same interceptors, in the same order.</p>\n </Section>\n </div>\n );\n}\n"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "backdrop",
|
|
252
|
+
"title": "Section on the brand's backdrop",
|
|
253
|
+
"description": "`backdrop`: the colour transition behind a closing call, the actions on the right of the heading.",
|
|
254
|
+
"path": "examples/page/backdrop.tsx",
|
|
255
|
+
"module": "@krizaka/ui/registry/examples/page/backdrop",
|
|
256
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { Section } from \"@krizaka/ui/page\";\n\n// `backdrop`: the brand's colour transition behind a section (SectionBackdrop) — a closing call, the page's main moment.\n// `actions` sit on the right of the heading (under it on a phone).\nexport default function PageBackdrop() {\n return (\n <Section\n id=\"get-started\"\n className=\"w-full\"\n backdrop={{ direction: \"up\" }}\n eyebrow=\"Get started\"\n title=\"Install it in four lines\"\n lead=\"Tokens, the Tailwind preset and the primitives — one version for the three.\"\n actions={<Button variant=\"primary\">Read the guide</Button>}\n />\n );\n}\n"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "frame",
|
|
260
|
+
"title": "The frame alone",
|
|
261
|
+
"description": "`Page` in its three widths: narrow, default, wide.",
|
|
262
|
+
"path": "examples/page/frame.tsx",
|
|
263
|
+
"module": "@krizaka/ui/registry/examples/page/frame",
|
|
264
|
+
"code": "import { Page } from \"@krizaka/ui/page\";\n\n// `Page` alone: the frame of a custom layout — centred, at most `--kz-page-max` wide, the gutters of the site.\n// `narrow` for a reading column, `wide` for documentation with a sidebar.\nexport default function PageFrame() {\n return (\n <div className=\"grid w-full gap-3\">\n {([\"narrow\", \"default\", \"wide\"] as const).map((size) => (\n <Page key={size} size={size}>\n <div className=\"rounded-lg border border-dashed border-border-strong bg-surface-1 px-4 py-3 font-mono text-xs text-fg-secondary\">\n size="{size}"\n </div>\n </Page>\n ))}\n </div>\n );\n}\n"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "facts",
|
|
268
|
+
"title": "Facts and ticks",
|
|
269
|
+
"description": "Honest facts under a title, and a sentence where backticks read as code.",
|
|
270
|
+
"path": "examples/page/facts.tsx",
|
|
271
|
+
"module": "@krizaka/ui/registry/examples/page/facts",
|
|
272
|
+
"code": "import { Facts, Ticks } from \"@krizaka/ui/page\";\n\n// `Facts`: a few mono words that say a state (published, in progress — said honestly). `Ticks`: a sentence from a\n// message catalogue where words between backticks read as code.\nexport default function PageFacts() {\n return (\n <div className=\"grid max-w-xl gap-4\">\n <Facts\n aria-label=\"Status\"\n items={[\n { label: \"Maven Central 0.1.0\", tone: \"ok\", href: \"https://central.sonatype.com/namespace/com.krizaka\" },\n { label: \"Apache-2.0\" },\n { label: \"Gradle plugin — in progress\", tone: \"wip\" },\n ]}\n />\n <p className=\"text-sm text-fg-secondary\">\n <Ticks>{\"Every request carries a `requestId`; a failed message lands in `.dlq`, never lost.\"}</Ticks>\n </p>\n </div>\n );\n}\n"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
"native": null,
|
|
277
|
+
"files": [
|
|
278
|
+
{
|
|
279
|
+
"path": "meta.ts",
|
|
280
|
+
"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 | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\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 | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\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 */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"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\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"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"path": "page/index.ts",
|
|
284
|
+
"content": "/** @krizaka/ui/page — the page frame: `Page` (width, gutters), `Section` (+ `SectionHeading`), `Facts`, `Ticks`. Server-safe. */\nexport { type Fact, Facts, type FactsProps, Page, type PageProps, type PageSize, Section, SectionHeading, type SectionHeadingProps, type SectionProps, Ticks, type TicksProps } from \"./page\";\n"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"path": "page/meta.ts",
|
|
288
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Page\",\n summary:\n \"The frame of every page: one width (`--kz-page-max`), one pair of gutters, one vertical rhythm — `Page`, `Section` (full-bleed, its heading, a hairline or the brand's backdrop as transition) and `SectionHeading`, with `Facts` and `Ticks`.\",\n status: \"beta\",\n category: \"blocks\",\n platforms: \"web\",\n whenToUse: [\n \"Around every block of a site's page, so the navigation, the hero and each section share the same edges at any width.\",\n \"To chain the sections of a page on one rhythm: `divider` for a transition on the same surface, `backdrop` for the brand's colour transition.\",\n \"`Facts` for a few honest facts under a title (registry and version, a status in progress); `Ticks` for a translated sentence with code in it.\",\n ],\n whenNotToUse: [\n { when: \"Inside an app's screen, under its own shell: the app's layout already frames its content.\", use: \"page-header\" },\n { when: \"To frame one item on a page.\", use: \"card\" },\n ],\n bestPractices: [\n \"Import the blocks' stylesheet once, by package path, in the app's root layout: `import \\\"@krizaka/ui/blocks.css\\\"`.\",\n \"One frame per site: set `--kz-page-max` once (72rem by default) and give the navigation the same width.\",\n \"`size=\\\"narrow\\\"` for a column of text, `wide` for documentation with a sidebar — never a width of your own.\",\n \"Give every titled section an `id`: it is its anchor and, through `aria-labelledby`, its name.\",\n \"`reveal` on headings below the first screen only: what the visitor sees on arrival is painted at once.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"A `Section` with a title is a `section` named by its heading (`aria-labelledby`); without one it is a plain region of the page.\",\n \"`SectionHeading` renders a real `h2` (or `h3`): keep the outline in order — one `h1` per page, in the hero.\",\n \"`Facts` is a list; a fact with `href` opens in a new tab. `Ticks` renders `code` elements, read as text.\",\n ],\n },\n related: [\"page-hero\", \"section-backdrop\", \"card-grid\"],\n web: {\n imports: [\"Page\", \"Section\", \"SectionHeading\", \"Facts\", \"Ticks\"],\n examples: [\n { name: \"sections\", title: \"Sections\", description: \"Two sections on one rhythm, a hairline between them (`divider`).\" },\n { name: \"backdrop\", title: \"Section on the brand's backdrop\", description: \"`backdrop`: the colour transition behind a closing call, the actions on the right of the heading.\" },\n { name: \"frame\", title: \"The frame alone\", description: \"`Page` in its three widths: narrow, default, wide.\" },\n { name: \"facts\", title: \"Facts and ticks\", description: \"Honest facts under a title, and a sentence where backticks read as code.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"path": "page/page.tsx",
|
|
292
|
+
"content": "// Server-safe. The frame of every page (blocks.css): one width, one pair of gutters, one vertical rhythm — so the\n// navigation, the hero and every section line up on the same edges, at any width.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { SectionBackdrop, type SectionBackdropProps } from \"../section-backdrop/section-backdrop\";\n\nexport type PageSize = \"narrow\" | \"default\" | \"wide\" | \"full\";\n\nexport type PageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The width of the content: `default` (72rem, `--kz-page-max`), `narrow` (48rem, a reading column), `wide`\n * (88rem, documentation with a sidebar), `full` (the gutters only).\n * @default \"default\"\n */\n size?: PageSize;\n /** The element: `div` (default), `main`, `header`, `footer`, `section` or `article`. */\n as?: \"div\" | \"main\" | \"header\" | \"footer\" | \"section\" | \"article\";\n};\n\n/** The page frame: centred, at most `--kz-page-max` wide, with the gutters of `--kz-page-gutter` (16 → 32 px). */\nexport function Page({ size = \"default\", as: Tag = \"div\", className, ...props }: PageProps) {\n return <Tag data-size={size === \"default\" ? undefined : size} className={cn(\"kz-frame\", className)} {...props} />;\n}\n\nexport type SectionHeadingProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** The id of the title: the section's anchor and its accessible name. */\n id?: string;\n /** A short mono line above the title (the section's subject). */\n eyebrow?: React.ReactNode;\n /** The title. */\n title: React.ReactNode;\n /** One or two sentences under the title. */\n lead?: React.ReactNode;\n /** Actions on the right of the heading (a link to everything, a filter). */\n actions?: React.ReactNode;\n /**\n * The level of the title.\n * @default 2\n */\n level?: 2 | 3;\n /**\n * `md` for a section that argues, `sm` for a section of a reading page.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\";\n /**\n * `center` for a heading that stands alone above a grid.\n * @default \"start\"\n */\n align?: \"start\" | \"center\";\n /** Rises into place once, as it enters the viewport (`[data-reveal]`, MotionObserver). Never on the first screen. */\n reveal?: boolean;\n};\n\n/** The head of a section: eyebrow (mono, the accent), title, lead — and its actions on the right. */\nexport function SectionHeading({ id, eyebrow, title, lead, actions, level = 2, size = \"md\", align = \"start\", reveal, className, ...props }: SectionHeadingProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n return (\n <div\n className={cn(\"kz-heading\", className)}\n data-size={size === \"md\" ? undefined : size}\n data-align={align === \"start\" ? undefined : align}\n data-actions={actions ? \"\" : undefined}\n data-reveal={reveal ? \"\" : undefined}\n {...props}\n >\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <H id={id} className=\"kz-heading-title\">\n {title}\n </H>\n {lead && <p className=\"kz-heading-lead\">{lead}</p>}\n {actions && <div className=\"kz-heading-actions\">{actions}</div>}\n </div>\n );\n}\n\nexport type SectionProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The id of the title (and the anchor of the section). Required with a `title`. */\n id?: string;\n /** The heading's eyebrow. */\n eyebrow?: React.ReactNode;\n /** The section's title: an `h2` (a `SectionHeading`), which names the section for assistive technology. */\n title?: React.ReactNode;\n /** The heading's lead. */\n lead?: React.ReactNode;\n /** The heading's actions. */\n actions?: React.ReactNode;\n /**\n * The heading's size: `md` for a page that argues, `sm` for a reading page.\n * @default \"md\"\n */\n headingSize?: \"sm\" | \"md\";\n /**\n * The heading's alignment.\n * @default \"start\"\n */\n headingAlign?: \"start\" | \"center\";\n /** The heading rises into place once (never on the first screen). */\n reveal?: boolean;\n /** A hairline above the section, inside the gutters: the transition between two sections of the same surface. */\n divider?: boolean;\n /**\n * The vertical space above and below: `sm` (a reading page), `md`, `lg` (a page's main moments).\n * @default \"md\"\n */\n spacing?: \"sm\" | \"md\" | \"lg\";\n /**\n * The width of the content.\n * @default \"default\"\n */\n size?: PageSize;\n /** The brand's colour transition behind the section (SectionBackdrop): `true`, or its props (`direction`, `grid`…). */\n backdrop?: boolean | Omit<SectionBackdropProps, \"as\" | \"children\">;\n};\n\n/**\n * A section of a page: full-bleed (its backdrop reaches the edges), its content in the page frame, its heading on top.\n * Sections follow each other on one rhythm; a `divider` or a `backdrop` marks the transition.\n */\nexport function Section({\n id,\n eyebrow,\n title,\n lead,\n actions,\n headingSize,\n headingAlign,\n reveal,\n divider,\n spacing = \"md\",\n size,\n backdrop,\n className,\n children,\n ...props\n}: SectionProps) {\n const body = (\n <Page size={size}>\n {title && <SectionHeading id={id} eyebrow={eyebrow} title={title} lead={lead} actions={actions} size={headingSize} align={headingAlign} reveal={reveal} />}\n {children}\n </Page>\n );\n const shared = {\n \"aria-labelledby\": title && id ? id : undefined,\n \"data-divider\": divider ? \"\" : undefined,\n \"data-spacing\": spacing === \"md\" ? undefined : spacing,\n ...props,\n };\n if (backdrop) {\n const backdropProps = backdrop === true ? {} : backdrop;\n return (\n <SectionBackdrop {...backdropProps} {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </SectionBackdrop>\n );\n }\n return (\n <section {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </section>\n );\n}\n\nexport type TicksProps = {\n /** A sentence where words between backticks are code: \"Every request carries a `requestId`.\" */\n children: string;\n};\n\n/** A sentence of a message catalogue where words between backticks read as code — no markup in the translations. */\nexport function Ticks({ children }: TicksProps) {\n const parts = children.split(\"`\");\n return (\n <>\n {parts.map((part, i) =>\n i % 2 ? (\n <code key={i} className=\"kz-ic\">\n {part}\n </code>\n ) : (\n <React.Fragment key={i}>{part}</React.Fragment>\n ),\n )}\n </>\n );\n}\n\nexport interface Fact {\n /** A few words: `npm 2.5.0`, `Maven Central`, `in progress`. */\n label: string;\n /**\n * `ok` — published, usable today; `wip` — in progress, said honestly; `neutral` — a fact.\n * @default \"neutral\"\n */\n tone?: \"ok\" | \"wip\" | \"neutral\";\n /** Where the fact is proven (a registry page): the fact becomes a link. */\n href?: string;\n}\n\nexport type FactsProps = React.HTMLAttributes<HTMLUListElement> & {\n /** The facts, in reading order. */\n items: readonly Fact[];\n};\n\n/** Compact facts on one line — a dot that says the state, a few mono words. Links open in a new tab. */\nexport function Facts({ items, className, ...props }: FactsProps) {\n return (\n <ul className={cn(\"kz-facts\", className)} {...props}>\n {items.map((fact) => {\n const body = (\n <>\n <span className=\"kz-fact-dot\" aria-hidden /> {fact.label}\n </>\n );\n const tone = fact.tone && fact.tone !== \"neutral\" ? fact.tone : undefined;\n return (\n <li key={fact.label}>\n {fact.href ? (\n <a href={fact.href} target=\"_blank\" rel=\"noopener noreferrer\" className=\"kz-fact\" data-tone={tone}>\n {body}\n </a>\n ) : (\n <span className=\"kz-fact\" data-tone={tone}>\n {body}\n </span>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
"dependencies": [],
|
|
296
|
+
"registryDependencies": [
|
|
297
|
+
"cn",
|
|
298
|
+
"section-backdrop"
|
|
299
|
+
],
|
|
300
|
+
"demo": {
|
|
301
|
+
"path": "examples/page/sections.tsx",
|
|
302
|
+
"content": "import { Section } from \"@krizaka/ui/page\";\n\n// Sections on one rhythm, in one frame: the same edges at every width. The hairline (`divider`) is the transition.\nexport default function PageSections() {\n return (\n <div className=\"w-full\">\n <Section id=\"why\" eyebrow=\"Why\" title=\"Nothing leaves your servers\" lead=\"Inference runs on your hardware; nothing calls home.\" spacing=\"sm\">\n <p className=\"text-sm text-fg-secondary\">Local models by default, one governed pipeline, zero telemetry.</p>\n </Section>\n <Section id=\"how\" eyebrow=\"How\" title=\"One pipeline, every request\" spacing=\"sm\" divider>\n <p className=\"text-sm text-fg-secondary\">Every request crosses the same interceptors, in the same order.</p>\n </Section>\n </div>\n );\n}\n"
|
|
303
|
+
},
|
|
304
|
+
"props": [
|
|
305
|
+
{
|
|
306
|
+
"component": "Facts",
|
|
307
|
+
"description": "Compact facts on one line — a dot that says the state, a few mono words. Links open in a new tab.",
|
|
308
|
+
"props": [
|
|
309
|
+
{
|
|
310
|
+
"name": "items",
|
|
311
|
+
"type": "readonly Fact[]",
|
|
312
|
+
"default": null,
|
|
313
|
+
"description": "The facts, in reading order.",
|
|
314
|
+
"required": true
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"component": "Page",
|
|
320
|
+
"description": "The page frame: centred, at most `--kz-page-max` wide, with the gutters of `--kz-page-gutter` (16 → 32 px).",
|
|
321
|
+
"props": [
|
|
322
|
+
{
|
|
323
|
+
"name": "as",
|
|
324
|
+
"type": "\"article\" | \"main\" | \"div\" | \"footer\" | \"header\" | \"section\"",
|
|
325
|
+
"default": "div",
|
|
326
|
+
"description": "The element: `div` (default), `main`, `header`, `footer`, `section` or `article`.",
|
|
327
|
+
"required": false
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "size",
|
|
331
|
+
"type": "PageSize",
|
|
332
|
+
"default": "default",
|
|
333
|
+
"description": "The width of the content: `default` (72rem, `--kz-page-max`), `narrow` (48rem, a reading column), `wide`\n(88rem, documentation with a sidebar), `full` (the gutters only).",
|
|
334
|
+
"required": false
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"component": "Section",
|
|
340
|
+
"description": "A section of a page: full-bleed (its backdrop reaches the edges), its content in the page frame, its heading on top.\nSections follow each other on one rhythm; a `divider` or a `backdrop` marks the transition.",
|
|
341
|
+
"props": [
|
|
342
|
+
{
|
|
343
|
+
"name": "actions",
|
|
344
|
+
"type": "ReactNode",
|
|
345
|
+
"default": null,
|
|
346
|
+
"description": "The heading's actions.",
|
|
347
|
+
"required": false
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "backdrop",
|
|
351
|
+
"type": "boolean | Omit<SectionBackdropProps, \"children\" | \"as\">",
|
|
352
|
+
"default": null,
|
|
353
|
+
"description": "The brand's colour transition behind the section (SectionBackdrop): `true`, or its props (`direction`, `grid`…).",
|
|
354
|
+
"required": false
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "divider",
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"default": null,
|
|
360
|
+
"description": "A hairline above the section, inside the gutters: the transition between two sections of the same surface.",
|
|
361
|
+
"required": false
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "eyebrow",
|
|
365
|
+
"type": "ReactNode",
|
|
366
|
+
"default": null,
|
|
367
|
+
"description": "The heading's eyebrow.",
|
|
368
|
+
"required": false
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "headingAlign",
|
|
372
|
+
"type": "\"center\" | \"start\"",
|
|
373
|
+
"default": "start",
|
|
374
|
+
"description": "The heading's alignment.",
|
|
375
|
+
"required": false
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "headingSize",
|
|
379
|
+
"type": "\"sm\" | \"md\"",
|
|
380
|
+
"default": "md",
|
|
381
|
+
"description": "The heading's size: `md` for a page that argues, `sm` for a reading page.",
|
|
382
|
+
"required": false
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"name": "lead",
|
|
386
|
+
"type": "ReactNode",
|
|
387
|
+
"default": null,
|
|
388
|
+
"description": "The heading's lead.",
|
|
389
|
+
"required": false
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"name": "reveal",
|
|
393
|
+
"type": "boolean",
|
|
394
|
+
"default": null,
|
|
395
|
+
"description": "The heading rises into place once (never on the first screen).",
|
|
396
|
+
"required": false
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "size",
|
|
400
|
+
"type": "PageSize",
|
|
401
|
+
"default": "default",
|
|
402
|
+
"description": "The width of the content.",
|
|
403
|
+
"required": false
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "spacing",
|
|
407
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
408
|
+
"default": "md",
|
|
409
|
+
"description": "The vertical space above and below: `sm` (a reading page), `md`, `lg` (a page's main moments).",
|
|
410
|
+
"required": false
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "title",
|
|
414
|
+
"type": "ReactNode",
|
|
415
|
+
"default": null,
|
|
416
|
+
"description": "The section's title: an `h2` (a `SectionHeading`), which names the section for assistive technology.",
|
|
417
|
+
"required": false
|
|
418
|
+
}
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"component": "SectionHeading",
|
|
423
|
+
"description": "The head of a section: eyebrow (mono, the accent), title, lead — and its actions on the right.",
|
|
424
|
+
"props": [
|
|
425
|
+
{
|
|
426
|
+
"name": "title",
|
|
427
|
+
"type": "ReactNode",
|
|
428
|
+
"default": null,
|
|
429
|
+
"description": "The title.",
|
|
430
|
+
"required": true
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "actions",
|
|
434
|
+
"type": "ReactNode",
|
|
435
|
+
"default": null,
|
|
436
|
+
"description": "Actions on the right of the heading (a link to everything, a filter).",
|
|
437
|
+
"required": false
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "align",
|
|
441
|
+
"type": "\"center\" | \"start\"",
|
|
442
|
+
"default": "start",
|
|
443
|
+
"description": "`center` for a heading that stands alone above a grid.",
|
|
444
|
+
"required": false
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "eyebrow",
|
|
448
|
+
"type": "ReactNode",
|
|
449
|
+
"default": null,
|
|
450
|
+
"description": "A short mono line above the title (the section's subject).",
|
|
451
|
+
"required": false
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "lead",
|
|
455
|
+
"type": "ReactNode",
|
|
456
|
+
"default": null,
|
|
457
|
+
"description": "One or two sentences under the title.",
|
|
458
|
+
"required": false
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "level",
|
|
462
|
+
"type": "2 | 3",
|
|
463
|
+
"default": "2",
|
|
464
|
+
"description": "The level of the title.",
|
|
465
|
+
"required": false
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "reveal",
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"default": null,
|
|
471
|
+
"description": "Rises into place once, as it enters the viewport (`[data-reveal]`, MotionObserver). Never on the first screen.",
|
|
472
|
+
"required": false
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "size",
|
|
476
|
+
"type": "\"sm\" | \"md\"",
|
|
477
|
+
"default": "md",
|
|
478
|
+
"description": "`md` for a section that argues, `sm` for a section of a reading page.",
|
|
479
|
+
"required": false
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"component": "Ticks",
|
|
485
|
+
"description": "A sentence of a message catalogue where words between backticks read as code — no markup in the translations.",
|
|
486
|
+
"props": [
|
|
487
|
+
{
|
|
488
|
+
"name": "children",
|
|
489
|
+
"type": "string",
|
|
490
|
+
"default": null,
|
|
491
|
+
"description": "A sentence where words between backticks are code: \"Every request carries a `requestId`.\"",
|
|
492
|
+
"required": true
|
|
493
|
+
}
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
]
|
|
497
|
+
}
|
package/registry/pagination.json
CHANGED
|
@@ -325,11 +325,11 @@
|
|
|
325
325
|
"files": [
|
|
326
326
|
{
|
|
327
327
|
"path": "glyphs.tsx",
|
|
328
|
-
"content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\n"
|
|
328
|
+
"content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\n"
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
331
|
"path": "meta.ts",
|
|
332
|
-
"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 | \"alert\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"data-table\"\n | \"date-picker\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page-header\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"theme\"\n | \"toast\"\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
|
|
332
|
+
"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 | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\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 | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\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 */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"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\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"
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
"path": "pagination/index.ts",
|