@adia-ai/web-components 0.8.6 β†’ 0.8.8

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 (108) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -3
  3. package/dist/host.min.css +1 -1
  4. package/dist/host.sheet.js +1 -1
  5. package/dist/theme-provider.min.js +2 -2
  6. package/dist/web-components.min.css +1 -1
  7. package/dist/web-components.min.js +1 -1
  8. package/dist/web-components.sheet.js +1 -1
  9. package/package.json +2 -1
  10. package/patterns/access-requests/access-requests.examples.html +132 -0
  11. package/patterns/access-requests/access-requests.html +60 -0
  12. package/patterns/admin-keys-and-export/admin-keys-and-export.examples.html +236 -0
  13. package/patterns/admin-keys-and-export/admin-keys-and-export.html +64 -0
  14. package/patterns/admin-shell/admin-shell.examples.html +327 -0
  15. package/patterns/admin-shell/admin-shell.html +44 -0
  16. package/patterns/agent-cost/agent-cost.examples.html +111 -0
  17. package/patterns/agent-cost/agent-cost.html +62 -0
  18. package/patterns/agent-memory/agent-memory.examples.html +155 -0
  19. package/patterns/agent-memory/agent-memory.html +64 -0
  20. package/patterns/agent-prompt-library/agent-prompt-library.examples.html +181 -0
  21. package/patterns/agent-prompt-library/agent-prompt-library.html +64 -0
  22. package/patterns/agent-tool-call/agent-tool-call.examples.html +123 -0
  23. package/patterns/agent-tool-call/agent-tool-call.html +60 -0
  24. package/patterns/alert-dialog/alert-dialog.examples.html +105 -0
  25. package/patterns/alert-dialog/alert-dialog.html +57 -0
  26. package/patterns/app-nav/app-nav.examples.html +421 -0
  27. package/patterns/app-nav/app-nav.html +50 -0
  28. package/patterns/approvals/approvals.examples.html +131 -0
  29. package/patterns/approvals/approvals.html +58 -0
  30. package/patterns/audit-log/audit-log.examples.html +74 -0
  31. package/patterns/audit-log/audit-log.examples.js +60 -0
  32. package/patterns/audit-log/audit-log.html +63 -0
  33. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.html +89 -0
  34. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.js +69 -0
  35. package/patterns/bulk-action-toolbar/bulk-action-toolbar.html +62 -0
  36. package/patterns/changelog-feed/changelog-feed.examples.html +151 -0
  37. package/patterns/changelog-feed/changelog-feed.html +57 -0
  38. package/patterns/chart-in-card/chart-in-card.examples.html +193 -0
  39. package/patterns/chart-in-card/chart-in-card.examples.js +46 -0
  40. package/patterns/chart-in-card/chart-in-card.html +66 -0
  41. package/patterns/chat-shell/chat-shell.examples.html +129 -0
  42. package/patterns/chat-shell/chat-shell.html +46 -0
  43. package/patterns/comments-and-collaboration/comments-and-collaboration.examples.html +241 -0
  44. package/patterns/comments-and-collaboration/comments-and-collaboration.html +66 -0
  45. package/patterns/component-tokens/component-tokens.examples.html +483 -0
  46. package/patterns/component-tokens/component-tokens.html +42 -0
  47. package/patterns/conversion-funnel/conversion-funnel.examples.html +158 -0
  48. package/patterns/conversion-funnel/conversion-funnel.examples.js +4 -0
  49. package/patterns/conversion-funnel/conversion-funnel.html +64 -0
  50. package/patterns/data-tables-inline-edit-and-tree/data-tables-inline-edit-and-tree.examples.html +196 -0
  51. package/patterns/data-tables-inline-edit-and-tree/data-tables-inline-edit-and-tree.html +58 -0
  52. package/patterns/diff-review/diff-review.examples.html +147 -0
  53. package/patterns/diff-review/diff-review.html +56 -0
  54. package/patterns/editor-shell/editor-shell.examples.html +139 -0
  55. package/patterns/editor-shell/editor-shell.html +62 -0
  56. package/patterns/export-flow/export-flow.examples.html +152 -0
  57. package/patterns/export-flow/export-flow.examples.js +37 -0
  58. package/patterns/export-flow/export-flow.html +65 -0
  59. package/patterns/filter-bar/filter-bar.examples.html +116 -0
  60. package/patterns/filter-bar/filter-bar.examples.js +23 -0
  61. package/patterns/filter-bar/filter-bar.html +70 -0
  62. package/patterns/form-drawer/form-drawer.examples.html +210 -0
  63. package/patterns/form-drawer/form-drawer.html +64 -0
  64. package/patterns/form-system/form-system.examples.html +383 -0
  65. package/patterns/form-system/form-system.html +48 -0
  66. package/patterns/forms-conditional-and-autocomplete/forms-conditional-and-autocomplete.examples.html +189 -0
  67. package/patterns/forms-conditional-and-autocomplete/forms-conditional-and-autocomplete.html +64 -0
  68. package/patterns/inline-dialog/inline-dialog.examples.html +143 -0
  69. package/patterns/inline-dialog/inline-dialog.html +59 -0
  70. package/patterns/kanban-board/kanban-board.examples.html +224 -0
  71. package/patterns/kanban-board/kanban-board.html +58 -0
  72. package/patterns/layout/layout.examples.html +365 -0
  73. package/patterns/layout/layout.html +54 -0
  74. package/patterns/marketing-engagement/marketing-engagement.examples.html +280 -0
  75. package/patterns/marketing-engagement/marketing-engagement.html +64 -0
  76. package/patterns/notifications-bell-and-digest/notifications-bell-and-digest.examples.html +213 -0
  77. package/patterns/notifications-bell-and-digest/notifications-bell-and-digest.html +58 -0
  78. package/patterns/overview/overview.examples.html +119 -0
  79. package/patterns/overview/overview.html +42 -0
  80. package/patterns/permissions-matrix/permissions-matrix.examples.html +91 -0
  81. package/patterns/permissions-matrix/permissions-matrix.examples.js +28 -0
  82. package/patterns/permissions-matrix/permissions-matrix.html +56 -0
  83. package/patterns/permissions-role-picker/permissions-role-picker.examples.html +81 -0
  84. package/patterns/permissions-role-picker/permissions-role-picker.html +56 -0
  85. package/patterns/permissions-sharing/permissions-sharing.examples.html +175 -0
  86. package/patterns/permissions-sharing/permissions-sharing.html +66 -0
  87. package/patterns/profile-public-and-verification/profile-public-and-verification.examples.html +227 -0
  88. package/patterns/profile-public-and-verification/profile-public-and-verification.html +70 -0
  89. package/patterns/record-detail-drawer/record-detail-drawer.examples.html +164 -0
  90. package/patterns/record-detail-drawer/record-detail-drawer.html +64 -0
  91. package/patterns/responsive-shell-sidebar/README.md +37 -0
  92. package/patterns/responsive-shell-sidebar/responsive-shell-sidebar.css +39 -0
  93. package/patterns/responsive-shell-sidebar/responsive-shell-sidebar.examples.html +208 -0
  94. package/patterns/responsive-shell-sidebar/responsive-shell-sidebar.html +47 -0
  95. package/patterns/retention-cohort/retention-cohort.examples.html +149 -0
  96. package/patterns/retention-cohort/retention-cohort.examples.js +37 -0
  97. package/patterns/retention-cohort/retention-cohort.html +62 -0
  98. package/patterns/search-discovery/search-discovery.examples.html +263 -0
  99. package/patterns/search-discovery/search-discovery.html +58 -0
  100. package/patterns/system-banners/system-banners.examples.html +150 -0
  101. package/patterns/system-banners/system-banners.html +52 -0
  102. package/patterns/timezone-selector/timezone-selector.examples.html +82 -0
  103. package/patterns/timezone-selector/timezone-selector.examples.js +72 -0
  104. package/patterns/timezone-selector/timezone-selector.html +57 -0
  105. package/patterns/wizard-drawer/wizard-drawer.examples.html +144 -0
  106. package/patterns/wizard-drawer/wizard-drawer.examples.js +33 -0
  107. package/patterns/wizard-drawer/wizard-drawer.html +72 -0
  108. package/styles/type/roles.css +8 -8
