@momoi-labs/kiso 0.1.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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/kiso/AGENTS.md +50 -0
  4. package/kiso/README.md +62 -0
  5. package/kiso/docs/accessibility.md +87 -0
  6. package/kiso/docs/brand.md +95 -0
  7. package/kiso/docs/components/README.md +58 -0
  8. package/kiso/docs/components/alert.md +158 -0
  9. package/kiso/docs/components/badge.md +135 -0
  10. package/kiso/docs/components/breadcrumb.md +66 -0
  11. package/kiso/docs/components/button.md +168 -0
  12. package/kiso/docs/components/card.md +154 -0
  13. package/kiso/docs/components/checkbox.md +91 -0
  14. package/kiso/docs/components/command-palette.md +165 -0
  15. package/kiso/docs/components/drawer.md +79 -0
  16. package/kiso/docs/components/dropdown-menu.md +178 -0
  17. package/kiso/docs/components/empty-state.md +142 -0
  18. package/kiso/docs/components/form-field.md +115 -0
  19. package/kiso/docs/components/header.md +79 -0
  20. package/kiso/docs/components/helper-text.md +86 -0
  21. package/kiso/docs/components/icon-button.md +161 -0
  22. package/kiso/docs/components/input.md +99 -0
  23. package/kiso/docs/components/label.md +88 -0
  24. package/kiso/docs/components/link.md +152 -0
  25. package/kiso/docs/components/modal-dialog.md +82 -0
  26. package/kiso/docs/components/navigation.md +68 -0
  27. package/kiso/docs/components/page-header.md +70 -0
  28. package/kiso/docs/components/pagination.md +129 -0
  29. package/kiso/docs/components/popover.md +74 -0
  30. package/kiso/docs/components/search.md +147 -0
  31. package/kiso/docs/components/select.md +105 -0
  32. package/kiso/docs/components/sidebar.md +74 -0
  33. package/kiso/docs/components/skeleton.md +140 -0
  34. package/kiso/docs/components/spinner.md +125 -0
  35. package/kiso/docs/components/switch.md +92 -0
  36. package/kiso/docs/components/table.md +255 -0
  37. package/kiso/docs/components/tabs.md +69 -0
  38. package/kiso/docs/components/textarea.md +91 -0
  39. package/kiso/docs/components/toast.md +80 -0
  40. package/kiso/docs/components/tooltip.md +162 -0
  41. package/kiso/docs/components/validation-message.md +96 -0
  42. package/kiso/docs/data-interfaces.md +309 -0
  43. package/kiso/docs/evolution.md +35 -0
  44. package/kiso/docs/patterns/README.md +40 -0
  45. package/kiso/docs/patterns/application-shell.md +106 -0
  46. package/kiso/docs/patterns/command-palette.md +142 -0
  47. package/kiso/docs/patterns/confirmations.md +158 -0
  48. package/kiso/docs/patterns/crud.md +139 -0
  49. package/kiso/docs/patterns/dashboard.md +102 -0
  50. package/kiso/docs/patterns/destructive-actions.md +137 -0
  51. package/kiso/docs/patterns/developer-oriented-interfaces.md +162 -0
  52. package/kiso/docs/patterns/empty-states.md +76 -0
  53. package/kiso/docs/patterns/errors.md +93 -0
  54. package/kiso/docs/patterns/filtering.md +147 -0
  55. package/kiso/docs/patterns/keyboard-shortcuts.md +155 -0
  56. package/kiso/docs/patterns/large-data-tables.md +182 -0
  57. package/kiso/docs/patterns/list-detail.md +118 -0
  58. package/kiso/docs/patterns/loading.md +80 -0
  59. package/kiso/docs/patterns/login-authentication.md +101 -0
  60. package/kiso/docs/patterns/onboarding.md +94 -0
  61. package/kiso/docs/patterns/pagination.md +121 -0
  62. package/kiso/docs/patterns/permission-denied.md +84 -0
  63. package/kiso/docs/patterns/search.md +150 -0
  64. package/kiso/docs/patterns/settings.md +100 -0
  65. package/kiso/docs/patterns/sorting.md +121 -0
  66. package/kiso/docs/principles.md +122 -0
  67. package/kiso/docs/tokens.md +95 -0
  68. package/kiso/docs/voice-and-tone.md +154 -0
  69. package/package.json +42 -0
  70. package/tokens/build/tokens.css +143 -0
  71. package/tokens/build/tokens.d.ts +160 -0
  72. package/tokens/build/tokens.json +88 -0
  73. package/tokens/build/tokens.scss +89 -0
