@krizaka/ui 4.4.1 → 4.5.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.
Files changed (211) hide show
  1. package/README.md +1 -0
  2. package/dist/columns.d.ts +132 -0
  3. package/dist/columns.js +89 -0
  4. package/dist/columns.js.map +1 -0
  5. package/dist/shop-composer.d.ts +2 -2
  6. package/dist/virtual.d.ts +3 -3
  7. package/package.json +19 -5
  8. package/registry/account-menu.json +1 -1
  9. package/registry/account-settings.json +1 -1
  10. package/registry/achievement.json +1 -1
  11. package/registry/action-bar.json +1 -1
  12. package/registry/activity-feed.json +1 -1
  13. package/registry/agenda.json +1 -1
  14. package/registry/alert.json +1 -1
  15. package/registry/analysis-report.json +1 -1
  16. package/registry/anatomy-plate.json +1 -1
  17. package/registry/app-frame.json +2 -2
  18. package/registry/app-header.json +1 -1
  19. package/registry/app-shell.json +1 -1
  20. package/registry/argument-card.json +1 -1
  21. package/registry/auth-layout.json +1 -1
  22. package/registry/avatar.json +1 -1
  23. package/registry/badge.json +1 -1
  24. package/registry/bird-plate.json +1 -1
  25. package/registry/button.json +1 -1
  26. package/registry/captcha.json +1 -1
  27. package/registry/card-grid.json +1 -1
  28. package/registry/card.json +1 -1
  29. package/registry/catalogue-page.json +1 -1
  30. package/registry/changelog-page.json +1 -1
  31. package/registry/chapter.json +1 -1
  32. package/registry/chat.json +1 -1
  33. package/registry/checkbox.json +1 -1
  34. package/registry/chip-link.json +1 -1
  35. package/registry/chip-row.json +1 -1
  36. package/registry/chip.json +1 -1
  37. package/registry/choice-grid.json +1 -1
  38. package/registry/code-block.json +1 -1
  39. package/registry/collection-switcher.json +1 -1
  40. package/registry/columns.json +319 -0
  41. package/registry/combobox.json +1 -1
  42. package/registry/command.json +1 -1
  43. package/registry/comparison-table.json +1 -1
  44. package/registry/component-page.json +1 -1
  45. package/registry/confirm-button.json +1 -1
  46. package/registry/contact-page.json +1 -1
  47. package/registry/continue-prompt.json +1 -1
  48. package/registry/copy-button.json +1 -1
  49. package/registry/countdown.json +1 -1
  50. package/registry/cover-hero.json +1 -1
  51. package/registry/cta-panel.json +1 -1
  52. package/registry/dashboard-layout.json +1 -1
  53. package/registry/data-table.json +1 -1
  54. package/registry/date-picker.json +1 -1
  55. package/registry/decision-list.json +1 -1
  56. package/registry/description-list.json +1 -1
  57. package/registry/desktop-window.json +1 -1
  58. package/registry/detail-layout.json +1 -1
  59. package/registry/dialog.json +1 -1
  60. package/registry/docs-article-page.json +1 -1
  61. package/registry/docs-hub-page.json +1 -1
  62. package/registry/docs-layout.json +1 -1
  63. package/registry/docs-nav.json +1 -1
  64. package/registry/document-viewer.json +1 -1
  65. package/registry/doodle.json +1 -1
  66. package/registry/drop-overlay.json +1 -1
  67. package/registry/dropdown-menu.json +1 -1
  68. package/registry/elephant.json +1 -1
  69. package/registry/embed-facade.json +1 -1
  70. package/registry/empty-state.json +1 -1
  71. package/registry/engine-flow.json +1 -1
  72. package/registry/entity-header.json +1 -1
  73. package/registry/environment-notice.json +1 -1
  74. package/registry/error-page.json +1 -1
  75. package/registry/examples/columns/columns.d.ts +4 -0
  76. package/registry/examples/columns/columns.js +21 -0
  77. package/registry/examples/columns/columns.tsx +18 -0
  78. package/registry/examples/columns/photos.d.ts +4 -0
  79. package/registry/examples/columns/photos.js +12 -0
  80. package/registry/examples/columns/photos.tsx +16 -0
  81. package/registry/examples/columns/stats.d.ts +4 -0
  82. package/registry/examples/columns/stats.js +20 -0
  83. package/registry/examples/columns/stats.tsx +22 -0
  84. package/registry/field.json +1 -1
  85. package/registry/file-upload.json +1 -1
  86. package/registry/filter-bar.json +1 -1
  87. package/registry/flock.json +1 -1
  88. package/registry/footnote.json +1 -1
  89. package/registry/force-update-screen.json +1 -1
  90. package/registry/form.json +1 -1
  91. package/registry/gallery-page.json +1 -1
  92. package/registry/genui.json +1 -1
  93. package/registry/glossary-term.json +1 -1
  94. package/registry/glossary.json +1 -1
  95. package/registry/glow-card.json +1 -1
  96. package/registry/goal-gauge.json +1 -1
  97. package/registry/grade-stamp.json +1 -1
  98. package/registry/grid.json +4 -3
  99. package/registry/identity-card.json +1 -1
  100. package/registry/image-cropper.json +1 -1
  101. package/registry/index.json +40 -9
  102. package/registry/kanban.json +1 -1
  103. package/registry/kbd.json +1 -1
  104. package/registry/kind-config-editor.json +1 -1
  105. package/registry/kpi-explained.json +1 -1
  106. package/registry/landing-page.json +1 -1
  107. package/registry/landscape.json +1 -1
  108. package/registry/language-switch.json +1 -1
  109. package/registry/legal-page.json +1 -1
  110. package/registry/link-card.json +1 -1
  111. package/registry/list.json +1 -1
  112. package/registry/loader.json +1 -1
  113. package/registry/longform-page.json +1 -1
  114. package/registry/maintenance-screen.json +1 -1
  115. package/registry/map.json +2 -2
  116. package/registry/margin-layout.json +1 -1
  117. package/registry/markdown.json +1 -1
  118. package/registry/marketing-layout.json +1 -1
  119. package/registry/mascot-quote.json +1 -1
  120. package/registry/mascot-state.json +1 -1
  121. package/registry/mascots.json +1 -1
  122. package/registry/match-dialog.json +1 -1
  123. package/registry/media-capture.json +1 -1
  124. package/registry/media-gallery.json +1 -1
  125. package/registry/meter.json +1 -1
  126. package/registry/money-input.json +1 -1
  127. package/registry/nav-bar.json +2 -2
  128. package/registry/next-actions.json +1 -1
  129. package/registry/notification-preferences.json +1 -1
  130. package/registry/number-ticker.json +1 -1
  131. package/registry/opening-hours.json +1 -1
  132. package/registry/page-header.json +1 -1
  133. package/registry/page-hero.json +1 -1
  134. package/registry/page-index.json +1 -1
  135. package/registry/page.json +1 -1
  136. package/registry/pagination.json +1 -1
  137. package/registry/pointer-light.json +1 -1
  138. package/registry/popover.json +1 -1
  139. package/registry/price-catalogue-editor.json +1 -1
  140. package/registry/pricing-page.json +1 -1
  141. package/registry/product-page.json +1 -1
  142. package/registry/profile-card.json +1 -1
  143. package/registry/progress.json +1 -1
  144. package/registry/promise-card.json +1 -1
  145. package/registry/promo-code-field.json +1 -1
  146. package/registry/proposal.json +1 -1
  147. package/registry/qr-code.json +1 -1
  148. package/registry/quota-meter.json +1 -1
  149. package/registry/radio-group.json +1 -1
  150. package/registry/rail-nav.json +2 -2
  151. package/registry/recipes.json +1 -1
  152. package/registry/retro-tv.json +1 -1
  153. package/registry/reviews.json +1 -1
  154. package/registry/router.json +1 -1
  155. package/registry/schema-form.json +1 -1
  156. package/registry/scroll-stage.json +1 -1
  157. package/registry/search-field.json +1 -1
  158. package/registry/section-backdrop.json +1 -1
  159. package/registry/separator.json +1 -1
  160. package/registry/service-card.json +1 -1
  161. package/registry/settings-layout.json +1 -1
  162. package/registry/shop-composer.json +1 -1
  163. package/registry/shop-gallery.json +1 -1
  164. package/registry/shop.json +2 -2
  165. package/registry/showcase.json +1 -1
  166. package/registry/signature.json +1 -1
  167. package/registry/site-cahier.json +1 -1
  168. package/registry/site-footer.json +2 -2
  169. package/registry/sites.json +1 -1
  170. package/registry/skeleton.json +1 -1
  171. package/registry/skip-link.json +1 -1
  172. package/registry/slider.json +1 -1
  173. package/registry/slot-picker.json +1 -1
  174. package/registry/slot.json +1 -1
  175. package/registry/specimen-tag.json +1 -1
  176. package/registry/speed-lines.json +1 -1
  177. package/registry/spinner.json +1 -1
  178. package/registry/split-view.json +1 -1
  179. package/registry/stage-banner.json +1 -1
  180. package/registry/stat.json +1 -1
  181. package/registry/status-chip.json +1 -1
  182. package/registry/status-page.json +1 -1
  183. package/registry/step-progress.json +1 -1
  184. package/registry/step-showcase.json +1 -1
  185. package/registry/stepper.json +1 -1
  186. package/registry/sticky-action.json +1 -1
  187. package/registry/stuck.json +1 -1
  188. package/registry/swipe-deck.json +1 -1
  189. package/registry/switch.json +1 -1
  190. package/registry/tabs.json +1 -1
  191. package/registry/tag-input.json +1 -1
  192. package/registry/tag-selector.json +1 -1
  193. package/registry/taped-photo.json +1 -1
  194. package/registry/terminal-replay.json +1 -1
  195. package/registry/text-style.json +1 -1
  196. package/registry/theme.json +1 -1
  197. package/registry/toast.json +1 -1
  198. package/registry/toc.json +1 -1
  199. package/registry/tooltip.json +1 -1
  200. package/registry/tree-view.json +1 -1
  201. package/registry/update-prompt.json +1 -1
  202. package/registry/upload-queue.json +1 -1
  203. package/registry/usage.json +1 -1
  204. package/registry/verified-badge.json +1 -1
  205. package/registry/versus-card.json +1 -1
  206. package/registry/vertical-video.json +1 -1
  207. package/registry/video-player.json +1 -1
  208. package/registry/video-trimmer.json +1 -1
  209. package/registry/virtual.json +1 -1
  210. package/registry/wall.json +1 -1
  211. package/registry/waveform.json +1 -1
