@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,62 @@
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>Bulk Action Toolbar (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/button/button.css">
14
+ <link rel="stylesheet" href="../../components/card/card.css">
15
+ <link rel="stylesheet" href="../../components/code/code.css">
16
+ <link rel="stylesheet" href="../../components/divider/divider.css">
17
+ <link rel="stylesheet" href="../../components/table/table.css">
18
+ <link rel="stylesheet" href="../../components/table-toolbar/table-toolbar.css">
19
+ <link rel="stylesheet" href="../../components/tag/tag.css">
20
+ <link rel="stylesheet" href="../../components/text/text.css">
21
+ <link rel="stylesheet" href="../../components/toolbar/toolbar.css">
22
+
23
+ <!-- Component JS -->
24
+ <script type="module" src="../../components/button/button.js"></script>
25
+ <script type="module" src="../../components/card/card.js"></script>
26
+ <script type="module" src="../../components/code/code.js"></script>
27
+ <script type="module" src="../../components/divider/divider.js"></script>
28
+ <script type="module" src="../../components/table/table.js"></script>
29
+ <script type="module" src="../../components/table-toolbar/table-toolbar.js"></script>
30
+ <script type="module" src="../../components/tag/tag.js"></script>
31
+ <script type="module" src="../../components/text/text.js"></script>
32
+ <script type="module" src="../../components/toolbar/toolbar.js"></script>
33
+
34
+ <style>
35
+ :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); }
36
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
37
+ </style>
38
+ </head>
39
+ <body>
40
+
41
+ <main id="demo-root">
42
+ <p>Loading examples…</p>
43
+ </main>
44
+
45
+ <script type="module">
46
+ const root = document.getElementById('demo-root');
47
+ try {
48
+ const res = await fetch('./bulk-action-toolbar.examples.html');
49
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
50
+ root.innerHTML = await res.text();
51
+ try {
52
+ const mod = await import(/* @vite-ignore */ './bulk-action-toolbar.examples.js');
53
+ mod.default?.(root);
54
+ } catch (e) { console.error('[bulk-action-toolbar.html] setup failed:', e); }
55
+ } catch (err) {
56
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load bulk-action-toolbar.examples.html — ${err.message}</p>`;
57
+ console.error('[bulk-action-toolbar.html]', err);
58
+ }
59
+ </script>
60
+
61
+ </body>
62
+ </html>
@@ -0,0 +1,151 @@
1
+ <header>
2
+ <div>
3
+ <h1>Changelog feed</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">card-ui</tag-ui> <tag-ui size="sm">tag-ui</tag-ui> <tag-ui size="sm">list-ui</tag-ui> <tag-ui size="sm">heading-ui</tag-ui>
6
+ </div>
7
+ </div>
8
+ <p>"What's new" in-app surface for product updates. Each release entry carries a version + date header, Added / Changed / Fixed / Deprecated section tags following <a href="https://keepachangelog.com/en/1.1.0/">Keep-a-Changelog</a>, and the bulleted change list. Use in admin-shell sidebars (the Changelog nav item), settings pages, or a dedicated /changelog route.</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>Recurring product announcements where users care about the cumulative trail (engineers, power users, paid tiers). Distinct from <a href="/site/components/toast">toast-ui</a> (single ephemeral notification), <a href="/site/components/feed">feed-ui</a> (top-layer notification queue), and <a href="/site/components/timeline">timeline-ui</a> (single-actor narrative). Composed inline; not a routed page — consumers choose the surface (drawer, sidebar, settings tab).</p>
14
+ </section>
15
+
16
+ <section data-section data-property="basic">
17
+ <h2 variant="section">Basic — three releases</h2>
18
+ <p data-note>Section-grouped layout (GitHub / Linear convention): each release carries a version + date header, then per-section eyebrows (Added / Changed / Fixed / Deprecated / Removed) followed by bulleted prose. Sections are <em>grouped</em>, not tagged per row — variable tag widths break left-edge alignment of prose; eyebrow + bullets keep one consistent reading column.</p>
19
+ <div data-artifact-container>
20
+ <div data-artifact-item data-artifact-label="changelog feed — 3 releases">
21
+ <card-ui data-chunk="changelog-feed-basic" style="max-width: 640px;">
22
+ <header>
23
+ <span slot="heading" variant="section">What's new</span>
24
+ <text-ui slot="description" color="subtle">3 releases in the last 30 days</text-ui>
25
+ </header>
26
+ <section>
27
+ <col-ui gap="6">
28
+
29
+ <!-- Release: v2.3.0 -->
30
+ <col-ui gap="4" data-release="v2.3.0">
31
+ <row-ui gap="2" align="baseline" justify="between">
32
+ <row-ui gap="2" align="baseline">
33
+ <text-ui strong size="lg">v2.3.0</text-ui>
34
+ <tag-ui size="sm" variant="primary">Latest</tag-ui>
35
+ </row-ui>
36
+ <text-ui color="subtle" size="sm">March 12, 2026</text-ui>
37
+ </row-ui>
38
+
39
+ <col-ui gap="2" data-section="added">
40
+ <text-ui variant="kicker" color="primary">Added</text-ui>
41
+ <ul class="changelog-bullets">
42
+ <li>Bulk-edit mode for the data-table — multi-select rows, then update column values in one pass.</li>
43
+ <li>CSV export now respects the visible-columns filter.</li>
44
+ </ul>
45
+ </col-ui>
46
+
47
+ <col-ui gap="2" data-section="fixed">
48
+ <text-ui variant="kicker" color="success">Fixed</text-ui>
49
+ <ul class="changelog-bullets">
50
+ <li>Resolved a sort-stability bug when two rows had identical sort keys.</li>
51
+ </ul>
52
+ </col-ui>
53
+ </col-ui>
54
+
55
+ <divider-ui></divider-ui>
56
+
57
+ <!-- Release: v2.2.1 -->
58
+ <col-ui gap="4" data-release="v2.2.1">
59
+ <row-ui gap="2" align="baseline" justify="between">
60
+ <text-ui strong size="lg">v2.2.1</text-ui>
61
+ <text-ui color="subtle" size="sm">March 5, 2026</text-ui>
62
+ </row-ui>
63
+
64
+ <col-ui gap="2" data-section="fixed">
65
+ <text-ui variant="kicker" color="success">Fixed</text-ui>
66
+ <ul class="changelog-bullets">
67
+ <li>API rate-limit headers (<code>X-RateLimit-*</code>) now surface in client SDKs.</li>
68
+ <li>Date-range picker no longer resets to today when reopening with a saved selection.</li>
69
+ </ul>
70
+ </col-ui>
71
+ </col-ui>
72
+
73
+ <divider-ui></divider-ui>
74
+
75
+ <!-- Release: v2.2.0 -->
76
+ <col-ui gap="4" data-release="v2.2.0">
77
+ <row-ui gap="2" align="baseline" justify="between">
78
+ <text-ui strong size="lg">v2.2.0</text-ui>
79
+ <text-ui color="subtle" size="sm">February 26, 2026</text-ui>
80
+ </row-ui>
81
+
82
+ <col-ui gap="2" data-section="added">
83
+ <text-ui variant="kicker" color="primary">Added</text-ui>
84
+ <ul class="changelog-bullets">
85
+ <li>Workspace-level audit log — see who did what across all members.</li>
86
+ </ul>
87
+ </col-ui>
88
+
89
+ <col-ui gap="2" data-section="changed">
90
+ <text-ui variant="kicker">Changed</text-ui>
91
+ <ul class="changelog-bullets">
92
+ <li>Toast notifications gained an <code>Undo</code> affordance for destructive actions.</li>
93
+ </ul>
94
+ </col-ui>
95
+
96
+ <col-ui gap="2" data-section="deprecated">
97
+ <text-ui variant="kicker" color="warning">Deprecated</text-ui>
98
+ <ul class="changelog-bullets">
99
+ <li>Legacy <code>/v1/export</code> endpoint will be removed in v3.0. Migrate to <code>/v2/jobs/export</code>.</li>
100
+ </ul>
101
+ </col-ui>
102
+ </col-ui>
103
+
104
+ </col-ui>
105
+ </section>
106
+ <footer divider>
107
+ <text-ui color="subtle" size="sm">Showing 3 of 47 releases</text-ui>
108
+ <row-ui slot="action" gap="2">
109
+ <button-ui text="View all releases" variant="ghost" size="sm" icon-trailing="arrow-up-right"></button-ui>
110
+ </row-ui>
111
+ </footer>
112
+ </card-ui>
113
+ </div>
114
+ </div>
115
+ <style>
116
+ /* Section-grouped bullets — tight leading + small disc indent so the
117
+ text column reads as a single visual stack under each eyebrow. */
118
+ .changelog-bullets {
119
+ margin: 0;
120
+ padding-inline-start: 1.25rem;
121
+ list-style: disc;
122
+ color: var(--md-sys-color-neutral-on-surface);
123
+ }
124
+ .changelog-bullets li {
125
+ padding-block: 0.125rem;
126
+ line-height: var(--a-line-height-relaxed, 1.55);
127
+ }
128
+ </style>
129
+ </section>
130
+
131
+ <section data-section data-property="composition">
132
+ <h2 variant="section">Composition rules</h2>
133
+ <ul>
134
+ <li><strong>Newest first</strong> — top-down chronological. The most recent release is the first the user sees; load-older appends below.</li>
135
+ <li><strong>Latest tag on the newest entry</strong> — a <code>variant="primary"</code> "Latest" tag next to the top version disambiguates which is the current shipping release.</li>
136
+ <li><strong>Date in subtle text</strong> — date sits in <code>color="subtle"</code> typography to the right of the version; never the primary read. Absolute date (March 12, 2026) — never relative for a permanent changelog.</li>
137
+ <li><strong>Group by section, don't tag per row</strong> — Keep-a-Changelog sections (Added / Changed / Fixed / Deprecated / Removed / Security) are eyebrow labels above bulleted prose, not per-row tag pills. Variable tag widths (Added 3-letter, Deprecated 9-letter) break left-edge alignment; eyebrow headers keep one consistent reading column.</li>
138
+ <li><strong>Eyebrow color encodes severity</strong> — Added (primary), Fixed (success), Deprecated (warning), Removed/Security (danger). Changed uses the default fg. Same vocabulary every release.</li>
139
+ <li><strong>Bullets stay tight</strong> — one sentence per change, code spans for endpoints / config keys. If a change needs three paragraphs, link out to a docs page; the changelog is a scan surface.</li>
140
+ <li><strong>Footer affordance is "View all", not pagination</strong> — most users don't want page 47. Link to a dedicated /releases route; advanced users follow.</li>
141
+ </ul>
142
+ </section>
143
+
144
+ <section data-section data-property="cross-references">
145
+ <h2 variant="section">Cross-references</h2>
146
+ <ul>
147
+ <li><a href="/site/components/card">card-ui</a> · <a href="/site/components/tag">tag-ui</a> · <a href="/site/components/list">list-ui</a> · <a href="/site/components/divider">divider-ui</a> — primitives composed here.</li>
148
+ <li><a href="/site/patterns/admin-shell">admin-shell</a> — common surface for the Changelog nav item; this pattern slots into a sidebar drawer or settings tab.</li>
149
+ <li><a href="https://keepachangelog.com/en/1.1.0/">Keep-a-Changelog spec</a> — section-tag vocabulary source.</li>
150
+ </ul>
151
+ </section>
@@ -0,0 +1,57 @@
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>Changelog feed (pattern) — AdiaUI</title>
7
+
8
+ <link rel="stylesheet" href="../../styles/resets.css">
9
+ <link rel="stylesheet" href="../../styles/tokens.css">
10
+
11
+ <link rel="stylesheet" href="../../components/button/button.css">
12
+ <link rel="stylesheet" href="../../components/card/card.css">
13
+ <link rel="stylesheet" href="../../components/col/col.css">
14
+ <link rel="stylesheet" href="../../components/divider/divider.css">
15
+ <link rel="stylesheet" href="../../components/heading/heading.css">
16
+ <link rel="stylesheet" href="../../components/icon/icon.css">
17
+ <link rel="stylesheet" href="../../components/list/list.css">
18
+ <link rel="stylesheet" href="../../components/row/row.css">
19
+ <link rel="stylesheet" href="../../components/tag/tag.css">
20
+ <link rel="stylesheet" href="../../components/text/text.css">
21
+
22
+ <script type="module" src="../../components/button/button.js"></script>
23
+ <script type="module" src="../../components/card/card.js"></script>
24
+ <script type="module" src="../../components/col/col.js"></script>
25
+ <script type="module" src="../../components/divider/divider.js"></script>
26
+ <script type="module" src="../../components/heading/heading.js"></script>
27
+ <script type="module" src="../../components/icon/icon.js"></script>
28
+ <script type="module" src="../../components/list/list.js"></script>
29
+ <script type="module" src="../../components/row/row.js"></script>
30
+ <script type="module" src="../../components/tag/tag.js"></script>
31
+ <script type="module" src="../../components/text/text.js"></script>
32
+
33
+ <style>
34
+ :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); }
35
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
36
+ </style>
37
+ </head>
38
+ <body>
39
+
40
+ <main id="demo-root">
41
+ <p>Loading examples…</p>
42
+ </main>
43
+
44
+ <script type="module">
45
+ const root = document.getElementById('demo-root');
46
+ try {
47
+ const res = await fetch('./changelog-feed.examples.html');
48
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
49
+ root.innerHTML = await res.text();
50
+ } catch (err) {
51
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load changelog-feed.examples.html — ${err.message}</p>`;
52
+ console.error('[changelog-feed.html]', err);
53
+ }
54
+ </script>
55
+
56
+ </body>
57
+ </html>
@@ -0,0 +1,193 @@
1
+ <header>
2
+ <div>
3
+ <h1>Chart in Card</h1>
4
+ <div data-actions>
5
+ <tag-ui size="sm">card-ui</tag-ui> <tag-ui size="sm">chart-ui</tag-ui> <tag-ui size="sm">stat-ui</tag-ui>
6
+ </div>
7
+ </div>
8
+ <p>Composition pattern: embed a chart inside a card so the chart reads as a dashboard tile, not as raw data. Header communicates the metric in words; chart shows the shape; footer adds context.</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
+ Naked charts are rare in dashboards — they almost always sit inside a card that
15
+ supplies the metric name, current value, and a verbal summary. Prefer this pattern
16
+ whenever a chart is the primary content of a card, regardless of chart type.
17
+ </p>
18
+ </section>
19
+
20
+ <section data-section data-property="sparkline-tile">
21
+ <h2 variant="section">Sparkline tile</h2>
22
+ <p data-note>KPI + trend shape. Used in overview rows to show 4–6 metrics side-by-side.</p>
23
+ <div data-artifact-container>
24
+ <div data-artifact-item data-artifact-label="sparkline tile">
25
+ <card-ui data-chunk="chart-in-card-sparkline-tile" style="max-width:320px;">
26
+ <header>
27
+ <span slot="heading"><h2>Page Views</h2></span>
28
+ <text-ui slot="description" variant="title">84,232</text-ui>
29
+ </header>
30
+ <section bleed>
31
+ <chart-ui id="pat-spark-views" type="sparkline" x="d" y="v"></chart-ui>
32
+ </section>
33
+ </card-ui>
34
+ </div>
35
+ </div>
36
+ </section>
37
+
38
+ <section data-section data-property="full-chart">
39
+ <h2 variant="section">Full chart with framing</h2>
40
+ <p data-note>Chart as primary content. Header names the metric; footer adds a supporting action.</p>
41
+ <div data-artifact-container>
42
+ <div data-artifact-item data-artifact-label="full chart">
43
+ <card-ui data-chunk="chart-in-card-full-chart" style="max-width:520px;">
44
+ <header>
45
+ <span slot="heading"><h3>Revenue</h3></span>
46
+ <text-ui slot="description" color="subtle">Last 12 months</text-ui>
47
+ </header>
48
+ <section>
49
+ <chart-ui id="pat-revenue" type="bar" x="month" y="revenue" hide-values></chart-ui>
50
+ </section>
51
+ <footer>
52
+ <button-ui text="View report" variant="outline" stretch></button-ui>
53
+ </footer>
54
+ </card-ui>
55
+ </div>
56
+ </div>
57
+ </section>
58
+
59
+ <section data-section data-property="chart-plus-stat">
60
+ <h2 variant="section">Chart + headline stat</h2>
61
+ <p data-note>Stat in header pairs with the chart so the current value is legible before the chart renders.</p>
62
+ <div data-artifact-container>
63
+ <div data-artifact-item data-artifact-label="chart plus stat">
64
+ <card-ui data-chunk="chart-in-card-chart-plus-stat" style="max-width:520px;">
65
+ <header>
66
+ <span slot="heading">
67
+ <stat-ui label="MRR" value="$48,290" change="+12.4%" trend="up"></stat-ui>
68
+ </span>
69
+ </header>
70
+ <section>
71
+ <chart-ui id="pat-mrr" type="line" x="month" y="revenue" smooth="0.4" hide-values></chart-ui>
72
+ </section>
73
+ </card-ui>
74
+ </div>
75
+ </div>
76
+ </section>
77
+
78
+ <section data-section data-property="chart-plus-breakdown">
79
+ <h2 variant="section">Chart + inline breakdown</h2>
80
+ <p data-note>Chart shows aggregate; breakdown beneath gives the composition. Most SaaS "Overview" tiles follow this shape.</p>
81
+ <div data-artifact-container>
82
+ <div data-artifact-item data-artifact-label="chart plus breakdown">
83
+ <card-ui data-chunk="chart-in-card-chart-plus-breakdown" style="max-width:520px;">
84
+ <header>
85
+ <span slot="heading"><h3>Sessions</h3></span>
86
+ <text-ui slot="description" color="subtle">This week</text-ui>
87
+ </header>
88
+ <section>
89
+ <col-ui gap="3">
90
+ <chart-ui id="pat-sessions" type="bar" x="day" y="sessions" hide-values></chart-ui>
91
+ <grid-ui columns="3" gap="2">
92
+ <card-ui><section><stat-ui label="Desktop" value="2,840"></stat-ui></section></card-ui>
93
+ <card-ui><section><stat-ui label="Mobile" value="1,590"></stat-ui></section></card-ui>
94
+ <card-ui><section><stat-ui label="Tablet" value="280"></stat-ui></section></card-ui>
95
+ </grid-ui>
96
+ </col-ui>
97
+ </section>
98
+ </card-ui>
99
+ </div>
100
+ </div>
101
+ </section>
102
+
103
+ <section data-section data-property="trend-footer">
104
+ <h2 variant="section">Trend footer</h2>
105
+ <p data-note>Footer carries trend narrative + period caption using the new footer <code>heading</code> / <code>description</code> slot routing (symmetric with header). Shadcn-style revenue card translated to AdiaUI primitives.</p>
106
+ <div data-artifact-container>
107
+ <div data-artifact-item data-artifact-label="area chart + trend footer">
108
+ <card-ui data-chunk="chart-in-card-trend-footer" style="max-width:520px;">
109
+ <header>
110
+ <span slot="heading"><h3>Revenue</h3></span>
111
+ <text-ui slot="description" color="subtle">January – March 2024</text-ui>
112
+ </header>
113
+ <section>
114
+ <chart-ui id="pat-trend-revenue" type="area" x="month" y="revenue" hide-values></chart-ui>
115
+ </section>
116
+ <footer>
117
+ <span slot="heading">Trending up by 5.2% this month</span>
118
+ <text-ui slot="description" color="subtle">Showing total visitors for the last 3 months</text-ui>
119
+ </footer>
120
+ </card-ui>
121
+ </div>
122
+ </div>
123
+ </section>
124
+
125
+ <section data-section data-property="stat-with-sparkline">
126
+ <h2 variant="section">Stat with inline sparkline</h2>
127
+ <p data-note>Stat-ui's <code>chart</code> slot positions a sparkline to the right of the hero number — KPI and its trajectory as one visual unit.</p>
128
+ <div data-artifact-container>
129
+ <div data-artifact-item data-artifact-label="stat with sparkline slot">
130
+ <card-ui data-chunk="chart-in-card-stat-with-sparkline" style="max-width:320px;">
131
+ <section>
132
+ <stat-ui label="Revenue" value="$48.2k" change="+12.5%" trend="up">
133
+ <chart-ui id="pat-stat-spark" slot="chart" type="sparkline" x="month" y="value"></chart-ui>
134
+ </stat-ui>
135
+ </section>
136
+ </card-ui>
137
+ </div>
138
+ </div>
139
+ </section>
140
+
141
+ <section data-section data-property="chart-with-filter-pills">
142
+ <h2 variant="section">Chart with filter pills</h2>
143
+ <p data-note>A <code>segmented-ui</code> in the header's <code>action</code> slot drives a time-range selection. Wire its <code>value</code> to refetch / slice the chart's <code>.data</code> via a controller.</p>
144
+ <div data-artifact-container>
145
+ <div data-artifact-item data-artifact-label="chart with 1w / 2w / 1m / 3m pills">
146
+ <card-ui data-chunk="chart-in-card-chart-with-filter-pills" style="max-width:520px;">
147
+ <header>
148
+ <span slot="heading"><h3>Sessions</h3></span>
149
+ <segmented-ui slot="action" value="1m">
150
+ <segment-ui text="1w" value="1w"></segment-ui>
151
+ <segment-ui text="2w" value="2w"></segment-ui>
152
+ <segment-ui text="1m" value="1m"></segment-ui>
153
+ <segment-ui text="3m" value="3m"></segment-ui>
154
+ </segmented-ui>
155
+ </header>
156
+ <section>
157
+ <chart-ui id="pat-filter-sessions" type="line" x="day" y="sessions" hide-values></chart-ui>
158
+ </section>
159
+ </card-ui>
160
+ </div>
161
+ </div>
162
+ </section>
163
+
164
+ <section data-section data-property="anatomy">
165
+ <h2 variant="section">Anatomy</h2>
166
+ <code-ui language="html">&lt;card-ui&gt;
167
+ &lt;header&gt;
168
+ &lt;!-- name + current value --&gt;
169
+ &lt;span slot="heading"&gt;&lt;h3&gt;Revenue&lt;/h3&gt;&lt;/span&gt;
170
+ &lt;text-ui slot="description" color="subtle"&gt;Last 12 months&lt;/text-ui&gt;
171
+ &lt;/header&gt;
172
+
173
+ &lt;section&gt;
174
+ &lt;!-- the chart — bleed=true removes padding for sparklines --&gt;
175
+ &lt;chart-ui type="bar" x="month" y="revenue"&gt;&lt;/chart-ui&gt;
176
+ &lt;/section&gt;
177
+
178
+ &lt;footer&gt;
179
+ &lt;!-- optional CTA or supporting context --&gt;
180
+ &lt;button-ui text="View report" variant="outline" block&gt;&lt;/button-ui&gt;
181
+ &lt;/footer&gt;
182
+ &lt;/card-ui&gt;</code-ui>
183
+ </section>
184
+
185
+ <section data-section data-property="rules">
186
+ <h2 variant="section">Rules</h2>
187
+ <ul>
188
+ <li>For sparklines, set <code>bleed</code> on the card's <code>&lt;section&gt;</code> so the line touches the edges.</li>
189
+ <li>Put <code>hide-values</code> on bar/line charts inside cards — the stat in the header already shows the current number.</li>
190
+ <li>Use <code>&lt;stat-ui&gt;</code> in the heading slot only when the card's primary metric is a single number; otherwise use <code>&lt;h3&gt;</code> + description.</li>
191
+ <li>Keep breakdowns shallow — 3–4 stats max. More belongs in a full section, not inside a tile.</li>
192
+ </ul>
193
+ </section>
@@ -0,0 +1,46 @@
1
+ /** Chart-in-Card pattern — populate chart data */
2
+
3
+ const monthlyRevenue = [
4
+ { month: 'Jan', revenue: 3200 }, { month: 'Feb', revenue: 4500 },
5
+ { month: 'Mar', revenue: 2800 }, { month: 'Apr', revenue: 6200 },
6
+ { month: 'May', revenue: 5500 }, { month: 'Jun', revenue: 7100 },
7
+ { month: 'Jul', revenue: 5200 }, { month: 'Aug', revenue: 4800 },
8
+ { month: 'Sep', revenue: 5500 }, { month: 'Oct', revenue: 6100 },
9
+ { month: 'Nov', revenue: 6800 }, { month: 'Dec', revenue: 5400 },
10
+ ];
11
+
12
+ const sessions = [
13
+ { day: 'Mon', sessions: 620 }, { day: 'Tue', sessions: 710 },
14
+ { day: 'Wed', sessions: 580 }, { day: 'Thu', sessions: 830 },
15
+ { day: 'Fri', sessions: 790 }, { day: 'Sat', sessions: 420 },
16
+ { day: 'Sun', sessions: 360 },
17
+ ];
18
+
19
+ const sparkline = (vals) => vals.map((v, i) => ({ d: i, v }));
20
+
21
+ export default function setup(router) {
22
+ const views = router.querySelector('#pat-spark-views');
23
+ if (views) views.data = sparkline([42, 38, 45, 50, 48, 55, 52, 60, 58, 65, 62, 70]);
24
+
25
+ const revenue = router.querySelector('#pat-revenue');
26
+ if (revenue) revenue.data = monthlyRevenue;
27
+
28
+ const mrr = router.querySelector('#pat-mrr');
29
+ if (mrr) mrr.data = monthlyRevenue;
30
+
31
+ const sess = router.querySelector('#pat-sessions');
32
+ if (sess) sess.data = sessions;
33
+
34
+ const trend = router.querySelector('#pat-trend-revenue');
35
+ if (trend) trend.data = monthlyRevenue.slice(0, 3);
36
+
37
+ const statSpark = router.querySelector('#pat-stat-spark');
38
+ if (statSpark) statSpark.data = [
39
+ { month: 'Jan', value: 30 }, { month: 'Feb', value: 42 },
40
+ { month: 'Mar', value: 38 }, { month: 'Apr', value: 55 },
41
+ { month: 'May', value: 62 }, { month: 'Jun', value: 71 },
42
+ ];
43
+
44
+ const filterSess = router.querySelector('#pat-filter-sessions');
45
+ if (filterSess) filterSess.data = sessions;
46
+ }
@@ -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>Chart in Card (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/button/button.css">
14
+ <link rel="stylesheet" href="../../components/card/card.css">
15
+ <link rel="stylesheet" href="../../components/chart/chart.css">
16
+ <link rel="stylesheet" href="../../components/code/code.css">
17
+ <link rel="stylesheet" href="../../components/col/col.css">
18
+ <link rel="stylesheet" href="../../components/grid/grid.css">
19
+ <link rel="stylesheet" href="../../components/segment/segment.css">
20
+ <link rel="stylesheet" href="../../components/segmented/segmented.css">
21
+ <link rel="stylesheet" href="../../components/stat/stat.css">
22
+ <link rel="stylesheet" href="../../components/tag/tag.css">
23
+ <link rel="stylesheet" href="../../components/text/text.css">
24
+
25
+ <!-- Component JS -->
26
+ <script type="module" src="../../components/button/button.js"></script>
27
+ <script type="module" src="../../components/card/card.js"></script>
28
+ <script type="module" src="../../components/chart/chart.js"></script>
29
+ <script type="module" src="../../components/code/code.js"></script>
30
+ <script type="module" src="../../components/col/col.js"></script>
31
+ <script type="module" src="../../components/grid/grid.js"></script>
32
+ <script type="module" src="../../components/segment/segment.js"></script>
33
+ <script type="module" src="../../components/segmented/segmented.js"></script>
34
+ <script type="module" src="../../components/stat/stat.js"></script>
35
+ <script type="module" src="../../components/tag/tag.js"></script>
36
+ <script type="module" src="../../components/text/text.js"></script>
37
+
38
+ <style>
39
+ :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); }
40
+ main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
41
+ </style>
42
+ </head>
43
+ <body>
44
+
45
+ <main id="demo-root">
46
+ <p>Loading examples…</p>
47
+ </main>
48
+
49
+ <script type="module">
50
+ const root = document.getElementById('demo-root');
51
+ try {
52
+ const res = await fetch('./chart-in-card.examples.html');
53
+ if (!res.ok) throw new Error(`fetch failed (${res.status})`);
54
+ root.innerHTML = await res.text();
55
+ try {
56
+ const mod = await import(/* @vite-ignore */ './chart-in-card.examples.js');
57
+ mod.default?.(root);
58
+ } catch (e) { console.error('[chart-in-card.html] setup failed:', e); }
59
+ } catch (err) {
60
+ root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chart-in-card.examples.html — ${err.message}</p>`;
61
+ console.error('[chart-in-card.html]', err);
62
+ }
63
+ </script>
64
+
65
+ </body>
66
+ </html>