@@ -0,0 +1,96 @@
1
+ # ValidationMessage
2
+
3
+ ## Purpose
4
+
5
+ ValidationMessage explains a field-level error and tells the person how to
6
+ recover. It is specific to one control or control group; broader failures
7
+ belong in a form-level summary or Alert.
8
+
9
+ ## Anatomy
10
+
11
+ 1. **Message** — what is invalid, why when known, and what to do next.
12
+ 2. **Identifier** — stable ID referenced by the invalid control through
13
+ `aria-describedby`.
14
+ 3. **Error indicator (optional)** — decorative icon that never replaces text.
15
+ 4. **Recovery action (optional)** — only when the next step cannot be expressed
16
+ as corrected input alone.
17
+
18
+ ## Variants
19
+
20
+ - **Constraint** — missing, malformed, too short/long, or out of range.
21
+ - **Server validation** — value conflicts with authoritative server state.
22
+ - **Group validation** — applies to a named related group and is referenced by
23
+ that group's controls or container as appropriate.
24
+ - **With recovery action** — provides Retry or another concrete action after a
25
+ field-scoped asynchronous failure.
26
+
27
+ Copy follows Kiso's hard error structure: what happened; why, when known; what
28
+ the person can do now. Avoid blame, codes without context, and dead ends.
29
+
30
+ ## Sizes
31
+
32
+ ValidationMessage uses `--type-role-metadata-font-size` and
33
+ `--type-role-metadata-line-height`. It wraps to the FormField width and uses
34
+ `--spacing-xs` from the control. An optional icon
35
+ aligns with the first line and does not create a separate size variant.
36
+
37
+ ## States
38
+
39
+ | State | Behavior |
40
+ | --- | --- |
41
+ | Default | Hidden when the field is valid or has not reached the product's validation threshold. |
42
+ | Hover | No independent state; an embedded recovery action has its own. |
43
+ | Focus | No independent state; focus normally remains on or returns to the invalid control. |
44
+ | Active | No independent state. |
45
+ | Disabled | Remove stale errors if the field is no longer applicable; otherwise preserve the explanation of unavailable invalid data. |
46
+ | Loading | Do not show a speculative error while validation is pending; expose pending status separately. |
47
+ | Error | Visible using `--color-danger`, linked to an `aria-invalid="true"` control. |
48
+
49
+ ValidationMessage represents error, not loading. When asynchronous validation
50
+ starts, retain the last confirmed result or communicate validation progress;
51
+ do not flash an error before the result exists.
52
+
53
+ ## Accessibility
54
+
55
+ - Give the message a stable ID and include it in the invalid control's
56
+ `aria-describedby`, alongside HelperText when present.
57
+ - Set `aria-invalid="true"` on the invalid control, not on the message.
58
+ - For a newly introduced error, use a deliberate live-region strategy or move
59
+ focus to an error summary on submission. Avoid combining mechanisms that
60
+ announce the same text twice.
61
+ - On failed submission, focus the first invalid control or an error summary
62
+ that links to it. Do not move focus on every keystroke.
63
+ - Color and icon are supplementary; understandable text is mandatory.
64
+ - Embedded recovery actions use native keyboard interaction and clear names.
65
+
66
+ ## When to use
67
+
68
+ - For actionable validation feedback tied to one field.
69
+ - After validation at the product's chosen moment: blur, submit, or an
70
+ appropriately debounced server response.
71
+ - In FormField below HelperText when both remain useful.
72
+
73
+ ## When NOT to use
74
+
75
+ - Do not use for neutral advice; use HelperText.
76
+ - Do not use for page-, form-, or system-level failure; use the appropriate
77
+ summary or Alert.
78
+ - Do not show an error before the person has had a reasonable chance to enter a
79
+ value.
80
+ - Do not write only “Invalid value”; state the constraint and recovery.
81
+
82
+ ## Tokens
83
+
84
+ Use `--color-danger` for error text and error affordances;
85
+ `--type-role-metadata-font-family`, `--type-role-metadata-font-size`,
86
+ `--type-role-metadata-font-weight`, `--type-role-metadata-letter-spacing`, and
87
+ `--type-role-metadata-line-height`; and `--spacing-xs`. Surfaces and focus indicators retain
88
+ their own semantic roles. Do not use a primitive status color or raw value.
89
+
90
+ ## Radix/shadcn mapping
91
+
92
+ Radix has no standalone ValidationMessage primitive. It maps to field-error or
93
+ form-message behavior in [shadcn/ui Field](https://ui.shadcn.com/docs/components/field)
94
+ and related form composition. Kiso additionally requires explicit
95
+ `aria-describedby` linkage, `aria-invalid` on the control, and actionable error
96
+ copy.
@@ -0,0 +1,309 @@
1
+ # Data-heavy interfaces
2
+
3
+ These rules govern how Kiso products render technical data. They apply to
4
+ tables, definition lists, detail panels, diffs, query results, and logs.
5
+ They are requirements, not styling suggestions. A product-specific exception
6
+ must document why the data cannot follow the rule.
7
+
8
+ Compose these rules with [Table / DataTable](components/table.md) and the
9
+ existing components named below. Do not create local substitutes for Tooltip,
10
+ IconButton, Badge, or Toast.
11
+
12
+ ## Numeric values
13
+
14
+ ### Alignment and figures
15
+
16
+ - Right-align every column whose cells are numbers, including counts,
17
+ percentages, durations, byte quantities, currency, and numeric null or
18
+ unknown states. Right-align its header to the same edge.
19
+ - Apply `--type-role-numeric` and `--font-variant-numeric` to numeric cells.
20
+ The latter resolves to `tabular-nums`, so equal digits occupy equal widths.
21
+ - Keep numeric data in the body family. Do not switch a numeric column to
22
+ `--font-mono`; the numeric role already supplies tabular figures.
23
+ - Left-align identifiers that happen to contain only digits, such as account
24
+ IDs and postal codes. They are labels, not quantities, and use
25
+ `--type-role-code` when machine-readable.
26
+ - Align decimal separators within a column when values have decimals. Use one
27
+ precision for comparable values; do not mix `1.2`, `1.25`, and `1.2500` in
28
+ the same column unless the precision itself carries meaning.
29
+
30
+ ```text
31
+ Replica Lag Rows
32
+ primary 0 ms 12,480
33
+ replica-01 18 ms 9,032
34
+ replica-02 — 9,032
35
+ ^ right edge
36
+ ```
37
+
38
+ In this example, both numeric headers and cells are right-aligned and use
39
+ `--type-role-numeric` plus `--font-variant-numeric`. `replica-02` remains in
40
+ the numeric column even though its value is unknown.
41
+
42
+ ### Units
43
+
44
+ - Pick one unit per column or comparison group. Put the unit in the header
45
+ when every value shares it (`Lag (ms)`, `Size (MiB)`); do not repeat it in
46
+ every cell.
47
+ - Put a unit directly after a standalone value with a non-breaking space:
48
+ `18 ms`, `64 MiB`, `42%`, `12 connections`. Percent is the only unit without
49
+ a space.
50
+ - Render a suffix in `--color-muted-foreground`. The number remains
51
+ `--color-foreground`. The whole value still has one accessible text
52
+ alternative, such as "18 milliseconds".
53
+ - Use SI units for decimal source values (`kB`, `MB`, `GB`) and IEC units for
54
+ binary source values (`KiB`, `MiB`, `GiB`). Never label a binary conversion
55
+ as `MB`. State the convention in the header or nearby help when ambiguity is
56
+ possible.
57
+ - Convert only to improve scanning. Within a comparable column, use one unit
58
+ chosen for the dataset (`1.2 GiB`, `0.8 GiB`), not a different unit per row
59
+ (`1.2 GiB`, `819 MiB`). Preserve the exact source value in the accessible
60
+ detail or copy action when rounding occurs.
61
+ - Durations use the smallest unit that avoids misleading zeroes, then one
62
+ consistent unit for the group. For example, show `0.8 ms` and `1.3 ms`, not
63
+ `800 µs` beside `1.3 ms`.
64
+ - A Tooltip may explain an unfamiliar unit, but the visible unit must remain
65
+ understandable without it. Tooltip content is descriptive, never the only
66
+ definition available on touch.
67
+
68
+ Example: a memory column stores bytes but displays `1.50 GiB` under
69
+ `Memory (GiB)`. Its copy action copies `1610612736 B`, and its accessible
70
+ detail includes both values.
71
+
72
+ ## Missing and indeterminate values
73
+
74
+ **null ≠ 0 ≠ unknown — three distinct treatments.** Never normalize these
75
+ states to the same glyph, an empty cell, or a falsy branch.
76
+
77
+ | Data state | Visible treatment | Semantics | Example |
78
+ | --- | --- | --- | --- |
79
+ | value `0` | `0` in `--color-foreground`, formatted and aligned exactly like any other number | Known numeric value | `0 ms` |
80
+ | `null` | Literal `NULL` in `--type-role-code` and `--color-muted-foreground` | The field is explicitly absent / SQL `NULL` | `NULL` |
81
+ | unknown | Em dash `—` in `--color-muted-foreground`, plus the reason through Tooltip and an equivalent focus/touch detail | No value is currently known: not loaded, not measured, or unavailable | `—` with "Not reported by this replica" |
82
+
83
+ - Use uppercase `NULL`; do not render it as `null`, `N/A`, a blank, or `—`.
84
+ - Use `—` only for unknown. Give the glyph an accessible label that includes
85
+ the reason, such as "Unknown — metric not reported"; do not let assistive
86
+ technology announce only "dash".
87
+ - Attach Tooltip to an unknown glyph only when it expands a short visible or
88
+ accessible explanation. Because Tooltip does not open on touch and cannot
89
+ hold essential information, the same explanation must be available through
90
+ an expanded row, detail view, or adjacent text.
91
+ - Preserve the column's alignment for all three treatments. `NULL` and `—` in
92
+ a numeric column are right-aligned; in a text column they are left-aligned.
93
+ - Empty string is data, not null. Show it as `""` in `--type-role-code` when
94
+ the distinction matters.
95
+
96
+ ```text
97
+ Setting Value
98
+ max_connections 100 known value
99
+ retry_count 0 known zero
100
+ application_name "" known empty string
101
+ archive_command NULL explicitly absent
102
+ replication_lag — unknown; not reported by replica
103
+ ```
104
+
105
+ ## Warnings and dangerous values
106
+
107
+ Warnings and dangerous values are data annotations. Do not replace, obscure,
108
+ or silently coerce the underlying value.
109
+
110
+ ### Warning
111
+
112
+ - Mark an out-of-range, degraded, or attention-worthy value with
113
+ `--color-warning` and a visible warning icon or a [Badge](components/badge.md)
114
+ labelled `Warning`. Color alone is never the signal.
115
+ - Keep the exact value visible. Put the condition next to it or in the row's
116
+ accessible description: `Replication lag 8.4 s — Warning: above 5 s`.
117
+ - Use warning only when the system still operates and the person should
118
+ investigate. An unavailable value is unknown, not warning.
119
+
120
+ ### Dangerous value
121
+
122
+ - Mark a value that weakens safety, durability, privacy, or availability with
123
+ `--color-danger` and a visible danger icon or [Badge](components/badge.md)
124
+ labelled `Danger`. The marker is mandatory even when the value is valid.
125
+ - Keep the raw setting and value visible. Never replace `fsync = off` with
126
+ only "Dangerous".
127
+ - Attach [Tooltip](components/tooltip.md) to the danger marker for a concise
128
+ risk explanation. The Tooltip supplements the visible marker; it does not
129
+ carry the only warning. Expose the same explanation on focus and in the
130
+ row/detail view for touch.
131
+ - State the concrete consequence, not a generic alarm. Use
132
+ `Danger — committed transactions can be lost after a crash`, not
133
+ `Unsafe setting`.
134
+ - Do not use `--color-danger` for ordinary negative numbers, nulls, or unknown
135
+ values. Danger describes consequence, not visual emphasis.
136
+
137
+ ```text
138
+ Setting Value Status
139
+ fsync off [Danger] Committed transactions can be lost after a crash.
140
+ ```
141
+
142
+ Here `off` remains selectable and copyable. Both the value and the `Danger`
143
+ marker use `--color-danger`; the marker's Tooltip repeats the concise risk,
144
+ and the detail view contains the same explanation.
145
+
146
+ ## Identifiers, code, and SQL
147
+
148
+ - Render machine-readable identifiers, hashes, connection strings, config
149
+ keys, inline code, and SQL with `--type-role-code` / `--font-mono`.
150
+ - Keep prose, labels, and ordinary numeric columns in their normal type roles.
151
+ Monospace marks machine-readable content; it is not a general "technical"
152
+ aesthetic.
153
+ - Use inline code for a value that fits in the surrounding sentence or cell.
154
+ Use a code block for multi-line SQL, logs, config, or any value where line
155
+ breaks and indentation matter.
156
+ - Code blocks use `--color-surface`, `--color-border`, `--radius-md`,
157
+ `--spacing-md`, and `--type-role-code`. Inline code uses
158
+ `--color-elevated-surface`, `--radius-sm`, horizontal `--spacing-xs`, and
159
+ `--type-role-code`.
160
+ - Preserve whitespace and allow horizontal scrolling in code blocks. Never
161
+ soft-wrap SQL in a way that changes where tokens appear; a product may offer
162
+ an explicit wrap toggle.
163
+ - Do not invent syntax colors. Syntax highlighting is deferred to v2. In v1,
164
+ render all code with `--color-foreground`; comments or secondary metadata
165
+ may use `--color-muted-foreground` only when they remain readable.
166
+
167
+ ```sql
168
+ SELECT pid, application_name, state
169
+ FROM pg_stat_activity
170
+ WHERE state <> 'idle'
171
+ ORDER BY pid;
172
+ ```
173
+
174
+ The block uses `--type-role-code` and preserves its line breaks. A one-line
175
+ cell containing `SELECT 1` uses the same role inline.
176
+
177
+ ## Truncation and full-value access
178
+
179
+ - Truncate only when a known width is necessary for comparison or layout.
180
+ Never truncate the key identifier if removing another column or allowing
181
+ horizontal scroll would preserve it.
182
+ - Truncate at the end with CSS `text-overflow: ellipsis`; do not truncate the
183
+ middle unless both prefix and suffix identify the value, as with hashes.
184
+ - Keep the underlying full string in the DOM or data model. Never replace it
185
+ with the displayed substring before copy, search, export, or accessibility
186
+ naming.
187
+ - A truncated value must have all three paths: visible ellipsis, full value in
188
+ [Tooltip](components/tooltip.md) on hover/focus, and a touch-safe full-value
189
+ path through row expansion or a detail view. Tooltip alone is insufficient.
190
+ - Give the truncated element keyboard focus only if focusing it reveals the
191
+ full value or it performs an action. Do not add inert tab stops merely to
192
+ show Tooltip; use the row/detail path instead.
193
+ - Preserve meaningful prefixes. For `postgresql://analytics…`, keep the scheme
194
+ and host start. For a hash, a deliberate middle form such as
195
+ `a13f92c1…7bd0` is allowed when the product consistently uses both ends for
196
+ recognition.
197
+
198
+ Example: a fixed-width connection column shows
199
+ `postgresql://analytics…`, its Tooltip shows the full URI, the row detail
200
+ shows the full URI on touch, and Copy copies the untruncated URI.
201
+
202
+ ## Copy to clipboard
203
+
204
+ - Provide copy for identifiers, hashes, connection strings, SQL queries,
205
+ config keys and values, and any machine-readable value a person is likely to
206
+ paste elsewhere.
207
+ - Use an `sm` [IconButton](components/icon-button.md) adjacent to a table value
208
+ and a labelled Button for a standalone code block. The IconButton accessible
209
+ name and Tooltip are `Copy {value type}`, for example `Copy connection
210
+ string`; never use the value itself as the control name.
211
+ - Copy the exact source value, not its truncated, rounded, localized, converted,
212
+ highlighted, or unit-decorated presentation. Copying `1.50 GiB` from a byte
213
+ field copies the documented source form, such as `1610612736 B`.
214
+ - On success, show [Toast](components/toast.md) with direct copy such as
215
+ `Connection string copied`. The Toast is confirmation, not the only state
216
+ change: change the IconButton accessible name to `Copied {value type}` for
217
+ the Toast duration.
218
+ - On failure, show an error Toast using what/why/now structure:
219
+ `Connection string was not copied. Clipboard access was blocked. Select the
220
+ value and copy it manually.` Keep the value selectable.
221
+ - Do not disable selection to force use of the copy control. Secret values
222
+ follow the product's authorization and reveal rules; never place an
223
+ unauthorized secret on the clipboard or in Tooltip content.
224
+
225
+ ```text
226
+ Query ID 01J8Y5R9Q2K6… [Copy query ID]
227
+ └─ copies 01J8Y5R9Q2K6W1N4C3T8M7B0P
228
+ ```
229
+
230
+ ## Value comparison
231
+
232
+ - Compare values in a stable `Before` / `After` order. Do not reverse the
233
+ columns between screens.
234
+ - Show the value and the change kind in text or iconography. Color is
235
+ reinforcement only: added uses `--color-success`, removed uses
236
+ `--color-danger`, and changed uses `--color-warning`.
237
+ - For a changed value, render both sides. Never show only the new value with a
238
+ "changed" badge. Use `Before: 100` and `After: 200`, or a two-column row.
239
+ - For added and removed values, use the missing side's explicit state:
240
+ `Not set` for configuration absence, or `NULL` when the underlying value is
241
+ SQL null. Do not use unknown `—` unless the side truly cannot be read.
242
+ - Apply the normal rules to both sides: identical units and precision,
243
+ tabular figures, code type for machine-readable values, and full-value copy.
244
+ - When comparing SQL or multi-line config, use a line diff with visible `+`
245
+ and `−` markers and accessible labels `Added line` and `Removed line`.
246
+ Preserve whitespace. Syntax highlighting remains deferred.
247
+
248
+ ```text
249
+ Setting Before After Change
250
+ max_connections 100 200 Changed
251
+ archive_mode off on Changed
252
+ application_name NULL momoi Added
253
+ ```
254
+
255
+ Numeric cells share one right edge and precision. `Changed` has a visible
256
+ label/icon in addition to `--color-warning`; `Added` has a visible label/icon
257
+ in addition to `--color-success`.
258
+
259
+ ## Responsive tables
260
+
261
+ Tables remain tables on small screens when comparison across rows and columns
262
+ is the task. Do not automatically turn each row into a card.
263
+
264
+ 1. Keep the row's key identifier and primary action visible. Make the key
265
+ identifier the first non-selection column and the primary action the last
266
+ column; either may be sticky when the table scrolls horizontally.
267
+ 2. Remove non-essential columns in a documented priority order. Hide
268
+ decorative/redundant metadata first, then secondary metadata. Never hide a
269
+ warning, danger marker, selection state, or the only representation of
270
+ null/unknown.
271
+ 3. Put hidden fields in progressive disclosure: row expansion, Drawer, or a
272
+ detail view reached by a visible control with an accessible name such as
273
+ `Show details for replica-01`.
274
+ 4. Allow horizontal scrolling when the remaining columns are all necessary
275
+ for comparison. Keep the header aligned with the body and expose the
276
+ scrollable region with an accessible label. Do not squeeze values until
277
+ they become ambiguous.
278
+ 5. On touch, replace hover-only discovery with visible controls. Full
279
+ truncated values and warning explanations must remain available through
280
+ expansion/detail; Tooltip is never the only path.
281
+
282
+ Example collapse order for a replica table:
283
+
284
+ | Priority | Wide table | Narrow table |
285
+ | --- | --- | --- |
286
+ | Required | Replica (key), status/danger, primary action | Stays visible |
287
+ | Comparison | Lag, connections | Stays visible while comparison remains usable; otherwise horizontal scroll |
288
+ | Secondary | Region, last sampled, engine version | Moves into row detail in that order |
289
+
290
+ The narrow table therefore keeps `Replica`, `Status`, `Lag`, and the primary
291
+ action. `Region`, `Last sampled`, and `Engine version` appear under `Show
292
+ details for {replica}`. A danger marker never moves out of the summary row.
293
+
294
+ ## Conformance checklist
295
+
296
+ A data-heavy surface conforms only when all applicable answers are yes:
297
+
298
+ - Are numeric quantities and headers right-aligned with
299
+ `--type-role-numeric` and `--font-variant-numeric`?
300
+ - Does one comparison group use one unit and precision?
301
+ - Are `NULL`, `0`, and unknown `—` rendered as three distinct states?
302
+ - Are warning and danger visible without relying on color or Tooltip?
303
+ - Can every truncated value be reached in full on pointer, keyboard, and
304
+ touch, and does copy use the full source value?
305
+ - Do machine-readable values use `--type-role-code` / `--font-mono` while
306
+ ordinary numbers remain in the numeric role?
307
+ - Do comparisons show both sides and name added, removed, or changed?
308
+ - Does the narrow table retain the key identifier, primary action, and every
309
+ warning/danger state while progressively disclosing secondary columns?
@@ -0,0 +1,35 @@
1
+ # Kiso evolution
2
+
3
+ Kiso v1 is deliberately small and spec-first. The items below are not missing
4
+ work: they are choices postponed until a real product provides evidence that
5
+ the system needs them. This is the honest roadmap for those choices.
6
+
7
+ ## Deliberate v1 deferrals
8
+
9
+ | What | Why it is deferred | When to reconsider |
10
+ | --- | --- | --- |
11
+ | **Component implementation code** | V1 ships Markdown contracts and tokens, not React components. Keeping the specification separate lets product needs shape an implementation instead of freezing an assumed API. This boundary was set in [epic #3](https://github.com/momoi-labs/blueprint/issues/3). | When repeated product implementations make a stable reference API evident. Build it as Kiso v2 or in a separate `kiso-ui` repository, using shadcn/Radix behavior adapted to Kiso rather than copied unchanged. |
12
+ | **Radio / RadioGroup** | Select and Switch cover the v1 choice cases, so [epic #3](https://github.com/momoi-labs/blueprint/issues/3) did not add another selection primitive without a product need. | When a product genuinely needs mutually exclusive selection from a small, fixed set whose options should remain visible. |
13
+ | **Charts and graphs** | V1 has no chart component or data-visualization pattern because [epic #3](https://github.com/momoi-labs/blueprint/issues/3) had no concrete visualization case to design for. | When a product needs metric visualization, likely a DB or infrastructure tool with a dashboard. Start from that product's data, tasks, and accessibility requirements. |
14
+ | **Figma Tokens Studio integration** | [Epic #2](https://github.com/momoi-labs/blueprint/issues/2) kept the token pipeline focused on its committed outputs. Tokens Studio is a Figma plugin workflow built through Style Dictionary and `@tokens-studio/sd-transforms`, not a standalone emitter. | When design-to-code synchronization through Figma becomes a real team workflow rather than a hypothetical integration. |
15
+ | **DTCG 2025.10 Resolver module** | The multiple-context and theme Resolver considered in [epic #2](https://github.com/momoi-labs/blueprint/issues/2) is a preview draft marked “do not implement.” V1 uses an explicit, stable theme model instead. | When the Resolver module reaches stable status and Kiso has a concrete context or theme problem it would solve. |
16
+ | **`--shadow-lg`** | The elevation scale intentionally stops at `--shadow-sm` and `--shadow-md`; [#25](https://github.com/momoi-labs/blueprint/issues/25) fixed component references without inventing a larger elevation. | When a real overlay or hierarchy cannot be expressed clearly with `--shadow-md`. Propose the token in the source, then regenerate its outputs. |
17
+ | **A dedicated multi-step-flow pattern** | [#26](https://github.com/momoi-labs/blueprint/issues/26) added step indication as a Pagination variant, which satisfies the current bounded-flow need without another pattern. | When recurring multi-step flows need behavior, composition, or guidance beyond Pagination's scope. |
18
+ | **Additional patterns** | The pattern set from [epic #4](https://github.com/momoi-labs/blueprint/issues/4) is an intentionally lean cut of roughly 21 recurring product structures. Speculative completeness would encode guesses. | When a real product exposes a repeated structure that the current patterns cannot express without an ad-hoc solution. |
19
+ | **Additional components** | The roughly 28-component cut from [epic #3](https://github.com/momoi-labs/blueprint/issues/3) covers the intended v1 product surface. Adding primitives in anticipation would enlarge the interface before their contracts are understood. | When a need recurs across products. Propose a component and its contract; do not invent one locally or copy one in unchanged. |
20
+ | **Heavy governance** | A two-person lab does not need a contribution bureaucracy or design-review board. For v1, the propose-don't-copy rule in [`kiso/AGENTS.md`](../AGENTS.md) is the governance mechanism, as scoped by [epic #5](https://github.com/momoi-labs/blueprint/issues/5). | When more contributors, products, or incompatible proposals make ownership and decision-making unclear. Add only the process needed to resolve an observed coordination problem. |
21
+
22
+ ## Growth model: grow with real products
23
+
24
+ Kiso is not an abstract design-system project. It evolves through product work:
25
+
26
+ 1. Build the next real product with Kiso.
27
+ 2. Observe what works and what is missing.
28
+ 3. Identify gaps, without filling them with ad-hoc components or patterns.
29
+ 4. Incorporate needs that recur into Kiso as documented contracts.
30
+ 5. Evolve toward v2 from that evidence, not from speculation.
31
+
32
+ A one-off need may remain a documented product exception. Repetition is the
33
+ signal to propose a system addition; it is not permission to copy an external
34
+ component into Kiso. The rule and proposal path belong in
35
+ [`kiso/AGENTS.md`](../AGENTS.md).
@@ -0,0 +1,40 @@
1
+ # Kiso pattern catalog
2
+
3
+ Kiso patterns are reusable screen-level compositions of the component catalog.
4
+ They define placement, flow, and states without redefining components. A list
5
+ screen must not reinvent search, filters, pagination, and empty state; compose
6
+ the patterns below instead.
7
+
8
+ ## Layout
9
+
10
+ - [Application shell](application-shell.md) — Frames every product with persistent header, sidebar, and main content regions.
11
+ - [List-detail](list-detail.md) — Keeps a collection and the selected record in one navigable context.
12
+ - [CRUD](crud.md) — Coordinates consistent create, read, update, and delete flows and states.
13
+ - [Dashboard](dashboard.md) — Arranges dense, independently loading widgets with clear hierarchy and drill-down.
14
+ - [Settings](settings.md) — Structures configuration forms, save behavior, validation, and feedback.
15
+ - [Login and authentication](login-authentication.md) — Guides sign-in, recovery, SSO, failure, and successful entry.
16
+
17
+ ## State
18
+
19
+ - [Empty states](empty-states.md) — Distinguishes first use, no matches, and informational emptiness with an appropriate next action.
20
+ - [Loading](loading.md) — Preserves known structure and context while work is in progress.
21
+ - [Errors](errors.md) — Explains what happened, why when known, and what the person can do now.
22
+ - [Permission denied](permission-denied.md) — Treats missing access as a distinct state with a path to request it.
23
+ - [Onboarding](onboarding.md) — Leads a new user through initial setup while preserving progress and recovery.
24
+
25
+ ## Behavior
26
+
27
+ - [Search](search.md) — Narrows a visible collection with consistent query, shortcut, highlighting, and no-results behavior.
28
+ - [Filtering](filtering.md) — Narrows a collection by explicit facets with visible, removable filter state.
29
+ - [Sorting](sorting.md) — Orders a searched or filtered set with consistent controls and indicators.
30
+ - [Pagination](pagination.md) — Navigates known, bounded datasets while preserving list context.
31
+ - [Large data tables](large-data-tables.md) — Combines sticky headers, virtualization or pagination, responsive behavior, and canonical cell rendering.
32
+ - [Destructive actions](destructive-actions.md) — Gates irreversible actions behind a clear consequence and mandatory confirmation.
33
+ - [Confirmations](confirmations.md) — Defines consequence copy, focus, cancellation, and acknowledgment for consequential actions.
34
+ - [Command palette](command-palette.md) — Provides keyboard-first global navigation and action execution without bypassing safety gates.
35
+ - [Keyboard shortcuts](keyboard-shortcuts.md) — Makes shortcuts consistent, discoverable, conflict-safe, and accessible.
36
+ - [Developer-oriented interfaces](developer-oriented-interfaces.md) — Supports friendly and exact raw representations without losing technical fidelity.
37
+
38
+ ## Data-heavy interfaces
39
+
40
+ - [Data interfaces](../data-interfaces.md) — Prescribes alignment, units, missing values, warnings, dangerous values, code, truncation, copying, comparisons, and responsive tables.
@@ -0,0 +1,106 @@
1
+ # Application shell
2
+
3
+ The persistent skeleton of every authenticated Momoi product: Header, Sidebar,
4
+ and a main content region. Page-level patterns (list-detail, CRUD, dashboard,
5
+ settings) render inside main — they do not reinvent chrome.
6
+
7
+ User story #28.
8
+
9
+ ## Purpose
10
+
11
+ Give every product the same wayfinding frame so people always know where they
12
+ are and how to reach another destination. The shell owns product identity,
13
+ primary destinations, and global actions. It does not own page titles, page
14
+ actions, or collection behavior.
15
+
16
+ ## Component composition
17
+
18
+ | Region | Compose with | Role |
19
+ | --- | --- | --- |
20
+ | Top chrome | [Header](../components/header.md) | Brand/home [Link](../components/link.md), optional primary [Navigation](../components/navigation.md), global [IconButton](../components/icon-button.md) / [DropdownMenu](../components/dropdown-menu.md) |
21
+ | Side chrome | [Sidebar](../components/sidebar.md) | Persistent product destinations via Navigation Links; optional collapse [IconButton](../components/icon-button.md) |
22
+ | Main | page content | Routed page patterns; starts with [PageHeader](../components/page-header.md) unless the page pattern specifies otherwise |
23
+ | Global jump | [CommandPalette](../components/command-palette.md) | Optional app-wide search/actions; triggered from Header or keyboard — not a Sidebar substitute |
24
+
25
+ Do not place page-scoped create/edit Buttons in Header. Those belong in
26
+ PageHeader or the page pattern. Do not nest a second Header or Sidebar inside
27
+ main.
28
+
29
+ Tokens: shell surfaces use `--color-background` for the canvas,
30
+ `--color-surface` and `--color-border` for Header/Sidebar, and
31
+ `--color-foreground` / `--color-primary` for chrome text and current
32
+ destinations. Focus rings use `--color-focus`.
33
+
34
+ ## Flow
35
+
36
+ 1. Person lands on an authenticated route.
37
+ 2. Shell renders Header + Sidebar + main; Sidebar marks the current destination
38
+ with `aria-current="page"`.
39
+ 3. Main loads the page pattern for the route (for example list-detail).
40
+ 4. Navigating a Sidebar or Header Link swaps only main content; chrome stays
41
+ mounted unless the destination leaves the authenticated app (for example
42
+ sign-out → [login/authentication](login-authentication.md)).
43
+ 5. Narrow viewports: Sidebar collapses per its component contract; Header keeps
44
+ brand/home and essential global actions.
45
+
46
+ ## States
47
+
48
+ | State | Behavior |
49
+ | --- | --- |
50
+ | default | Header, Sidebar, and main are visible; current nav item is marked. |
51
+ | loading (main) | Chrome stays; main shows the page pattern's loading treatment (usually [Skeleton](../components/skeleton.md) for known layout). Do not replace the whole shell with a full-page [Spinner](../components/spinner.md). |
52
+ | empty (main) | Chrome stays; the page pattern owns [EmptyState](../components/empty-state.md) inside main. |
53
+ | error (main) | Chrome stays; the page pattern shows [Alert](../components/alert.md) (what / why / now per [voice-and-tone](../voice-and-tone.md)). Shell navigation remains usable so the person can leave the broken view. |
54
+ | Sidebar collapsed | Compact navigation per the Sidebar contract. |
55
+ | unauthorized route | Prefer redirect or an in-main explanation of what is blocked; do not silently strip Sidebar destinations without explanation. |
56
+
57
+ ## Layout sketch
58
+
59
+ ```text
60
+ ┌──────────────────────────────────────────────────────────────────────┐
61
+ │ Header │
62
+ │ [Brand Link] (optional top Nav Links) [⌘K] [?] [Account ▾] │
63
+ ├────────────────┬─────────────────────────────────────────────────────┤
64
+ │ Sidebar │ Main │
65
+ │ │ ┌─────────────────────────────────────────────────┐ │
66
+ │ Overview │ │ PageHeader │ │
67
+ │ Connections ● │ │ Title [Primary Button] │ │
68
+ │ Queries │ └─────────────────────────────────────────────────┘ │
69
+ │ Settings │ │
70
+ │ │ (page pattern: list-detail / CRUD / dashboard / │
71
+ │ │ settings — not shell chrome) │
72
+ │ │ │
73
+ │ │ --color-background canvas │
74
+ │ │ content on --color-surface as the page needs │
75
+ └────────────────┴─────────────────────────────────────────────────────┘
76
+ ```
77
+
78
+ Narrow viewport (Sidebar collapsed):
79
+
80
+ ```text
81
+ ┌────────────────────────────────────────┐
82
+ │ Header [Brand] [☰] [Account] │
83
+ ├────────────────────────────────────────┤
84
+ │ Main │
85
+ │ PageHeader + page pattern │
86
+ └────────────────────────────────────────┘
87
+ ```
88
+
89
+ ## When to use
90
+
91
+ - Every authenticated Momoi product screen that participates in primary
92
+ product navigation.
93
+
94
+ ## When NOT to use
95
+
96
+ - Pre-auth screens ([login/authentication](login-authentication.md)) — no
97
+ product Sidebar.
98
+ - Focused full-bleed tasks that intentionally leave product chrome (rare;
99
+ document the exception).
100
+ - Marketing or docs sites outside the product shell.
101
+
102
+ ## Related patterns
103
+
104
+ - [List-detail](list-detail.md), [CRUD](crud.md), [Dashboard](dashboard.md),
105
+ [Settings](settings.md) — render inside main.
106
+ - [Login / authentication](login-authentication.md) — outside this shell.