package/README.md CHANGED
@@ -154,6 +154,7 @@ light or a product's — is a set of tokens.
154
154
  | `@krizaka/ui/chip` | `Chip` (`selected`/`defaultSelected` + `onSelectedChange`, `size` sm·md; `removable` + `removeLabel` + `onRemove`), `Chip.Group` (`type` single·multiple, `label`, `required` for single), `chip` (the slots) | client |
155
155
  | `@krizaka/ui/chip-link` | `ChipLink` (a filter that is a link: `selected`, `current`, `size`, `asChild`), `chipVariants` (`size`, `selected`) | server |
156
156
  | `@krizaka/ui/chip-row` | `ChipRow`, `ChipRow.Item` (a scroll-snap row of chip links, wraps from `md`: `selected`, `badge`, `asChild`) | client (arrow keys) |
157
+ | `@krizaka/ui/columns` | `Grid`, `Columns` (the width of the container decides: size-class columns, weighted columns that stack; the web twins of the native ones) | server-safe |
157
158
  | `@krizaka/ui/switch` | `Switch` (`checked`/`defaultChecked` + `onCheckedChange`, `label` unless a visible label names it, `size` sm·md, `invalid`), `switchVariants` | client |
158
159
  | `@krizaka/ui/slider` | `Slider` (`value`: a number or a `[min, max]` range, `onValueChange`, `onValueCommit`, `label`, `thumbLabels`, `formatValue` → aria-valuetext, `showLabel`, `origin`), `slider` (the slots) | client |
