@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Momoi Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Momoi Labs Blueprint
2
+
3
+ > The shared foundation every Momoi Labs project builds on — a **design
4
+ > system** (Kiso), a **log format**, and the engineering standards that keep
5
+ > the studio's output consistent, recognizable, and fast to start.
6
+
7
+ **Blueprint** is the "floor plan" of the house. It stays deliberately small: a
8
+ pillar is added only when a real project needs it, and each pillar is a single
9
+ source of truth that everything else generates from — never a copy.
10
+
11
+ ## Status
12
+
13
+ | Pillar | What it defines | Status |
14
+ | --- | --- | --- |
15
+ | **Design system** — *Kiso* | brand, tokens, component contracts, product patterns, accessibility | ✅ v1 complete (#1–#5) |
16
+ | **Log format** | one structured JSON shape, levels, privacy rules | 🚧 epic planned |
17
+ | **Code standards** | commits, branches, per-language lint/format | 🔜 later |
18
+ | **Governance** | issue/PR templates, CONTRIBUTING, code of conduct | 🔜 later |
19
+
20
+ ## Design system — Kiso
21
+
22
+ **Kiso** (基礎, "foundation") is Momoi Labs' design system for *products* — not
23
+ the marketing site. The marketing site ([momoi-labs.dev](https://momoi-labs.dev))
24
+ is a vibe reference; product UI borrows its spirit, not its literal surface.
25
+
26
+ Kiso v1 is complete and ready to consume. Start with the
27
+ [Kiso entry point](kiso/README.md); agents must also follow the scoped
28
+ [consumption rules](kiso/AGENTS.md). The system includes its conceptual
29
+ foundation, machine-readable tokens and generated CSS, component contracts,
30
+ product patterns, data-interface guidance, and cross-layer accessibility rules.
31
+
32
+ - Dark theme by default, light ("slate") as the alternate
33
+ - Neutrals carry the interface; one accent carries attention
34
+ - Inter for interface text, JetBrains Mono for code
35
+
36
+ ## Log format
37
+
38
+ One structured JSON shape across every service, so logs correlate, filter, and
39
+ read the same everywhere. The format and its rationale — levels, `trace_id`,
40
+ privacy rules — are specified in their own epic.
41
+
42
+ ## Roadmap
43
+
44
+ The design system and log format pillars are driven by GitHub epics:
45
+
46
+ 1. ~~**Brand and principles**~~ ✅ — brand, principles, and voice in
47
+ [#1](https://github.com/momoi-labs/blueprint/issues/1).
48
+ 2. ~~**Design tokens**~~ ✅ — WCAG AA-calibrated semantic tokens and generated
49
+ CSS in [#2](https://github.com/momoi-labs/blueprint/issues/2).
50
+ 3. ~~**Component contracts**~~ ✅ — the spec-first component catalog in
51
+ [#3](https://github.com/momoi-labs/blueprint/issues/3).
52
+ 4. ~~**Product patterns**~~ ✅ — screen compositions and data-heavy interface
53
+ guidance in [#4](https://github.com/momoi-labs/blueprint/issues/4).
54
+ 5. ~~**Consumption layer**~~ ✅ — agent rules, entry point, accessibility, and
55
+ evolution guidance in [#5](https://github.com/momoi-labs/blueprint/issues/5).
56
+ 6. **Log format** — the shape, examples of use, and the reasoning behind it.
57
+
58
+ ## License
59
+
60
+ Code, config, and templates: **MIT**. Brand assets (name, logo, type):
61
+ **CC BY 4.0** — brand usage rules live in [`kiso/docs/brand.md`](kiso/docs/brand.md).
62
+
63
+ © 2026 Momoi Labs — [momoi-labs.dev](https://momoi-labs.dev)
package/kiso/AGENTS.md ADDED
@@ -0,0 +1,50 @@
1
+ # Kiso consumption rules
2
+
3
+ These instructions govern how agents consume Kiso when designing or building
4
+ Momoi Labs product interfaces. Engineering rules remain in the repository root
5
+ [`AGENTS.md`](../AGENTS.md).
6
+
7
+ Read [`README.md`](README.md) for the system map, then consult the relevant
8
+ token, component, and pattern contracts before making interface decisions.
9
+
10
+ ## Hard rules
11
+
12
+ 1. **Before creating a new component, check whether Kiso already has a
13
+ component or pattern that solves the problem.** Start with the
14
+ [component catalog](docs/components/README.md) and
15
+ [pattern catalog](docs/patterns/README.md).
16
+ 2. **Do not introduce ad-hoc colors, spacing, radius, typography, or
17
+ interaction patterns if an equivalent token or pattern already exists.**
18
+ Use the documented [tokens](docs/tokens.md) and existing contracts. A
19
+ convenient local default is not permission to fork the system.
20
+ 3. **When a new need arises repeatedly, propose its incorporation into Kiso
21
+ rather than copying it independently across applications.** Record the need
22
+ and evidence so the system can evolve from real product work.
23
+
24
+ ## Decision boundary
25
+
26
+ | May decide alone | Must not decide alone |
27
+ | --- | --- |
28
+ | Layout details within the constraints of an existing pattern | Add or change a token |
29
+ | Product copy that follows the [voice and tone](docs/voice-and-tone.md) rules | Add or change a component contract |
30
+ | Which existing component, pattern, or semantic token best fits the documented need | Add or change a pattern contract |
31
+ | Responsive composition when the relevant contracts leave the choice open | Deviate from the [accessibility rules](docs/accessibility.md) |
32
+
33
+ For a decision in the right-hand column, stop and propose the change instead
34
+ of silently implementing it. A one-off product exception must be explicit and
35
+ documented; it does not become Kiso by repetition or copy-paste.
36
+
37
+ ## Consumption sequence
38
+
39
+ 1. Identify the product task and required states.
40
+ 2. Choose the closest existing [pattern](docs/patterns/README.md).
41
+ 3. Compose it from documented [components](docs/components/README.md).
42
+ 4. Apply semantic [tokens](docs/tokens.md), not raw visual values.
43
+ 5. Apply [voice and tone](docs/voice-and-tone.md) and
44
+ [accessibility](docs/accessibility.md) requirements.
45
+ 6. If no contract fits, describe the gap and propose an addition. Do not
46
+ create a parallel local system.
47
+
48
+ Kiso is spec-first: its Markdown files are contracts, not implementation code.
49
+ Deliberate omissions and the evidence-based growth model are recorded in
50
+ [`docs/evolution.md`](docs/evolution.md).
package/kiso/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Kiso
2
+
3
+ Kiso is the Momoi Labs product design system. It combines product identity,
4
+ semantic tokens, component contracts, and reusable screen patterns so products
5
+ with different purposes still belong to the same family. Kiso v1 is spec-first:
6
+ it documents what to build and how it behaves; it does not ship component
7
+ implementation code.
8
+
9
+ ## For agents
10
+
11
+ Read [`AGENTS.md`](AGENTS.md) before designing or implementing an interface.
12
+ It defines the reuse rules, the decisions you may make alone, and the changes
13
+ you must propose rather than invent locally.
14
+
15
+ Use this path through the system:
16
+
17
+ 1. Understand the [brand](docs/brand.md), [principles](docs/principles.md), and
18
+ [voice and tone](docs/voice-and-tone.md).
19
+ 2. Select a screen-level composition from the
20
+ [pattern catalog](docs/patterns/README.md).
21
+ 3. Compose it with contracts from the
22
+ [component catalog](docs/components/README.md).
23
+ 4. Apply the semantic values documented in [tokens](docs/tokens.md).
24
+ 5. Verify the cross-layer [accessibility rules](docs/accessibility.md).
25
+ 6. For dense technical products, also follow
26
+ [data-interface guidance](docs/data-interfaces.md).
27
+
28
+ ## For humans
29
+
30
+ Start with the conceptual documents to understand what makes a product feel
31
+ like Momoi Labs. Browse the component catalog for individual UI contracts and
32
+ the pattern catalog for complete flows and screen compositions. Each component
33
+ document covers anatomy, states, accessibility, usage, and token consumption;
34
+ each pattern document covers composition, behavior, responsive rules, and
35
+ keyboard flow where relevant.
36
+
37
+ ## Directory map
38
+
39
+ | Path | Purpose |
40
+ | --- | --- |
41
+ | [`AGENTS.md`](AGENTS.md) | Consumption contract and decision boundaries |
42
+ | [`docs/brand.md`](docs/brand.md) | Product personality and visual direction |
43
+ | [`docs/principles.md`](docs/principles.md) | Design principles and tie-breakers |
44
+ | [`docs/voice-and-tone.md`](docs/voice-and-tone.md) | Product UI copy rules |
45
+ | [`docs/tokens.md`](docs/tokens.md) | Semantic token model and generated outputs |
46
+ | [`docs/components/`](docs/components/README.md) | Component contracts and catalog |
47
+ | [`docs/patterns/`](docs/patterns/README.md) | Screen and behavior patterns |
48
+ | [`docs/data-interfaces.md`](docs/data-interfaces.md) | Data-heavy interface rules |
49
+ | [`docs/accessibility.md`](docs/accessibility.md) | Accessibility requirements across all layers |
50
+ | [`docs/evolution.md`](docs/evolution.md) | Deliberate deferrals and evidence-based growth |
51
+
52
+ Token sources and generated artifacts live in the repository-level `tokens/`
53
+ directory; validation scripts live in `scripts/`.
54
+
55
+ ## Proposing a change
56
+
57
+ First confirm that an existing token, component, or pattern cannot express the
58
+ need. Then capture the product case, the limitation in the current contract,
59
+ and evidence that the need recurs. Propose the smallest system-level addition
60
+ instead of copying a local solution between applications. See
61
+ [`docs/evolution.md`](docs/evolution.md) for what v1 deliberately defers and
62
+ when those decisions should be reconsidered.
@@ -0,0 +1,87 @@
1
+ # Accessibility
2
+
3
+ Accessibility is a requirement at every Kiso layer, not a final review step.
4
+ An implementation is incomplete if it cannot be understood and operated with
5
+ a keyboard, screen reader, touch input, or reduced-motion preference.
6
+
7
+ ## Tokens
8
+
9
+ - Use semantic color tokens documented in [`tokens.md`](tokens.md); do not
10
+ substitute raw colors or infer contrast from appearance.
11
+ - Text and meaningful graphical controls must meet the applicable WCAG AA
12
+ contrast requirement in every supported state, including hover, focus,
13
+ disabled, selected, warning, and error states.
14
+ - Run `node scripts/check-contrast.mjs` after token changes. The contrast gate
15
+ validates the committed foreground/background pairs, but it does not excuse
16
+ checking new product compositions or non-text contrast.
17
+ - Do not communicate meaning with color alone. Pair status and errors with
18
+ text, an icon with an accessible name, or another programmatic cue.
19
+ - Respect `prefers-reduced-motion`. Remove nonessential movement and replace
20
+ essential transitions with an immediate or substantially reduced alternative.
21
+
22
+ ## Components
23
+
24
+ - Start with native semantic HTML. Add ARIA only when native semantics cannot
25
+ express the required behavior; ARIA does not repair incorrect interaction.
26
+ - Follow the **Accessibility** section in every
27
+ [component contract](components/README.md). It is the source of truth for
28
+ roles, accessible names, state attributes, focus behavior, and keystrokes.
29
+ - Every interactive element must be reachable and operable by keyboard, with a
30
+ visible focus indicator. Keep focus order aligned with reading and visual
31
+ order; do not use positive `tabindex` values.
32
+ - Interactive touch targets must be at least 44 by 44 CSS pixels. A visible
33
+ control may be smaller only when its interactive hit area reaches that size
34
+ without overlapping another target.
35
+ - Give icon-only controls an accessible name. Decorative icons must be hidden
36
+ from assistive technology.
37
+
38
+ ## Patterns and focus flows
39
+
40
+ - Follow the keyboard and focus flow in the relevant
41
+ [pattern contract](patterns/README.md); do not invent a competing shortcut or
42
+ navigation model locally.
43
+ - When opening a modal surface, move focus into it, contain focus while it is
44
+ active, support `Escape` when dismissal is allowed, and restore focus to the
45
+ trigger when it closes. Use the component contract for exact behavior.
46
+ - On route or major view changes, place focus at the start of the new content or
47
+ announce the change as appropriate. Do not leave focus on an element that no
48
+ longer exists.
49
+ - Keyboard shortcuts must not override browser or assistive-technology
50
+ commands. Make nonstandard shortcuts discoverable and provide an equivalent
51
+ visible action.
52
+
53
+ ## Content, errors, and updates
54
+
55
+ - Preserve a logical heading hierarchy, landmarks, lists, tables, labels, and
56
+ relationships in the HTML. Visual arrangement is not a semantic structure.
57
+ - Associate every form control with a visible label and its instructions.
58
+ Identify required fields in text or programmatically, not by color alone.
59
+ - Error messages must state what happened and what to do next, following
60
+ [`voice-and-tone.md`](voice-and-tone.md). Associate field errors with their
61
+ controls, set the invalid state programmatically, and move or summarize focus
62
+ so a failed submission is discoverable without scanning the page.
63
+ - Announce asynchronous status changes with the least disruptive suitable live
64
+ region. Do not move focus merely to announce success, loading, or background
65
+ updates.
66
+ - Data tables must retain native table relationships and accessible headers.
67
+ Use the [Table contract](components/table.md), relevant
68
+ [data-interface guidance](data-interfaces.md), and the
69
+ [large-data-table pattern](patterns/large-data-tables.md).
70
+
71
+ ## Verification before merge
72
+
73
+ 1. Navigate the complete flow using only the keyboard, including cancellation,
74
+ recovery, and destructive-action paths.
75
+ 2. Check focus visibility, order, containment, and restoration.
76
+ 3. Test names, roles, states, labels, errors, and dynamic updates with a screen
77
+ reader.
78
+ 4. Verify text and non-text contrast in every state and run the token contrast
79
+ gate when tokens are involved.
80
+ 5. Enable reduced motion and confirm no essential information depends on
81
+ animation.
82
+ 6. Check touch targets at narrow viewports and zoom the interface to 200%
83
+ without losing content or operation.
84
+
85
+ When an existing contract conflicts with these rules, do not silently deviate.
86
+ Document the conflict and propose a Kiso change under the decision boundary in
87
+ [`../AGENTS.md`](../AGENTS.md).
@@ -0,0 +1,95 @@
1
+ # Brand — Momoi Labs Product Identity
2
+
3
+ Kiso (基礎, "foundation") is Momoi Labs' design system for **products**. This
4
+ document defines what "Momoi" means visually in a product interface — the
5
+ personality that every screen inherits.
6
+
7
+ It is **not** the marketing brand. The marketing site (momoi-labs.dev) has its
8
+ own brand assets, logo usage, and experimental aesthetics. Kiso borrows the
9
+ *spirit* of the site, not its literal surface.
10
+
11
+ ## Personality
12
+
13
+ Momoi's product identity is **practical, technical, open, calm, precise,
14
+ useful, curious, human, understated.**
15
+
16
+ | Trait | What it means in a product UI |
17
+ | --- | --- |
18
+ | **Practical** | Every element serves a purpose. Nothing is there just to look good. |
19
+ | **Technical** | Comfortable with dense data, monospace, and precise values. Speaks the developer's language. |
20
+ | **Open** | Transparent about what the system is doing. No hidden state, no mystery. |
21
+ | **Calm** | Low visual noise. Whitespace and hierarchy do the work, not color shouting. |
22
+ | **Precise** | Exact labels, exact values, exact states. "About 3" is not a Momoi number unless the data is genuinely approximate. |
23
+ | **Useful** | The interface helps you do something. Decoration that does not help is removed. |
24
+ | **Curious** | Invites exploration and experimentation, especially in small experimental products. |
25
+ | **Human** | Written by two people, not a committee. The voice acknowledges humans built and use this. |
26
+ | **Understated** | Confident enough not to show off. Lets the work speak. |
27
+
28
+ ## What Momoi is not
29
+
30
+ - **Corporate.** No enterprise-flat, no stock-photo warmth, no "powered by"
31
+ flourishes.
32
+ - **Marketing-heavy.** No hero gradients, no call-to-action urgency, no
33
+ growth-hack copy in the product.
34
+ - **Flashy.** No gratuitous animation, no neon accents, no decorative
35
+ glassmorphism. Motion serves feedback, not delight for its own sake.
36
+
37
+ ## Relationship to the marketing site
38
+
39
+ The marketing site has a **terminal aesthetic**: dark background, monospace
40
+ accents, terminal-flavored copy ("~/ABOUT" navigation, "$ export THEME=light"
41
+ theme toggle, "Small, unfinished, useful.").
42
+
43
+ For products, the site is a **vibe reference, not a literal spec**:
44
+
45
+ - **Extract:** the directness, the structure, the comfort with technical
46
+ language, the understated confidence.
47
+ - **Tone down:** the literal terminal flourish. Product UI does not prefix
48
+ navigation with "~/" or frame actions as shell commands. Directness and
49
+ structure are universal; terminal flourish is reserved for chrome and
50
+ metadata only (see [voice-and-tone.md](./voice-and-tone.md)).
51
+
52
+ The site is more experimental than products need to be. Products are lived in;
53
+ the site is visited.
54
+
55
+ ## Accessibility
56
+
57
+ Product UIs must meet **WCAG AA** contrast for all text. The marketing site's
58
+ violet accent (`#9184d9`) is acknowledged as insufficient for normal text
59
+ against the site's dark background (~3.8:1). This is acceptable for the
60
+ marketing site's experimental surface but **not** for products.
61
+
62
+ Kiso's token palette (a later epic) calibrates neutrals and accent to AA-safe
63
+ levels. The brand commitment — accessible contrast as a default, not an
64
+ afterthought — starts here.
65
+
66
+ ## Palette direction (conceptual, not values)
67
+
68
+ Kiso's palette is dark-first, with a light alternate, mirroring the marketing
69
+ site's spirit:
70
+
71
+ - **Dark theme** is the default product surface.
72
+ - **Light theme** ("slate") is a first-class alternate, not an afterthought.
73
+ - **Neutrals** carry the interface; one **accent** carries attention.
74
+ - **Inter** for interface text, **JetBrains Mono** for code and data values.
75
+
76
+ Exact token values land in the tokens epic. The brand direction: a calm,
77
+ high-contrast dark surface where one accent does focused work.
78
+
79
+ ## When this document is the authority
80
+
81
+ Use this document when:
82
+
83
+ - Deciding whether a UI element "feels Momoi."
84
+ - Choosing between two visual directions and needing a tie-breaker grounded in
85
+ personality.
86
+ - Onboarding a new product or screen to the Momoi product family.
87
+
88
+ For *design rules* (useful over decorative, clarity over cleverness, etc.), see
89
+ [principles.md](./principles.md). For *how copy sounds*, see
90
+ [voice-and-tone.md](./voice-and-tone.md).
91
+
92
+ ---
93
+
94
+ *Small lab, not a 200-person design team. Keep this short. Grow it through real
95
+ product use.*
@@ -0,0 +1,58 @@
1
+ # Kiso component catalog
2
+
3
+ Kiso defines product UI as markdown contracts rather than implementation code.
4
+ Each contract specifies anatomy, states, accessibility, usage guidance, semantic
5
+ token consumption, and a Radix/shadcn behavioral reference where one exists.
6
+
7
+ ## Nucleus
8
+
9
+ - [Alert](alert.md) — Communicates persistent in-page information, success, warnings, or errors.
10
+ - [Badge](badge.md) — Labels status or compact metadata without becoming an action.
11
+ - [Button](button.md) — Triggers a visible, text-labeled action without changing the URL.
12
+ - [Card](card.md) — Groups related content and actions with visual separation.
13
+ - [Checkbox](checkbox.md) — Toggles an option in a list or selects multiple values.
14
+ - [FormField](form-field.md) — Composes Label, a form control, HelperText, and ValidationMessage with consistent ID and ARIA wiring.
15
+ - [HelperText](helper-text.md) — Provides persistent, non-error context for a form control.
16
+ - [IconButton](icon-button.md) — Triggers a compact icon-only action with a required accessible name.
17
+ - [Input](input.md) — Collects a single-line text-like value.
18
+ - [Label](label.md) — Gives a form control its visible, programmatically associated name.
19
+ - [Link](link.md) — Navigates to a URL while preserving native link behavior.
20
+ - [Select](select.md) — Chooses one value from a predefined set of options.
21
+ - [Skeleton](skeleton.md) — Preserves known layout while its content is loading.
22
+ - [Spinner](spinner.md) — Signals indeterminate work when the final layout is not represented.
23
+ - [Switch](switch.md) — Changes one immediately applied boolean setting.
24
+ - [Textarea](textarea.md) — Collects multi-line free-form text.
25
+ - [Tooltip](tooltip.md) — Adds nonessential pointer or keyboard context as progressive enhancement.
26
+ - [ValidationMessage](validation-message.md) — Explains a field-level validation error and how to fix it.
27
+
28
+ ## Data
29
+
30
+ - [CommandPalette](command-palette.md) — Searches and runs global actions or navigation from a keyboard-first overlay.
31
+ - [DropdownMenu](dropdown-menu.md) — Presents contextual actions anchored to a specific object or trigger.
32
+ - [EmptyState](empty-state.md) — Replaces an empty collection with an explanation and optional next action.
33
+ - [Search](search.md) — Filters visible content such as a list or table.
34
+ - [Table / DataTable](table.md) — Presents structured records with optional sorting, selection, filtering, and pagination.
35
+
36
+ ## Navigation and structure
37
+
38
+ - [Breadcrumb](breadcrumb.md) — Shows the current location within a hierarchy.
39
+ - [Header](header.md) — Composes persistent application navigation and global actions.
40
+ - [Navigation](navigation.md) — Provides a generic semantic container for destination links.
41
+ - [PageHeader](page-header.md) — Composes a page title, optional subtitle, and page-scoped action Buttons.
42
+ - [Pagination](pagination.md) — Moves through known pages while exposing the current position.
43
+ - [Sidebar](sidebar.md) — Organizes persistent navigation into optionally collapsible sections.
44
+ - [Tabs](tabs.md) — Switches among related content panels within the same page context.
45
+
46
+ ## Overlay
47
+
48
+ - [Drawer](drawer.md) — Presents a viewport-adaptive panel, including a mobile alternative to Modal/Dialog.
49
+ - [Modal / Dialog](modal-dialog.md) — Blocks the page for a focused task that requires attention or a decision.
50
+ - [Popover](popover.md) — Shows rich, interactive contextual content anchored to a trigger.
51
+ - [Toast](toast.md) — Reports transient system feedback without replacing in-page status or field errors.
52
+
53
+ ## Required compositions
54
+
55
+ - [FormField](form-field.md) composes [Label](label.md) + [Input](input.md) (or another form control) + [HelperText](helper-text.md) + [ValidationMessage](validation-message.md).
56
+ - [Header](header.md) composes [Link](link.md) + [IconButton](icon-button.md) + optional [DropdownMenu](dropdown-menu.md).
57
+ - [Table / DataTable](table.md) composes [EmptyState](empty-state.md), [Skeleton](skeleton.md), and [Pagination](pagination.md) for empty, loading, and paged states.
58
+ - [PageHeader](page-header.md) composes a title + optional subtitle + [Buttons](button.md).
@@ -0,0 +1,158 @@
1
+ # Alert
2
+
3
+ An in-page message about a condition the person should see in context.
4
+ Severity is explicit. It stays until dismissed or until the condition ends.
5
+
6
+ ## Purpose
7
+
8
+ Alert explains something about *this view*: a failed load, a degraded
9
+ replica, a successful save that still needs a next step, a warning before
10
+ continuing. It sits in the page flow, not in a corner toast and not on a
11
+ single form field.
12
+
13
+ User stories #6 and #24.
14
+
15
+ ### Choose the right feedback
16
+
17
+ | Need | Control | Why |
18
+ | --- | --- | --- |
19
+ | In-page condition, stays in context | **Alert** | Persistent or dismissible, with severity. |
20
+ | Transient system notice (saved, copied, background job) | **Toast** (overlay slice) | Time-limited; must not be the only copy of essential info. |
21
+ | A specific field is invalid | **ValidationMessage** (form slice) | Anchored to the field; not a page banner. |
22
+
23
+ Do not restyle Alert into a toast. Do not use Alert for every validation
24
+ error in a form.
25
+
26
+ ## Anatomy
27
+
28
+ ```
29
+ Alert
30
+ ├── severity icon (required)
31
+ ├── Title (required)
32
+ ├── Description (required for error and warning; optional for info/success
33
+ │ when the title is already a complete sentence)
34
+ ├── Action (optional: recovery Button or Link)
35
+ └── Dismiss (optional IconButton; only when dismissible)
36
+ ```
37
+
38
+ - **Severity icon.** Matches the variant. Decorative if the title names the
39
+ severity in words; otherwise the accessible name of the Alert must include
40
+ the severity ("Error: replica unreachable").
41
+ - **Title.** What happened. Direct. Not "Oops", not an error code alone.
42
+ - **Description.** Follow [voice-and-tone](../voice-and-tone.md) for errors:
43
+ what happened, why when knowable, what the person can do now. Warning uses
44
+ the same structure with a lower-stakes next step. Info/success: what is
45
+ true, and a next step if there is one.
46
+ - **Action.** A real [Button](button.md) or [Link](link.md) that performs the
47
+ recovery ("Retry", "Open settings"). Do not bury the only recovery in
48
+ Description prose if a control can do it.
49
+ - **Dismiss.** [IconButton](icon-button.md) `ghost` `sm`, `aria-label`
50
+ "Dismiss". Only on dismissible Alerts.
51
+
52
+ ## Variants
53
+
54
+ Four severities. There is no extra "destructive" variant — that is `error`.
55
+
56
+ | Variant | Live region | Tokens |
57
+ | --- | --- | --- |
58
+ | `info` | `role="status"` (polite) | Border and icon `--color-info`. Title `--color-foreground`. Description `--color-muted-foreground`. Background `--color-surface`. |
59
+ | `success` | `role="status"` (polite) | Same structure with `--color-success`. |
60
+ | `warning` | `role="status"` (polite) unless the person must stop; then `role="alert"` | `--color-warning`. |
61
+ | `error` | `role="alert"` (assertive) | `--color-danger` (the danger role *is* error). |
62
+
63
+ Radius `--radius-md`. Padding `--spacing-md`. Gap `--spacing-sm`. Title
64
+ uses the five `--type-role-label-font-family`, `--type-role-label-font-size`,
65
+ `--type-role-label-font-weight`, `--type-role-label-letter-spacing`, and
66
+ `--type-role-label-line-height` properties. Description uses the corresponding
67
+ `--type-role-body-font-family`, `--type-role-body-font-size`,
68
+ `--type-role-body-font-weight`, `--type-role-body-letter-spacing`, and
69
+ `--type-role-body-line-height` properties.
70
+
71
+ Do not fill the Alert with the status color. Status color is border, icon,
72
+ and (optionally) title. A solid `--color-danger` panel fights contrast and
73
+ shouts past the content.
74
+
75
+ ### Dismissible vs persistent
76
+
77
+ | Kind | Behavior |
78
+ | --- | --- |
79
+ | **Persistent** | Stays while the condition is true (replica down, missing permission). No dismiss. Removing it is lying. |
80
+ | **Dismissible** | The person can clear it. Use for success confirmations and informational callouts that do not affect the next action. After dismiss, do not show the same Alert again in this visit unless the condition reoccurs. |
81
+
82
+ Default for `error` and `warning` that describe a current blocker:
83
+ persistent. Default for `success` and `info`: dismissible.
84
+
85
+ ## Sizes
86
+
87
+ One size. Do not scale Alert like Button. Density comes from the type roles
88
+ above. In a narrow Card, the Alert still uses `--spacing-md` padding; it
89
+ does not shrink to `sm`.
90
+
91
+ ## States
92
+
93
+ | State | Behavior |
94
+ | --- | --- |
95
+ | default | Visible, in flow. |
96
+ | hover / active | No Alert-level hover. Children (Action, Dismiss) have their own states. |
97
+ | focus | Focus moves to Action or Dismiss, not the Alert box. When an `error` Alert appears as a result of a submit, move focus to the Alert (or to its Action) so assistive tech and keyboard users land on it. |
98
+ | disabled | N/A. Hide or replace the Alert; do not disable it. |
99
+ | loading | If the condition is being retried, the Action Button shows [Spinner](spinner.md) loading. The Alert remains. |
100
+ | error | `error` is a variant, not a state on top of another variant. |
101
+
102
+ ## Accessibility
103
+
104
+ - `error`: `role="alert"` (implicit `aria-live="assertive"`). Use sparingly;
105
+ assertive interruptions stack badly. One error Alert at a time in a view.
106
+ - `info` / `success` / most `warning`: `role="status"` (`aria-live="polite"`).
107
+ - Name the Alert: `aria-labelledby` pointing at Title, `aria-describedby` at
108
+ Description.
109
+ - Severity is in text (title or prefix), not color alone.
110
+ - Dismiss is an IconButton with `aria-label="Dismiss"`. After dismiss, move
111
+ focus to a sensible place (the control that caused the Alert, or the main
112
+ heading) — do not dump focus to `body`.
113
+ - Do not nest interactive content other than Action and Dismiss.
114
+ - Do not use Radix Alert Dialog here. Alert Dialog is a modal. This
115
+ component never blocks the page.
116
+
117
+ ### Keyboard
118
+
119
+ | Key | Action |
120
+ | --- | --- |
121
+ | `Tab` / `Shift+Tab` | Move between Action and Dismiss (and the rest of the page). |
122
+ | `Enter` / `Space` | Activate the focused Button / IconButton (including Dismiss). |
123
+
124
+ ## When to use
125
+
126
+ - A condition about this page or section the person should see before
127
+ continuing: load failure, permission, degraded dependency, completed save
128
+ with a next step.
129
+ - Inline, above the affected content (form, table, replica panel).
130
+ - Recovery can be offered as a Button or Link inside the Alert.
131
+
132
+ ## When NOT to use
133
+
134
+ - **Field-level validation.** ValidationMessage next to the input.
135
+ - **Transient confirmations** that must not block reading ("Copied"). Toast.
136
+ - **Status labels** without explanation ("live"). [Badge](badge.md).
137
+ - **A whole empty dataset.** EmptyState (data slice), optionally with a
138
+ Button, not an info Alert that says "nothing here".
139
+ - **Blocking work that needs a decision.** Modal/Dialog (overlay slice).
140
+ Alert does not trap focus and does not block the page.
141
+ - **Marketing callouts.** If it is not a condition of the product state, it
142
+ does not belong.
143
+
144
+ ## Radix/shadcn mapping
145
+
146
+ There is **no** Radix primitive for in-page Alert.
147
+
148
+ | Kiso | Reference |
149
+ | --- | --- |
150
+ | Structure, icon + title + description + action | shadcn [Alert](https://ui.shadcn.com/docs/components/alert) (`Alert`, `AlertTitle`, `AlertDescription`, `AlertAction`) |
151
+ | Dismiss | Compose [IconButton](icon-button.md); shadcn has no dedicated dismiss slot |
152
+ | `error` | shadcn `variant="destructive"` restyled to `--color-danger` (border/icon, not a filled danger panel) |
153
+ | `info` / `success` / `warning` | shadcn `default` plus the matching `--color-info`, `--color-success`, or `--color-warning` — **not** the shadcn "Custom Colors" utility-class example (`bg-amber-50`, etc.) |
154
+
155
+ Do **not** map this component to Radix
156
+ [Alert Dialog](https://www.radix-ui.com/primitives/docs/components/alert-dialog)
157
+ or shadcn Alert Dialog. Those are modal confirmation overlays (later slice:
158
+ Modal/Dialog). Using them here collapses the Alert vs Modal distinction.