@@ -0,0 +1,129 @@
1
+ <header>
2
+ <div>
3
+ <h1>Chat Shell β€” Composition Pattern</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">chat-shell</tag-ui>
6
+ <tag-ui size="sm" variant="ghost">cluster-namespaced</tag-ui>
7
+ </div>
8
+ </div>
9
+ <p>
10
+ The canonical composition pattern for an LLM chat surface. Built from
11
+ cluster-namespaced bespoke children β€” every structural part has its
12
+ own custom element. The legacy raw-HTML form (raw <code>&lt;header&gt;</code>
13
+ with <code>data-chat-name</code> / <code>data-chat-status</code>,
14
+ <code>&lt;section data-chat-messages&gt;</code>,
15
+ <code>&lt;empty-state-ui data-chat-empty&gt;</code>,
16
+ <code>&lt;footer&gt;</code> wrapping <code>&lt;chat-input-ui&gt;</code>)
17
+ was retired in v0.4.0 per
18
+ <a href="../../../../.brain/adrs/0024-legacy-shell-shapes-retired.md">ADR-0024</a>;
19
+ new code uses the bespoke shape exclusively per
20
+ <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>.
21
+ </p>
22
+ </header>
23
+
24
+ <section data-section data-property="canonical-hierarchy">
25
+ <h2 variant="section">Canonical hierarchy</h2>
26
+ <p data-note>
27
+ For the full live demo + state-as-attribute documentation, see
28
+ <a href="/site/components/chat-shell">/site/components/chat-shell</a>.
29
+ This page is the pattern hub.
30
+ </p>
31
+ <code-ui language="html">&lt;chat-shell provider="anthropic" model="claude-sonnet-4-7" proxy-url="/api/llm"&gt;
32
+
33
+ &lt;!-- Header β€” name + status indicator --&gt;
34
+ &lt;chat-header&gt;
35
+ &lt;span slot="name"&gt;Claude&lt;/span&gt;
36
+ &lt;chat-status slot="status"&gt;Connected&lt;/chat-status&gt;
37
+ &lt;/chat-header&gt;
38
+
39
+ &lt;!-- Streaming message thread (with optional empty state) --&gt;
40
+ &lt;chat-thread&gt;
41
+ &lt;chat-empty&gt;
42
+ &lt;empty-state-ui icon="chat-circle"
43
+ heading="Hello!" description="Ask me anything."&gt;&lt;/empty-state-ui&gt;
44
+ &lt;/chat-empty&gt;
45
+ &lt;/chat-thread&gt;
46
+
47
+ &lt;!-- Composer wraps the input primitive --&gt;
48
+ &lt;chat-composer&gt;
49
+ &lt;chat-input-ui placeholder="Message…"&gt;&lt;/chat-input-ui&gt;
50
+ &lt;/chat-composer&gt;
51
+
52
+ &lt;/chat-shell&gt;</code-ui>
53
+ </section>
54
+
55
+ <section data-section data-property="part-by-part-reference">
56
+ <h2 variant="section">Part-by-part reference</h2>
57
+ <table>
58
+ <thead>
59
+ <tr><th>Part</th><th>Role</th></tr>
60
+ </thead>
61
+ <tbody>
62
+ <tr>
63
+ <td><a href="/site/components/chat-shell"><code>&lt;chat-shell&gt;</code></a></td>
64
+ <td>Behavior-only host. Wires LLM streaming, markdown rendering, code-block upgrades, the <code>proxy-url</code> integration path.</td>
65
+ </tr>
66
+ <tr>
67
+ <td><a href="/site/components/chat-header"><code>&lt;chat-header&gt;</code></a></td>
68
+ <td>Top band β€” slots: <code>name</code>, <code>status</code>, <code>action</code>.</td>
69
+ </tr>
70
+ <tr>
71
+ <td><a href="/site/components/chat-thread"><code>&lt;chat-thread&gt;</code></a></td>
72
+ <td>Streaming message list. Reflects <code>[streaming]</code>.</td>
73
+ </tr>
74
+ <tr>
75
+ <td><a href="/site/components/chat-empty"><code>&lt;chat-empty&gt;</code></a></td>
76
+ <td>Empty-state hint inside <code>&lt;chat-thread&gt;</code> before the first message.</td>
77
+ </tr>
78
+ <tr>
79
+ <td><a href="/site/components/chat-composer"><code>&lt;chat-composer&gt;</code></a></td>
80
+ <td>Input area. Wraps <code>&lt;chat-input-ui&gt;</code>.</td>
81
+ </tr>
82
+ <tr>
83
+ <td><a href="/site/components/chat-sidebar"><code>&lt;chat-sidebar&gt;</code></a></td>
84
+ <td>Optional conversation-list / inspector rail (<code>slot="leading"</code> or <code>slot="trailing"</code>).</td>
85
+ </tr>
86
+ </tbody>
87
+ </table>
88
+ </section>
89
+
90
+ <section data-section data-property="with-sidebar-conversation-list">
91
+ <h2 variant="section">With sidebar β€” conversation list</h2>
92
+ <p>For a multi-conversation surface, add a <code>&lt;chat-sidebar slot="leading"&gt;</code> with a <code>&lt;nav-ui&gt;</code> of past chats.</p>
93
+ <code-ui language="html">&lt;chat-shell&gt;
94
+ &lt;chat-sidebar slot="leading"&gt;
95
+ &lt;chat-topbar slot="header"&gt;
96
+ &lt;span slot="heading"&gt;Conversations&lt;/span&gt;
97
+ &lt;button-ui slot="action" text="+ New" variant="primary" size="sm"&gt;&lt;/button-ui&gt;
98
+ &lt;/chat-topbar&gt;
99
+ &lt;nav-ui&gt;
100
+ &lt;nav-item-ui text="Today's chat" selected&gt;&lt;/nav-item-ui&gt;
101
+ &lt;nav-item-ui text="API design review"&gt;&lt;/nav-item-ui&gt;
102
+ &lt;nav-item-ui text="Architecture proposal"&gt;&lt;/nav-item-ui&gt;
103
+ &lt;/nav-ui&gt;
104
+ &lt;/chat-sidebar&gt;
105
+ &lt;chat-header&gt;...&lt;/chat-header&gt;
106
+ &lt;chat-thread&gt;...&lt;/chat-thread&gt;
107
+ &lt;chat-composer&gt;...&lt;/chat-composer&gt;
108
+ &lt;/chat-shell&gt;</code-ui>
109
+ </section>
110
+
111
+ <section data-section data-property="authoring-rules">
112
+ <h2 variant="section">Authoring rules</h2>
113
+ <ul>
114
+ <li><strong>Cluster-namespaced children only.</strong> Use <code>&lt;chat-header&gt;</code>, <code>&lt;chat-thread&gt;</code>, <code>&lt;chat-composer&gt;</code>, <code>&lt;chat-sidebar&gt;</code>. Don't author raw <code>&lt;header data-chat-name&gt;</code> or <code>&lt;section data-chat-messages&gt;</code> β€” these no longer style or wire.</li>
115
+ <li><strong>State is queryable as attributes.</strong> <code>shell.querySelector('chat-thread').hasAttribute('streaming')</code>. Style cross-cuts via <code>:has()</code>; no JS coordination needed.</li>
116
+ <li><strong>Empty state wraps in <code>&lt;chat-empty&gt;</code> inside <code>&lt;chat-thread&gt;</code>.</strong> The thread hides the empty wrapper automatically when the first message arrives.</li>
117
+ <li><strong>Composer wraps <code>&lt;chat-input-ui&gt;</code>.</strong> Don't put <code>&lt;chat-input-ui&gt;</code> as a direct child of <code>&lt;chat-shell&gt;</code>.</li>
118
+ </ul>
119
+ </section>
120
+
121
+ <section data-section data-property="where-to-next">
122
+ <h2 variant="section">Where to next</h2>
123
+ <ul>
124
+ <li><a href="/site/components/chat-shell">chat-shell component reference</a> β€” full anatomy + live demo</li>
125
+ <li><a href="/site/components/chat-thread">chat-thread</a> Β· <a href="/site/components/chat-composer">chat-composer</a> Β· <a href="/site/components/chat-input">chat-input-ui</a></li>
126
+ <li><a href="/site/patterns/shells">Macro-shells overview</a></li>
127
+ <li><a href="/site/patterns/admin-shell">admin-shell pattern</a> (counterpart for admin/dashboard surfaces)</li>
128
+ </ul>
129
+ </section>
@@ -0,0 +1,46 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" theme="auto">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Chat Shell (pattern) β€” AdiaUI</title>
7
+
8
+ <!-- Token base -->
9
+ <link rel="stylesheet" href="../../styles/resets.css">
10
+ <link rel="stylesheet" href="../../styles/tokens.css">
11
+
12
+ <!-- Component CSS β€” primitives this pattern composes -->
13
+ <link rel="stylesheet" href="../../components/code/code.css">
14
+ <link rel="stylesheet" href="../../components/empty-state/empty-state.css">
15
+ <link rel="stylesheet" href="../../components/tag/tag.css">
16
+
17
+ <!-- Component JS -->
18
+ <script type="module" src="../../components/code/code.js"></script>
19
+ <script type="module" src="../../components/empty-state/empty-state.js"></script>
20
+ <script type="module" src="../../components/tag/tag.js"></script>
21
+
22
+ <style>
23
+ :where(html, body) { margin: 0; min-height: 100vh; background: var(--md-sys-color-neutral-background); color: var(--md-sys-color-neutral-on-surface); font-family: var(--a-font-family); }
24
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
25
+ </style>
26
+ </head>
27
+ <body>
28
+
29
+ <main id="demo-root">
30
+ <p>Loading examples…</p>
31
+ </main>
32
+
33
+ <script type="module">
34
+ const root = document.getElementById('demo-root');
35
+ try {
36
+ const res = await fetch('./chat-shell.examples.html');
37
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
38
+ root.innerHTML = await res.text();
39
+ } catch (err) {
40
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-shell.examples.html β€” ${err.message}</p>`;
41
+ console.error('[chat-shell.html]', err);
42
+ }
43
+ </script>
44
+
45
+ </body>
46
+ </html>
@@ -0,0 +1,241 @@
1
+ <header>
2
+ <div>
3
+ <h1>Comments &amp; Collaboration</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">card-ui</tag-ui> <tag-ui size="sm">avatar-ui</tag-ui> <tag-ui size="sm">field-ui</tag-ui> <tag-ui size="sm">menu-ui</tag-ui> <tag-ui size="sm">tag-ui</tag-ui> <tag-ui size="sm">button-ui</tag-ui>
6
+ </div>
7
+ </div>
8
+ <p>The substrate for comments threads, @-mentions, and emoji reactions on any first-class object β€” docs, tasks, designs, code reviews. Composed entirely from existing primitives; the pattern is in the wiring, not in new components.</p>
9
+ </header>
10
+
11
+ <section data-section data-property="when-to-use">
12
+ <h2 variant="section">When to use</h2>
13
+ <p data-note>
14
+ When users need to talk to each other about a specific object β€”
15
+ a design, a task, a row, a paragraph. Comments anchor to the
16
+ object; mentions notify a person; reactions condense agreement
17
+ without a reply. The three nest: a comment thread carries
18
+ mentions inside its text and reactions on each message.
19
+ </p>
20
+ </section>
21
+
22
+ <section data-section data-property="thread">
23
+ <h2 variant="section">Comment thread</h2>
24
+ <p data-note>A vertical stack of comments anchored to a parent object. Each row carries author avatar + name + timestamp + body + reactions strip + reply action. Threaded replies indent one level β€” deeper nesting collapses to "X replies" by default.</p>
25
+ <div data-artifact-container>
26
+ <div data-artifact-item data-artifact-label="comment thread">
27
+ <card-ui data-chunk="comments-thread" style="max-width: 640px;">
28
+ <header>
29
+ <span slot="heading" variant="section">Discussion</span>
30
+ <text-ui slot="description" color="subtle">3 comments Β· 2 participants</text-ui>
31
+ <button-ui slot="action" text="Resolve" variant="ghost" size="sm" icon-leading="check"></button-ui>
32
+ </header>
33
+ <section>
34
+ <col-ui gap="3">
35
+ <row-ui gap="3" align="start">
36
+ <avatar-ui size="sm" text="Avery Chen"></avatar-ui>
37
+ <col-ui gap="1" grow>
38
+ <row-ui gap="2" align="baseline">
39
+ <text-ui strong>Avery Chen</text-ui>
40
+ <text-ui color="subtle" size="sm">2 hours ago</text-ui>
41
+ </row-ui>
42
+ <text-ui>Should the OKLCH ramp here use the chrome or the data scale? <text-ui color="primary">@Kim</text-ui> what's the convention?</text-ui>
43
+ <row-ui gap="1">
44
+ <tag-ui size="sm" icon-leading="thumbs-up">2</tag-ui>
45
+ <tag-ui size="sm" icon-leading="eyes">1</tag-ui>
46
+ <button-ui text="Reply" variant="ghost" size="xs"></button-ui>
47
+ </row-ui>
48
+ </col-ui>
49
+ </row-ui>
50
+ <row-ui gap="3" align="start" style="padding-inline-start: 2.5rem;">
51
+ <avatar-ui size="sm" text="Kim Granlund"></avatar-ui>
52
+ <col-ui gap="1" grow>
53
+ <row-ui gap="2" align="baseline">
54
+ <text-ui strong>Kim Granlund</text-ui>
55
+ <text-ui color="subtle" size="sm">1 hour ago</text-ui>
56
+ </row-ui>
57
+ <text-ui>Chrome β€” the data scale is reserved for visualization series. Spec at <text-ui color="primary">.claude/docs/specs/component-token-contract.md</text-ui>.</text-ui>
58
+ <row-ui gap="1">
59
+ <tag-ui size="sm" icon-leading="thumbs-up">3</tag-ui>
60
+ <button-ui text="Reply" variant="ghost" size="xs"></button-ui>
61
+ </row-ui>
62
+ </col-ui>
63
+ </row-ui>
64
+ <row-ui gap="3" align="start">
65
+ <avatar-ui size="sm" text="Jordan Lee"></avatar-ui>
66
+ <col-ui gap="1" grow>
67
+ <row-ui gap="2" align="baseline">
68
+ <text-ui strong>Jordan Lee</text-ui>
69
+ <text-ui color="subtle" size="sm">12 minutes ago</text-ui>
70
+ </row-ui>
71
+ <text-ui>Filed a follow-up β€” adding a lint rule so this doesn't happen again. <text-ui color="primary">#linter</text-ui></text-ui>
72
+ <row-ui gap="1">
73
+ <button-ui text="Reply" variant="ghost" size="xs"></button-ui>
74
+ </row-ui>
75
+ </col-ui>
76
+ </row-ui>
77
+ </col-ui>
78
+ </section>
79
+ </card-ui>
80
+ </div>
81
+ </div>
82
+ </section>
83
+
84
+ <section data-section data-property="composer">
85
+ <h2 variant="section">Comment composer</h2>
86
+ <p data-note>The input field below a thread. Multiline, with attach + mention + emoji affordances inline, and Send / Cancel actions. Submits on Cmd/Ctrl+Enter; Enter inserts a newline.</p>
87
+ <div data-artifact-container>
88
+ <div data-artifact-item data-artifact-label="comment composer">
89
+ <card-ui data-chunk="comments-composer" style="max-width: 640px;">
90
+ <section>
91
+ <row-ui gap="3" align="start">
92
+ <avatar-ui size="sm" text="You"></avatar-ui>
93
+ <col-ui gap="2" grow>
94
+ <field-ui>
95
+ <textarea-ui placeholder="Write a comment… use @ to mention" rows="3"></textarea-ui>
96
+ </field-ui>
97
+ <row-ui gap="2" align="center">
98
+ <button-ui icon="paperclip" variant="ghost" size="sm" aria-label="Attach"></button-ui>
99
+ <button-ui icon="at" variant="ghost" size="sm" aria-label="Mention someone"></button-ui>
100
+ <button-ui icon="smiley" variant="ghost" size="sm" aria-label="Insert emoji"></button-ui>
101
+ <text-ui color="subtle" size="sm" style="margin-inline-start: auto;"><kbd-ui>Cmd</kbd-ui> + <kbd-ui>Enter</kbd-ui> to send</text-ui>
102
+ <button-ui text="Comment" variant="primary" size="sm"></button-ui>
103
+ </row-ui>
104
+ </col-ui>
105
+ </row-ui>
106
+ </section>
107
+ </card-ui>
108
+ </div>
109
+ </div>
110
+ </section>
111
+
112
+ <section data-section data-property="mention-menu">
113
+ <h2 variant="section">@-mention picker</h2>
114
+ <p data-note>Popover that opens after the user types <code>@</code>. Shows team members + recently-mentioned at top, fuzzy-filtered by query. Each row carries avatar + name + handle + role tag. Arrow keys navigate; Enter inserts; Esc closes without inserting.</p>
115
+ <div data-artifact-container>
116
+ <div data-artifact-item data-artifact-label="mention picker menu">
117
+ <card-ui data-chunk="comments-mention-menu" raw style="max-width: 320px;" data-shape="popover">
118
+ <section>
119
+ <col-ui gap="2">
120
+ <text-ui strong size="sm" color="subtle">Mention</text-ui>
121
+ <col-ui gap="1">
122
+ <row-ui gap="2" align="center">
123
+ <avatar-ui size="sm" text="Kim Granlund"></avatar-ui>
124
+ <col-ui gap="0" style="flex: 1;">
125
+ <text-ui strong>Kim Granlund</text-ui>
126
+ <text-ui color="subtle" size="sm">@kim Β· Owner</text-ui>
127
+ </col-ui>
128
+ </row-ui>
129
+ <row-ui gap="2" align="center">
130
+ <avatar-ui size="sm" text="Avery Chen"></avatar-ui>
131
+ <col-ui gap="0" style="flex: 1;">
132
+ <text-ui strong>Avery Chen</text-ui>
133
+ <text-ui color="subtle" size="sm">@avery Β· Designer</text-ui>
134
+ </col-ui>
135
+ </row-ui>
136
+ <row-ui gap="2" align="center">
137
+ <avatar-ui size="sm" text="Jordan Lee"></avatar-ui>
138
+ <col-ui gap="0" style="flex: 1;">
139
+ <text-ui strong>Jordan Lee</text-ui>
140
+ <text-ui color="subtle" size="sm">@jordan Β· Engineer</text-ui>
141
+ </col-ui>
142
+ </row-ui>
143
+ <divider-ui></divider-ui>
144
+ <row-ui gap="2" align="center">
145
+ <icon-ui name="users-three" size="sm"></icon-ui>
146
+ <col-ui gap="0" style="flex: 1;">
147
+ <text-ui strong>@team</text-ui>
148
+ <text-ui color="subtle" size="sm">Notify everyone in this workspace</text-ui>
149
+ </col-ui>
150
+ </row-ui>
151
+ </col-ui>
152
+ </col-ui>
153
+ </section>
154
+ </card-ui>
155
+ </div>
156
+ </div>
157
+ </section>
158
+
159
+ <section data-section data-property="reactions-bar">
160
+ <h2 variant="section">Reactions bar</h2>
161
+ <p data-note>The strip of reaction tags under a comment or message. Each tag shows emoji + count; the user's own reaction is highlighted. A trailing "+" opens the picker. Click a count to toggle the user's own reaction; long-press shows who reacted.</p>
162
+ <div data-artifact-container>
163
+ <div data-artifact-item data-artifact-label="reactions bar">
164
+ <row-ui data-chunk="reactions-bar" gap="1">
165
+ <tag-ui size="sm">πŸ‘ 4</tag-ui>
166
+ <tag-ui size="sm" variant="primary">πŸŽ‰ 2</tag-ui>
167
+ <tag-ui size="sm">πŸ‘€ 1</tag-ui>
168
+ <tag-ui size="sm">πŸš€ 1</tag-ui>
169
+ <button-ui icon="plus" variant="ghost" size="xs" aria-label="Add reaction"></button-ui>
170
+ </row-ui>
171
+ </div>
172
+ </div>
173
+ </section>
174
+
175
+ <section data-section data-property="reactions-picker">
176
+ <h2 variant="section">Reactions picker</h2>
177
+ <p data-note>The emoji-grid popover that opens from the "+" button. Recent + frequent emojis at top; full categorical grid below; search input above. Arrow + Enter for keyboard; click for pointer.</p>
178
+ <div data-artifact-container>
179
+ <div data-artifact-item data-artifact-label="reactions picker">
180
+ <card-ui data-chunk="reactions-picker" style="max-width: 360px;">
181
+ <section>
182
+ <col-ui gap="2">
183
+ <field-ui>
184
+ <input-ui placeholder="Search emoji…" icon-leading="magnifying-glass"></input-ui>
185
+ </field-ui>
186
+ <col-ui gap="1">
187
+ <text-ui strong size="sm" color="subtle">Frequently used</text-ui>
188
+ <row-ui gap="1" wrap>
189
+ <button-ui text="πŸ‘" variant="ghost" size="sm"></button-ui>
190
+ <button-ui text="πŸŽ‰" variant="ghost" size="sm"></button-ui>
191
+ <button-ui text="❀️" variant="ghost" size="sm"></button-ui>
192
+ <button-ui text="πŸ‘€" variant="ghost" size="sm"></button-ui>
193
+ <button-ui text="πŸš€" variant="ghost" size="sm"></button-ui>
194
+ <button-ui text="βœ…" variant="ghost" size="sm"></button-ui>
195
+ <button-ui text="πŸ™" variant="ghost" size="sm"></button-ui>
196
+ <button-ui text="πŸ”₯" variant="ghost" size="sm"></button-ui>
197
+ </row-ui>
198
+ </col-ui>
199
+ <col-ui gap="1">
200
+ <text-ui strong size="sm" color="subtle">Smileys</text-ui>
201
+ <row-ui gap="1" wrap>
202
+ <button-ui text="πŸ˜€" variant="ghost" size="sm"></button-ui>
203
+ <button-ui text="πŸ˜„" variant="ghost" size="sm"></button-ui>
204
+ <button-ui text="πŸ˜‚" variant="ghost" size="sm"></button-ui>
205
+ <button-ui text="πŸ€”" variant="ghost" size="sm"></button-ui>
206
+ <button-ui text="πŸ˜…" variant="ghost" size="sm"></button-ui>
207
+ <button-ui text="😎" variant="ghost" size="sm"></button-ui>
208
+ <button-ui text="πŸ₯Ί" variant="ghost" size="sm"></button-ui>
209
+ <button-ui text="πŸ™ƒ" variant="ghost" size="sm"></button-ui>
210
+ </row-ui>
211
+ </col-ui>
212
+ </col-ui>
213
+ </section>
214
+ </card-ui>
215
+ </div>
216
+ </div>
217
+ </section>
218
+
219
+ <section data-section data-property="composition">
220
+ <h2 variant="section">Composition rules</h2>
221
+ <ul>
222
+ <li><strong>Comments anchor to an object</strong> β€” every thread has a parent (a doc paragraph, a row, a design selection). The thread surface usually opens beside the object, not in a global modal. Threadless "general comments" are a separate pattern (chat thread, 11a).</li>
223
+ <li><strong>Mentions notify; reactions don't</strong> β€” typing <code>@name</code> always pings that user; emoji reactions never do. The semantic gap matters: mentions are an action ("read this"), reactions are an acknowledgment ("seen / agreed").</li>
224
+ <li><strong>Cmd/Ctrl+Enter to send, Enter for newline</strong> β€” comments are multi-line by default. The opposite (Enter to send, Shift+Enter for newline) is correct for chat input (11b) but wrong here.</li>
225
+ <li><strong>Reactions are typed by emoji, not by sentiment</strong> β€” don't normalize "πŸ‘" and "πŸš€" into a `like_count`. Each emoji is its own bucket; counts are per-emoji.</li>
226
+ <li><strong>Resolve, don't delete</strong> β€” threads should be resolvable (collapsed, marked done) but not destructively deleted by default. Audit trail matters.</li>
227
+ <li><strong>Sharing dialogs live in the RBAC domain</strong> β€” the "Share this with…" surface is concept 36e, not a sub-concept of comments. Don't re-author it under collaboration.</li>
228
+ </ul>
229
+ </section>
230
+
231
+ <section data-section data-property="cross-references">
232
+ <h2 variant="section">See also</h2>
233
+ <ul>
234
+ <li><a href="/site/components/field">field-ui</a> Β· <a href="/site/components/textarea">textarea-ui</a> β€” composer input.</li>
235
+ <li><a href="/site/components/menu">menu-ui</a> β€” mention picker surface.</li>
236
+ <li><a href="/site/components/tag">tag-ui</a> β€” reaction chips.</li>
237
+ <li><a href="/site/components/avatar">avatar-ui</a> β€” author identity.</li>
238
+ <li><a href="/site/patterns/permissions-sharing">permissions-sharing</a> β€” the sharing-dialog surface (concept 36e).</li>
239
+ <li><a href="/site/patterns/agent-tool-call">agent-tool-call</a> β€” sibling thread-shape (model output, not user comments).</li>
240
+ </ul>
241
+ </section>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" theme="auto">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Comments &amp; Collaboration (pattern) β€” AdiaUI</title>
7
+
8
+ <!-- Token base -->
9
+ <link rel="stylesheet" href="../../styles/resets.css">
10
+ <link rel="stylesheet" href="../../styles/tokens.css">
11
+
12
+ <!-- Component CSS β€” primitives this pattern composes -->
13
+ <link rel="stylesheet" href="../../components/avatar/avatar.css">
14
+ <link rel="stylesheet" href="../../components/button/button.css">
15
+ <link rel="stylesheet" href="../../components/card/card.css">
16
+ <link rel="stylesheet" href="../../components/col/col.css">
17
+ <link rel="stylesheet" href="../../components/divider/divider.css">
18
+ <link rel="stylesheet" href="../../components/field/field.css">
19
+ <link rel="stylesheet" href="../../components/icon/icon.css">
20
+ <link rel="stylesheet" href="../../components/input/input.css">
21
+ <link rel="stylesheet" href="../../components/kbd/kbd.css">
22
+ <link rel="stylesheet" href="../../components/row/row.css">
23
+ <link rel="stylesheet" href="../../components/tag/tag.css">
24
+ <link rel="stylesheet" href="../../components/text/text.css">
25
+ <link rel="stylesheet" href="../../components/textarea/textarea.css">
26
+
27
+ <!-- Component JS -->
28
+ <script type="module" src="../../components/avatar/avatar.js"></script>
29
+ <script type="module" src="../../components/button/button.js"></script>
30
+ <script type="module" src="../../components/card/card.js"></script>
31
+ <script type="module" src="../../components/col/col.js"></script>
32
+ <script type="module" src="../../components/divider/divider.js"></script>
33
+ <script type="module" src="../../components/field/field.js"></script>
34
+ <script type="module" src="../../components/icon/icon.js"></script>
35
+ <script type="module" src="../../components/input/input.js"></script>
36
+ <script type="module" src="../../components/kbd/kbd.js"></script>
37
+ <script type="module" src="../../components/row/row.js"></script>
38
+ <script type="module" src="../../components/tag/tag.js"></script>
39
+ <script type="module" src="../../components/text/text.js"></script>
40
+ <script type="module" src="../../components/textarea/textarea.js"></script>
41
+
42
+ <style>
43
+ :where(html, body) { margin: 0; min-height: 100vh; background: var(--md-sys-color-neutral-background); color: var(--md-sys-color-neutral-on-surface); font-family: var(--a-font-family); }
44
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
45
+ </style>
46
+ </head>
47
+ <body>
48
+
49
+ <main id="demo-root">
50
+ <p>Loading examples…</p>
51
+ </main>
52
+
53
+ <script type="module">
54
+ const root = document.getElementById('demo-root');
55
+ try {
56
+ const res = await fetch('./comments-and-collaboration.examples.html');
57
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
58
+ root.innerHTML = await res.text();
59
+ } catch (err) {
60
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load comments-and-collaboration.examples.html β€” ${err.message}</p>`;
61
+ console.error('[comments-and-collaboration.html]', err);
62
+ }
63
+ </script>
64
+
65
+ </body>
66
+ </html>