159
160
  | `@krizaka/ui/checkbox` | `Checkbox` (`checked` true·false·"indeterminate" + `onCheckedChange`, `invalid`, its words as children) — sits in a `Field` | client |
@@ -0,0 +1,132 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as React from 'react';
3
+
4
+ /** The size class of a container: where each one begins, in px of the room (Material's window size classes, as on native). */
5
+ declare const SIZE_CLASS_FROM: {
6
+ readonly regular: 600;
7
+ readonly expanded: 840;
8
+ };
9
+ /** The gap tokens, in px — the spacing scale (`gap-1` … `gap-6`), the same numbers as native. */
10
+ declare const GRID_GAPS: {
11
+ readonly none: 0;
12
+ readonly xs: 4;
13
+ readonly sm: 8;
14
+ readonly md: 12;
15
+ readonly lg: 16;
16
+ readonly xl: 24;
17
+ };
18
+ type GridGap = keyof typeof GRID_GAPS;
19
+ /** How many columns per size class, or one number for all. A size class left out takes the one before it (compact → regular → expanded). */
20
+ type GridColumns = number | Partial<Record<"compact" | "regular" | "expanded", number>>;
21
+ /** One column on a compact room, two on a regular one, three on an expanded one. */
22
+ declare const DEFAULT_COLUMNS: {
23
+ readonly compact: 1;
24
+ readonly regular: 2;
25
+ readonly expanded: 3;
26
+ };
27
+ declare const columnsLayout: tailwind_variants.TVReturnType<{
28
+ gap: Record<GridGap, {
29
+ track: string;
30
+ columns: string;
31
+ }>;
32
+ equalHeight: {
33
+ true: {
34
+ track: string;
35
+ cell: string;
36
+ };
37
+ false: {
38
+ track: string;
39
+ };
40
+ };
41
+ }, {
42
+ grid: string;
43
+ track: string;
44
+ cell: string;
45
+ columns: string;
46
+ column: string;
47
+ }, undefined, {
48
+ gap: Record<GridGap, {
49
+ track: string;
50
+ columns: string;
51
+ }>;
52
+ equalHeight: {
53
+ true: {
54
+ track: string;
55
+ cell: string;
56
+ };
57
+ false: {
58
+ track: string;
59
+ };
60
+ };
61
+ }, {
62
+ grid: string;
63
+ track: string;
64
+ cell: string;
65
+ columns: string;
66
+ column: string;
67
+ }, tailwind_variants.TVReturnTypeLike<{
68
+ gap: Record<GridGap, {
69
+ track: string;
70
+ columns: string;
71
+ }>;
72
+ equalHeight: {
73
+ true: {
74
+ track: string;
75
+ cell: string;
76
+ };
77
+ false: {
78
+ track: string;
79
+ };
80
+ };
81
+ }, {
82
+ grid: string;
83
+ track: string;
84
+ cell: string;
85
+ columns: string;
86
+ column: string;
87
+ }>>;
88
+ /** The columns of a size class: a size class left out takes the one before it. */
89
+ declare function columnsFor(columns: GridColumns | undefined, sizeClass: keyof typeof DEFAULT_COLUMNS): number;
90
+ type GridProps = Omit<React.ComponentProps<"div">, "children"> & {
91
+ /** The items. Each is one cell. */
92
+ children: React.ReactNode;
93
+ /** Columns per size class of the container the grid is in (default 1 · 2 · 3), or one number. A ceiling: it drops when `minItemWidth` does not fit. */
94
+ columns?: GridColumns;
95
+ /** No cell is narrower than this, in px (default 160); it grows with the text scale. */
96
+ minItemWidth?: number;
97
+ /** The space between cells (default `md`). */
98
+ gap?: GridGap;
99
+ /** The most columns, whatever the container (default 6). */
100
+ maxColumns?: number;
101
+ /** The cells of a row are as tall as the tallest (default true); `false` lets each keep its own height. */
102
+ equalHeight?: boolean;
103
+ /** The text scale to lay out for, on top of the browser's (widths are in `rem`, so a larger text size is followed already). Pass 2 to see 200 % text. */
104
+ fontScale?: number;
105
+ };
106
+ /**
107
+ * A grid that fits its container: the columns come from the size class of the container's width, and no cell is narrower
108
+ * than `minItemWidth`, so nothing overflows in a page, a side panel or a split. The order mirrors in right-to-left.
109
+ */
110
+ declare function Grid({ children, columns, minItemWidth, gap, maxColumns, equalHeight, fontScale, "aria-label": label, className, style, ...props }: GridProps): React.JSX.Element;
111
+ type ColumnsProps = Omit<React.ComponentProps<"div">, "children"> & {
112
+ /** The columns, in reading order (the first is at the start edge, on the right in right-to-left). */
113
+ children: React.ReactNode;
114
+ /** The share of each column (default equal); `[1, 2]` is a third and two thirds. */
115
+ weights?: readonly number[];
116
+ /** Below this width per column, in px, the columns stack top to bottom (default 280); it grows with the text scale. */
117
+ minColumnWidth?: number;
118
+ /** The space between columns, and between stacked ones (default `lg`). */
119
+ gap?: GridGap;
120
+ /** The text scale to lay out for, on top of the browser's. Pass 2 to see 200 % text. */
121
+ fontScale?: number;
122
+ };
123
+ /** The width, in px, that `count` columns need to sit side by side. */
124
+ declare function columnsNeed(count: number, minColumnWidth: number, gapPx: number, fontScale?: number): number;
125
+ /**
126
+ * A few columns that sit side by side when their container holds them and stack when it does not — the master and the
127
+ * detail, a form and its summary. Stacked, they keep their order and each takes the full width.
128
+ */
129
+ declare function Columns({ children, weights, minColumnWidth, gap, fontScale, className, style, ...props }: ColumnsProps): React.JSX.Element;
130
+
131
+ export { Columns, DEFAULT_COLUMNS, GRID_GAPS, Grid, SIZE_CLASS_FROM, columnsFor, columnsLayout, columnsNeed };
132
+ export type { ColumnsProps, GridColumns, GridGap, GridProps };
@@ -0,0 +1,89 @@
1
+ // src/columns/columns.tsx
2
+ import * as React from "react";
3
+ import { tv } from "tailwind-variants";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var SIZE_CLASS_FROM = { regular: 600, expanded: 840 };
6
+ var GRID_GAPS = { none: 0, xs: 4, sm: 8, md: 12, lg: 16, xl: 24 };
7
+ var DEFAULT_COLUMNS = { compact: 1, regular: 2, expanded: 3 };
8
+ var PX_PER_REM = 16;
9
+ var rem = (px) => `${px / PX_PER_REM}rem`;
10
+ var columnsLayout = tv({
11
+ slots: {
12
+ // `@container`: the grid reads the width of this element. The track inside switches its columns at its widths.
13
+ grid: "@container w-full min-w-0",
14
+ track: "grid [--kz-grid-cols:var(--kz-grid-compact)] @min-[600px]:[--kz-grid-cols:var(--kz-grid-regular)] @min-[840px]:[--kz-grid-cols:var(--kz-grid-expanded)]",
15
+ cell: "flex min-w-0 flex-col",
16
+ columns: "flex w-full min-w-0 flex-wrap",
17
+ column: "min-w-0"
18
+ },
19
+ variants: {
20
+ gap: Object.fromEntries(
21
+ Object.entries({ none: "gap-0", xs: "gap-1", sm: "gap-2", md: "gap-3", lg: "gap-4", xl: "gap-6" }).map(([name, cls]) => [name, { track: cls, columns: cls }])
22
+ ),
23
+ equalHeight: { true: { track: "items-stretch", cell: "*:flex-1" }, false: { track: "items-start" } }
24
+ }
25
+ });
26
+ function columnsFor(columns, sizeClass) {
27
+ const asked = columns ?? DEFAULT_COLUMNS;
28
+ if (typeof asked === "number") return Math.max(1, Math.floor(asked));
29
+ const order = ["compact", "regular", "expanded"];
30
+ for (let i = order.indexOf(sizeClass); i >= 0; i--) {
31
+ const value = asked[order[i]];
32
+ if (value) return Math.max(1, Math.floor(value));
33
+ }
34
+ return 1;
35
+ }
36
+ function Grid({ children, columns, minItemWidth = 160, gap = "md", maxColumns = 6, equalHeight = true, fontScale = 1, "aria-label": label, className, style, ...props }) {
37
+ const s = columnsLayout({ gap, equalHeight });
38
+ const items = React.Children.toArray(children);
39
+ const cap = Math.max(1, Math.floor(maxColumns));
40
+ const at = (sizeClass) => Math.min(columnsFor(columns, sizeClass), cap);
41
+ const vars = {
42
+ "--kz-grid-compact": at("compact"),
43
+ "--kz-grid-regular": at("regular"),
44
+ "--kz-grid-expanded": at("expanded"),
45
+ "--kz-grid-min": rem(minItemWidth * Math.max(1, fontScale)),
46
+ "--kz-grid-gap": rem(GRID_GAPS[gap]),
47
+ // As many tracks as `--kz-grid-cols` allows, none narrower than the minimum: the ceiling drops on its own.
48
+ gridTemplateColumns: "repeat(auto-fill, minmax(max(var(--kz-grid-min), calc((100% - (var(--kz-grid-cols) - 1) * var(--kz-grid-gap)) / var(--kz-grid-cols))), 1fr))"
49
+ };
50
+ return /* @__PURE__ */ jsx("div", { className: s.grid({ className }), style, ...props, children: /* @__PURE__ */ jsx("div", { className: s.track(), style: vars, role: label ? "list" : void 0, "aria-label": label, children: items.map((child, index) => /* @__PURE__ */ jsx("div", { className: s.cell(), role: label ? "listitem" : void 0, children: child }, React.isValidElement(child) && child.key != null ? child.key : index)) }) });
51
+ }
52
+ function columnsNeed(count, minColumnWidth, gapPx, fontScale = 1) {
53
+ return count * minColumnWidth * Math.max(1, fontScale) + gapPx * (count - 1);
54
+ }
55
+ function Columns({ children, weights, minColumnWidth = 280, gap = "lg", fontScale = 1, className, style, ...props }) {
56
+ const s = columnsLayout({ gap });
57
+ const items = React.Children.toArray(children);
58
+ const need = columnsNeed(items.length, minColumnWidth, GRID_GAPS[gap], fontScale);
59
+ const side = items.length > 1;
60
+ return /* @__PURE__ */ jsx(
61
+ "div",
62
+ {
63
+ className: s.columns({ className }),
64
+ style: { "--kz-columns-need": rem(need), ...style },
65
+ "data-layout": "columns",
66
+ ...props,
67
+ children: items.map((child, index) => /* @__PURE__ */ jsx(
68
+ "div",
69
+ {
70
+ className: s.column(),
71
+ style: { flexGrow: weights?.[index] ?? 1, flexBasis: side ? "calc((var(--kz-columns-need) - 100%) * 999)" : "100%" },
72
+ children: child
73
+ },
74
+ React.isValidElement(child) && child.key != null ? child.key : index
75
+ ))
76
+ }
77
+ );
78
+ }
79
+ export {
80
+ Columns,
81
+ DEFAULT_COLUMNS,
82
+ GRID_GAPS,
83
+ Grid,
84
+ SIZE_CLASS_FROM,
85
+ columnsFor,
86
+ columnsLayout,
87
+ columnsNeed
88
+ };
89
+ //# sourceMappingURL=columns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/columns/columns.tsx"],"sourcesContent":["// Server-safe. Layouts that decide on the width of the room they sit in — their container, never the viewport or a device —\n// like the native `Grid` and `Columns` (src/native/grid.tsx), with the same props and the same size classes\n// (compact < 600 px, regular < 840 px, expanded from there). No JS measures anything: `Grid` is a CSS container\n// (`@container`) whose columns come from the size class of that container, and `Columns` stacks by container-relative\n// sizing (a `flex-basis` that is huge below the width the columns need and zero above it). Every width is in `rem`, so a\n// larger text size grows the room an item needs: at 200 % a card that held two per row stacks into one. The order is the\n// reading order and it mirrors in `rtl`: no physical edge is used.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\n/** The size class of a container: where each one begins, in px of the room (Material's window size classes, as on native). */\nexport const SIZE_CLASS_FROM = { regular: 600, expanded: 840 } as const;\n\n/** The gap tokens, in px — the spacing scale (`gap-1` … `gap-6`), the same numbers as native. */\nexport const GRID_GAPS = { none: 0, xs: 4, sm: 8, md: 12, lg: 16, xl: 24 } as const;\nexport type GridGap = keyof typeof GRID_GAPS;\n\n/** How many columns per size class, or one number for all. A size class left out takes the one before it (compact → regular → expanded). */\nexport type GridColumns = number | Partial<Record<\"compact\" | \"regular\" | \"expanded\", number>>;\n\n/** One column on a compact room, two on a regular one, three on an expanded one. */\nexport const DEFAULT_COLUMNS = { compact: 1, regular: 2, expanded: 3 } as const;\n\nconst PX_PER_REM = 16;\nconst rem = (px: number) => `${px / PX_PER_REM}rem`;\n\nexport const columnsLayout = tv({\n slots: {\n // `@container`: the grid reads the width of this element. The track inside switches its columns at its widths.\n grid: \"@container w-full min-w-0\",\n track:\n \"grid [--kz-grid-cols:var(--kz-grid-compact)] @min-[600px]:[--kz-grid-cols:var(--kz-grid-regular)] @min-[840px]:[--kz-grid-cols:var(--kz-grid-expanded)]\",\n cell: \"flex min-w-0 flex-col\",\n columns: \"flex w-full min-w-0 flex-wrap\",\n column: \"min-w-0\",\n },\n variants: {\n gap: Object.fromEntries(\n Object.entries({ none: \"gap-0\", xs: \"gap-1\", sm: \"gap-2\", md: \"gap-3\", lg: \"gap-4\", xl: \"gap-6\" }).map(([name, cls]) => [name, { track: cls, columns: cls }]),\n ) as Record<GridGap, { track: string; columns: string }>,\n equalHeight: { true: { track: \"items-stretch\", cell: \"*:flex-1\" }, false: { track: \"items-start\" } },\n },\n});\n\n/** The columns of a size class: a size class left out takes the one before it. */\nexport function columnsFor(columns: GridColumns | undefined, sizeClass: keyof typeof DEFAULT_COLUMNS): number {\n const asked = columns ?? DEFAULT_COLUMNS;\n if (typeof asked === \"number\") return Math.max(1, Math.floor(asked));\n const order = [\"compact\", \"regular\", \"expanded\"] as const;\n for (let i = order.indexOf(sizeClass); i >= 0; i--) {\n const value = asked[order[i] as (typeof order)[number]];\n if (value) return Math.max(1, Math.floor(value));\n }\n return 1;\n}\n\nexport type GridProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The items. Each is one cell. */\n children: React.ReactNode;\n /** Columns per size class of the container the grid is in (default 1 · 2 · 3), or one number. A ceiling: it drops when `minItemWidth` does not fit. */\n columns?: GridColumns;\n /** No cell is narrower than this, in px (default 160); it grows with the text scale. */\n minItemWidth?: number;\n /** The space between cells (default `md`). */\n gap?: GridGap;\n /** The most columns, whatever the container (default 6). */\n maxColumns?: number;\n /** The cells of a row are as tall as the tallest (default true); `false` lets each keep its own height. */\n equalHeight?: boolean;\n /** The text scale to lay out for, on top of the browser's (widths are in `rem`, so a larger text size is followed already). Pass 2 to see 200 % text. */\n fontScale?: number;\n};\n\n/**\n * A grid that fits its container: the columns come from the size class of the container's width, and no cell is narrower\n * than `minItemWidth`, so nothing overflows in a page, a side panel or a split. The order mirrors in right-to-left.\n */\nexport function Grid({ children, columns, minItemWidth = 160, gap = \"md\", maxColumns = 6, equalHeight = true, fontScale = 1, \"aria-label\": label, className, style, ...props }: GridProps) {\n const s = columnsLayout({ gap, equalHeight });\n const items = React.Children.toArray(children);\n const cap = Math.max(1, Math.floor(maxColumns));\n const at = (sizeClass: keyof typeof DEFAULT_COLUMNS) => Math.min(columnsFor(columns, sizeClass), cap);\n const vars = {\n \"--kz-grid-compact\": at(\"compact\"),\n \"--kz-grid-regular\": at(\"regular\"),\n \"--kz-grid-expanded\": at(\"expanded\"),\n \"--kz-grid-min\": rem(minItemWidth * Math.max(1, fontScale)),\n \"--kz-grid-gap\": rem(GRID_GAPS[gap]),\n // As many tracks as `--kz-grid-cols` allows, none narrower than the minimum: the ceiling drops on its own.\n gridTemplateColumns:\n \"repeat(auto-fill, minmax(max(var(--kz-grid-min), calc((100% - (var(--kz-grid-cols) - 1) * var(--kz-grid-gap)) / var(--kz-grid-cols))), 1fr))\",\n } as React.CSSProperties;\n return (\n <div className={s.grid({ className })} style={style} {...props}>\n <div className={s.track()} style={vars} role={label ? \"list\" : undefined} aria-label={label}>\n {items.map((child, index) => (\n <div key={React.isValidElement(child) && child.key != null ? child.key : index} className={s.cell()} role={label ? \"listitem\" : undefined}>\n {child}\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nexport type ColumnsProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The columns, in reading order (the first is at the start edge, on the right in right-to-left). */\n children: React.ReactNode;\n /** The share of each column (default equal); `[1, 2]` is a third and two thirds. */\n weights?: readonly number[];\n /** Below this width per column, in px, the columns stack top to bottom (default 280); it grows with the text scale. */\n minColumnWidth?: number;\n /** The space between columns, and between stacked ones (default `lg`). */\n gap?: GridGap;\n /** The text scale to lay out for, on top of the browser's. Pass 2 to see 200 % text. */\n fontScale?: number;\n};\n\n/** The width, in px, that `count` columns need to sit side by side. */\nexport function columnsNeed(count: number, minColumnWidth: number, gapPx: number, fontScale = 1): number {\n return count * minColumnWidth * Math.max(1, fontScale) + gapPx * (count - 1);\n}\n\n/**\n * A few columns that sit side by side when their container holds them and stack when it does not — the master and the\n * detail, a form and its summary. Stacked, they keep their order and each takes the full width.\n */\nexport function Columns({ children, weights, minColumnWidth = 280, gap = \"lg\", fontScale = 1, className, style, ...props }: ColumnsProps) {\n const s = columnsLayout({ gap });\n const items = React.Children.toArray(children);\n const need = columnsNeed(items.length, minColumnWidth, GRID_GAPS[gap], fontScale);\n const side = items.length > 1;\n return (\n <div\n className={s.columns({ className })}\n style={{ \"--kz-columns-need\": rem(need), ...style } as React.CSSProperties}\n data-layout=\"columns\"\n {...props}\n >\n {items.map((child, index) => (\n <div\n key={React.isValidElement(child) && child.key != null ? child.key : index}\n className={s.column()}\n // Container-relative: a basis above the row's width wraps the column onto its own line (stacked, full width);\n // below it the basis is 0 and the free space is shared by weight.\n style={{ flexGrow: weights?.[index] ?? 1, flexBasis: side ? \"calc((var(--kz-columns-need) - 100%) * 999)\" : \"100%\" }}\n >\n {child}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";AAOA,YAAY,WAAW;AACvB,SAAS,UAAU;AAwFT;AArFH,IAAM,kBAAkB,EAAE,SAAS,KAAK,UAAU,IAAI;AAGtD,IAAM,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAOlE,IAAM,kBAAkB,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,EAAE;AAErE,IAAM,aAAa;AACnB,IAAM,MAAM,CAAC,OAAe,GAAG,KAAK,UAAU;AAEvC,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA,IACN,OACE;AAAA,IACF,MAAM;AAAA,IACN,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,KAAK,OAAO;AAAA,MACV,OAAO,QAAQ,EAAE,MAAM,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC;AAAA,IAC9J;AAAA,IACA,aAAa,EAAE,MAAM,EAAE,OAAO,iBAAiB,MAAM,WAAW,GAAG,OAAO,EAAE,OAAO,cAAc,EAAE;AAAA,EACrG;AACF,CAAC;AAGM,SAAS,WAAW,SAAkC,WAAiD;AAC5G,QAAM,QAAQ,WAAW;AACzB,MAAI,OAAO,UAAU,SAAU,QAAO,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC;AACnE,QAAM,QAAQ,CAAC,WAAW,WAAW,UAAU;AAC/C,WAAS,IAAI,MAAM,QAAQ,SAAS,GAAG,KAAK,GAAG,KAAK;AAClD,UAAM,QAAQ,MAAM,MAAM,CAAC,CAA2B;AACtD,QAAI,MAAO,QAAO,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC;AAAA,EACjD;AACA,SAAO;AACT;AAuBO,SAAS,KAAK,EAAE,UAAU,SAAS,eAAe,KAAK,MAAM,MAAM,aAAa,GAAG,cAAc,MAAM,YAAY,GAAG,cAAc,OAAO,WAAW,OAAO,GAAG,MAAM,GAAc;AACzL,QAAM,IAAI,cAAc,EAAE,KAAK,YAAY,CAAC;AAC5C,QAAM,QAAc,eAAS,QAAQ,QAAQ;AAC7C,QAAM,MAAM,KAAK,IAAI,GAAG,KAAK,MAAM,UAAU,CAAC;AAC9C,QAAM,KAAK,CAAC,cAA4C,KAAK,IAAI,WAAW,SAAS,SAAS,GAAG,GAAG;AACpG,QAAM,OAAO;AAAA,IACX,qBAAqB,GAAG,SAAS;AAAA,IACjC,qBAAqB,GAAG,SAAS;AAAA,IACjC,sBAAsB,GAAG,UAAU;AAAA,IACnC,iBAAiB,IAAI,eAAe,KAAK,IAAI,GAAG,SAAS,CAAC;AAAA,IAC1D,iBAAiB,IAAI,UAAU,GAAG,CAAC;AAAA;AAAA,IAEnC,qBACE;AAAA,EACJ;AACA,SACE,oBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,OAAe,GAAG,OACvD,8BAAC,SAAI,WAAW,EAAE,MAAM,GAAG,OAAO,MAAM,MAAM,QAAQ,SAAS,QAAW,cAAY,OACnF,gBAAM,IAAI,CAAC,OAAO,UACjB,oBAAC,SAA+E,WAAW,EAAE,KAAK,GAAG,MAAM,QAAQ,aAAa,QAC7H,mBADa,qBAAe,KAAK,KAAK,MAAM,OAAO,OAAO,MAAM,MAAM,KAEzE,CACD,GACH,GACF;AAEJ;AAgBO,SAAS,YAAY,OAAe,gBAAwB,OAAe,YAAY,GAAW;AACvG,SAAO,QAAQ,iBAAiB,KAAK,IAAI,GAAG,SAAS,IAAI,SAAS,QAAQ;AAC5E;AAMO,SAAS,QAAQ,EAAE,UAAU,SAAS,iBAAiB,KAAK,MAAM,MAAM,YAAY,GAAG,WAAW,OAAO,GAAG,MAAM,GAAiB;AACxI,QAAM,IAAI,cAAc,EAAE,IAAI,CAAC;AAC/B,QAAM,QAAc,eAAS,QAAQ,QAAQ;AAC7C,QAAM,OAAO,YAAY,MAAM,QAAQ,gBAAgB,UAAU,GAAG,GAAG,SAAS;AAChF,QAAM,OAAO,MAAM,SAAS;AAC5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC;AAAA,MAClC,OAAO,EAAE,qBAAqB,IAAI,IAAI,GAAG,GAAG,MAAM;AAAA,MAClD,eAAY;AAAA,MACX,GAAG;AAAA,MAEH,gBAAM,IAAI,CAAC,OAAO,UACjB;AAAA,QAAC;AAAA;AAAA,UAEC,WAAW,EAAE,OAAO;AAAA,UAGpB,OAAO,EAAE,UAAU,UAAU,KAAK,KAAK,GAAG,WAAW,OAAO,gDAAgD,OAAO;AAAA,UAElH;AAAA;AAAA,QANU,qBAAe,KAAK,KAAK,MAAM,OAAO,OAAO,MAAM,MAAM;AAAA,MAOtE,CACD;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -87,7 +87,7 @@ declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonl
87
87
  }, z.core.$strip>;
88
88
  }>, SectionDefinitionOf<"booking", readonly ["strip", "panel", "closing", "sticky"], z.ZodMiniObject<{
89
89
  serviceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
90
- count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 4 | 6>, z.ZodMiniLiteral<3 | 4 | 6>]>;
90
+ count: z.ZodMiniUnion<[z.ZodMiniLiteral<4 | 6 | 3>, z.ZodMiniLiteral<4 | 6 | 3>]>;
91
91
  }, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"gallery", readonly ["mosaic", "filmstrip", "wall", "grid"], z.ZodMiniObject<{
92
92
  source: z.ZodMiniEnum<{
93
93
  all: "all";
@@ -129,7 +129,7 @@ declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonl
129
129
  best: "best";
130
130
  latest: "latest";
131
131
  }>;
132
- count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 1 | 2>, z.ZodMiniLiteral<3 | 1 | 2>]>;
132
+ count: z.ZodMiniUnion<[z.ZodMiniLiteral<1 | 2 | 3>, z.ZodMiniLiteral<1 | 2 | 3>]>;
133
133
  }, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"bulletin", readonly ["board", "banner"], z.ZodMiniObject<{}, z.core.$strip>, {
134
134
  flyer: z.ZodMiniObject<{
135
135
  text: z.ZodMiniString<string>;
package/dist/virtual.d.ts CHANGED
@@ -6,8 +6,8 @@ import * as React from 'react';
6
6
  declare const virtual: tailwind_variants.TVReturnType<{
7
7
  [key: string]: {
8
8
  [key: string]: tailwind_variants.ClassValue | {
9
- list?: tailwind_variants.ClassValue;
10
9
  viewport?: tailwind_variants.ClassValue;
10
+ list?: tailwind_variants.ClassValue;
11
11
  item?: tailwind_variants.ClassValue;
12
12
  row?: tailwind_variants.ClassValue;
13
13
  empty?: tailwind_variants.ClassValue;
@@ -16,8 +16,8 @@ declare const virtual: tailwind_variants.TVReturnType<{
16
16
  } | {
17
17
  [x: string]: {
18
18
  [x: string]: tailwind_variants.ClassValue | {
19
- list?: tailwind_variants.ClassValue;
20
19
  viewport?: tailwind_variants.ClassValue;
20
+ list?: tailwind_variants.ClassValue;
21
21
  item?: tailwind_variants.ClassValue;
22
22
  row?: tailwind_variants.ClassValue;
23
23
  empty?: tailwind_variants.ClassValue;
@@ -32,8 +32,8 @@ declare const virtual: tailwind_variants.TVReturnType<{
32
32
  }, undefined, {
33
33
  [key: string]: {
34
34
  [key: string]: tailwind_variants.ClassValue | {
35
- list?: tailwind_variants.ClassValue;
36
35
  viewport?: tailwind_variants.ClassValue;
36
+ list?: tailwind_variants.ClassValue;
37
37
  item?: tailwind_variants.ClassValue;
38
38
  row?: tailwind_variants.ClassValue;
39
39
  empty?: tailwind_variants.ClassValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "4.4.1",
3
+ "version": "4.5.0",
4
4
  "description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Sovkora, Verikora, Folioviv) and the motion signature — web and /native.",
5
5
  "keywords": [
6
6
  "krizaka",
@@ -216,6 +216,10 @@
216
216
  "types": "./dist/chip-row.d.ts",
217
217
  "import": "./dist/chip-row.js"
218
218
  },
219
+ "./columns": {
220
+ "types": "./dist/columns.d.ts",
221
+ "import": "./dist/columns.js"
222
+ },
219
223
  "./switch": {
220
224
  "types": "./dist/switch.d.ts",
221
225
  "import": "./dist/switch.js"
@@ -1012,7 +1016,7 @@
1012
1016
  ],
1013
1017
  "peerDependencies": {
1014
1018
  "@krizaka/query": ">=0.3.0",
1015
- "@krizaka/tailwind": ">=4.4.1",
1019
+ "@krizaka/tailwind": ">=4.5.0",
1016
1020
  "@maplibre/maplibre-react-native": ">=11",
1017
1021
  "@shopify/flash-list": ">=2",
1018
1022
  "expo-camera": ">=16",
@@ -1844,6 +1848,16 @@
1844
1848
  "clsx"
1845
1849
  ]
1846
1850
  },
1851
+ {
1852
+ "name": "./columns",
1853
+ "path": "dist/columns.js",
1854
+ "limit": "1.3 kB",
1855
+ "gzip": true,
1856
+ "ignore": [
1857
+ "tailwind-variants",
1858
+ "clsx"
1859
+ ]
1860
+ },
1847
1861
  {
1848
1862
  "name": "./pagination",
1849
1863
  "path": "dist/pagination.js",
@@ -3480,10 +3494,10 @@
3480
3494
  "sonner": "^2.0.8",
3481
3495
  "tailwind-variants": "^3.3.1",
3482
3496
  "zod": "^4.6.7",
3497
+ "@krizaka/intl": "^0.4.1",
3498
+ "@krizaka/tokens": "^4.5.0",
3483
3499
  "@krizaka/icons": "^0.10.0",
3484
- "@krizaka/pacer": "^0.2.0",
3485
- "@krizaka/tokens": "^4.4.1",
3486
- "@krizaka/intl": "^0.4.1"
3500
+ "@krizaka/pacer": "^0.2.0"
3487
3501
  },
3488
3502
  "scripts": {
3489
3503
  "build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",
@@ -189,7 +189,7 @@
189
189
  },
190
190
  {
191
191
  "path": "meta.ts",
192
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
192
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
193
193
  }
194
194
  ],
195
195
  "dependencies": [],
@@ -598,7 +598,7 @@
598
598
  },
599
599
  {
600
600
  "path": "meta.ts",
601
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
601
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
602
602
  }
603
603
  ],
604
604
  "dependencies": [