@adia-ai/web-modules 0.8.35 → 0.8.37
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.
- package/CHANGELOG.md +22 -0
- package/README.md +3 -3
- package/agent-admin/admin-roster/admin-roster.js +1 -1
- package/agent-admin/admin-settings/admin-settings.js +1 -1
- package/agent-admin/agent-admin/agent-admin.js +1 -1
- package/billing/billing-overview/billing-overview.a2ui.json +281 -0
- package/billing/billing-overview/billing-overview.class.js +838 -0
- package/billing/billing-overview/billing-overview.css +223 -0
- package/billing/billing-overview/billing-overview.js +16 -0
- package/billing/billing-overview/billing-overview.yaml +441 -0
- package/billing/index.js +21 -0
- package/billing/invoice-detail/invoice-detail.a2ui.json +276 -0
- package/billing/invoice-detail/invoice-detail.class.js +711 -0
- package/billing/invoice-detail/invoice-detail.css +305 -0
- package/billing/invoice-detail/invoice-detail.js +16 -0
- package/billing/invoice-detail/invoice-detail.yaml +411 -0
- package/billing/invoice-history/invoice-history.a2ui.json +315 -0
- package/billing/invoice-history/invoice-history.class.js +672 -0
- package/billing/invoice-history/invoice-history.css +130 -0
- package/billing/invoice-history/invoice-history.js +16 -0
- package/billing/invoice-history/invoice-history.yaml +398 -0
- package/billing/payment-method-form/payment-method-form.a2ui.json +310 -0
- package/billing/payment-method-form/payment-method-form.class.js +886 -0
- package/billing/payment-method-form/payment-method-form.css +149 -0
- package/billing/payment-method-form/payment-method-form.js +16 -0
- package/billing/payment-method-form/payment-method-form.yaml +430 -0
- package/billing/payment-method-list/payment-method-list.a2ui.json +283 -0
- package/billing/payment-method-list/payment-method-list.class.js +705 -0
- package/billing/payment-method-list/payment-method-list.css +128 -0
- package/billing/payment-method-list/payment-method-list.js +16 -0
- package/billing/payment-method-list/payment-method-list.yaml +355 -0
- package/billing/plan-picker/plan-picker.a2ui.json +349 -0
- package/billing/plan-picker/plan-picker.class.js +635 -0
- package/billing/plan-picker/plan-picker.css +227 -0
- package/billing/plan-picker/plan-picker.js +16 -0
- package/billing/plan-picker/plan-picker.yaml +453 -0
- package/chat/README.md +1 -1
- package/chat/chat-composer/chat-composer.js +2 -2
- package/chat/chat-empty/chat-empty.js +2 -2
- package/chat/chat-shell/chat-shell.js +4 -4
- package/chat/chat-sidebar/chat-sidebar.js +2 -2
- package/chat/chat-surfaces/chat-surfaces.js +2 -2
- package/chat/chat-thread/chat-thread.js +2 -2
- package/dashboard/dashboard-layout/dashboard-layout.a2ui.json +254 -0
- package/dashboard/dashboard-layout/dashboard-layout.css +190 -0
- package/dashboard/dashboard-layout/dashboard-layout.js +289 -0
- package/dashboard/dashboard-layout/dashboard-layout.yaml +374 -0
- package/dashboard/date-range-selector/date-range-selector.a2ui.json +236 -0
- package/dashboard/date-range-selector/date-range-selector.css +84 -0
- package/dashboard/date-range-selector/date-range-selector.js +686 -0
- package/dashboard/date-range-selector/date-range-selector.yaml +358 -0
- package/dashboard/index.js +14 -0
- package/dist/everything.min.js +1 -1
- package/editor/editor-canvas/editor-canvas.js +2 -2
- package/editor/editor-shell/editor-shell.js +2 -2
- package/editor/editor-sidebar/editor-sidebar.js +2 -2
- package/editor/editor-toolbar/editor-toolbar.js +2 -2
- package/feedback/confirm-dialog/confirm-dialog.a2ui.json +206 -0
- package/feedback/confirm-dialog/confirm-dialog.css +157 -0
- package/feedback/confirm-dialog/confirm-dialog.js +383 -0
- package/feedback/confirm-dialog/confirm-dialog.yaml +297 -0
- package/feedback/index.js +10 -0
- package/form/form-popover/form-popover.js +1 -1
- package/generative/index.d.ts +1 -1
- package/generative/index.js +2 -2
- package/onboarding/index.js +1 -0
- package/onboarding/onboarding-checklist/onboarding-checklist.a2ui.json +263 -0
- package/onboarding/onboarding-checklist/onboarding-checklist.css +157 -0
- package/onboarding/onboarding-checklist/onboarding-checklist.js +428 -0
- package/onboarding/onboarding-checklist/onboarding-checklist.yaml +236 -0
- package/package.json +99 -6
- package/runtime/a2ui-root/a2ui-root.js +3 -3
- package/runtime/gen-root/gen-root.js +5 -5
- package/settings/index.js +12 -0
- package/settings/integrations-page/integrations-page.a2ui.json +274 -0
- package/settings/integrations-page/integrations-page.css +177 -0
- package/settings/integrations-page/integrations-page.d.ts +77 -0
- package/settings/integrations-page/integrations-page.js +413 -0
- package/settings/integrations-page/integrations-page.yaml +317 -0
- package/settings/notification-preferences/notification-preferences.a2ui.json +245 -0
- package/settings/notification-preferences/notification-preferences.css +204 -0
- package/settings/notification-preferences/notification-preferences.js +622 -0
- package/settings/notification-preferences/notification-preferences.yaml +358 -0
- package/shell/admin-command/admin-command.js +2 -2
- package/shell/admin-shell/admin-shell.js +2 -2
- package/shell/admin-sidebar/admin-sidebar.js +2 -2
- package/shell/embed-shell/embed-shell.js +3 -3
- package/simple/simple-shell/simple-shell.js +1 -1
- package/theme/theme-panel/theme-panel.js +2 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
<invoice-history-ui> — Canonical billing-list composite.
|
|
3
|
+
|
|
4
|
+
Composite over <table-ui> + <table-toolbar-ui> + <badge-ui> +
|
|
5
|
+
<button-ui> + <empty-state-ui>. The host stacks three regions in
|
|
6
|
+
DOM order: toolbar · table · empty-state. Each row in the table
|
|
7
|
+
is owned by <table-ui>; this composite only styles its own
|
|
8
|
+
region scaffolding + cell-internal billing chrome (status badge,
|
|
9
|
+
amount alignment, action cluster).
|
|
10
|
+
|
|
11
|
+
SPEC: docs/specs/implementation-ready/SPEC-008-invoice-history-table.md
|
|
12
|
+
Two-block @scope pattern per docs/specs/component-token-contract.md.
|
|
13
|
+
Zero raw color values (repo hard rule); rem units for sizes ≥ 3px.
|
|
14
|
+
═══════════════════════════════════════════════════════════════ */
|
|
15
|
+
|
|
16
|
+
/* ── Block 1: TOKEN DECLARATIONS ───────────────────────────────── */
|
|
17
|
+
|
|
18
|
+
invoice-history-ui {
|
|
19
|
+
--invoice-history-bg: transparent;
|
|
20
|
+
--invoice-history-gap: var(--a-space-3);
|
|
21
|
+
--invoice-history-row-min-height: var(--table-row-h, 3rem);
|
|
22
|
+
|
|
23
|
+
--invoice-history-toolbar-gap: var(--a-space-3);
|
|
24
|
+
|
|
25
|
+
--invoice-history-amount-font: var(--a-font-mono);
|
|
26
|
+
--invoice-history-amount-fg: var(--a-fg-strong, var(--md-sys-color-neutral-on-surface));
|
|
27
|
+
--invoice-history-date-fg: var(--a-fg-muted);
|
|
28
|
+
|
|
29
|
+
--invoice-history-filter-gap: var(--a-space-2);
|
|
30
|
+
|
|
31
|
+
--invoice-history-actions-gap: var(--a-space-1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ── Block 2: SCOPED LAYOUT ────────────────────────────────────── */
|
|
35
|
+
|
|
36
|
+
@scope (invoice-history-ui) {
|
|
37
|
+
|
|
38
|
+
:scope {
|
|
39
|
+
display: block;
|
|
40
|
+
background: var(--invoice-history-bg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ── Region stacking (toolbar · table · empty) ── */
|
|
44
|
+
:scope > [data-toolbar],
|
|
45
|
+
:scope > [data-table-host],
|
|
46
|
+
:scope > [data-empty] {
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:scope > [data-toolbar] {
|
|
51
|
+
margin-block-end: var(--invoice-history-gap);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Status-filter chip cluster lives in the toolbar's actions slot. */
|
|
55
|
+
:scope [data-invoice-filter] {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
gap: var(--invoice-history-filter-gap);
|
|
59
|
+
align-items: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* ── Underlying table cascade ── */
|
|
63
|
+
/* Forward row-height token. Do NOT set `display:` — table-ui's own
|
|
64
|
+
@scope assigns `display: grid` + sets `grid-template-columns` via
|
|
65
|
+
JS; overriding the display collapses the grid into a single
|
|
66
|
+
column. (Caught in v0.6.34 dogfood-sweep visual probe.) */
|
|
67
|
+
:scope > [data-table-host] > table-ui {
|
|
68
|
+
--table-row-h: var(--invoice-history-row-min-height);
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ── Per-cell billing chrome ── */
|
|
73
|
+
/* Amount cell — tabular-nums, mono stack, end-aligned. */
|
|
74
|
+
:scope [data-invoice-amount] {
|
|
75
|
+
font-family: var(--invoice-history-amount-font);
|
|
76
|
+
font-variant-numeric: tabular-nums;
|
|
77
|
+
color: var(--invoice-history-amount-fg);
|
|
78
|
+
text-align: end;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Status badge — let badge-ui's own variant supply the chrome.
|
|
82
|
+
We only adjust the cell's display so the badge doesn't stretch. */
|
|
83
|
+
:scope [data-invoice-status] {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Per-row action cluster (View + Download). */
|
|
89
|
+
:scope [data-invoice-actions] {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
gap: var(--invoice-history-actions-gap);
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: flex-end;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ── Empty + loading state branches ──
|
|
97
|
+
Hide [data-empty] when host is NOT empty; do NOT set a display
|
|
98
|
+
value when shown (would clobber empty-state-ui's flex layout). */
|
|
99
|
+
:scope:not([empty]) > [data-empty] {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
:scope[empty] > [data-table-host] {
|
|
103
|
+
display: none;
|
|
104
|
+
}
|
|
105
|
+
:scope[loading] > [data-empty] {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Hide the empty-state when the consumer provides a [slot="empty"]
|
|
110
|
+
override — the override is its own positioned block. */
|
|
111
|
+
:scope > [slot="empty"] {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
:scope[empty] > [slot="empty"] {
|
|
115
|
+
display: block;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ── Error state styling (data-stream-src fetch failed). ── */
|
|
119
|
+
:scope[error] > [data-empty] {
|
|
120
|
+
--empty-state-icon-fg: var(--a-danger-strong, var(--md-sys-color-danger));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ── Compact density forwards to the table primitive ── */
|
|
124
|
+
:scope[density="compact"] {
|
|
125
|
+
--invoice-history-row-min-height: var(--table-row-h-compact, 2.25rem);
|
|
126
|
+
}
|
|
127
|
+
:scope[density="comfortable"] {
|
|
128
|
+
--invoice-history-row-min-height: var(--table-row-h-comfortable, 3.5rem);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<invoice-history-ui>` — auto-registers the tag on import.
|
|
3
|
+
*
|
|
4
|
+
* For a non-side-effect class import (test isolation, tag override),
|
|
5
|
+
* use the class export from `./invoice-history.class.js`:
|
|
6
|
+
*
|
|
7
|
+
* import { InvoiceHistory } from '@adia-ai/web-modules/billing/invoice-history/class';
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { InvoiceHistory } from './invoice-history.class.js';
|
|
11
|
+
|
|
12
|
+
if (!customElements.get('invoice-history-ui')) {
|
|
13
|
+
customElements.define('invoice-history-ui', InvoiceHistory);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { InvoiceHistory };
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
+
name: InvoiceHistory
|
|
4
|
+
tag: invoice-history-ui
|
|
5
|
+
status: experimental
|
|
6
|
+
component: InvoiceHistory
|
|
7
|
+
category: display
|
|
8
|
+
version: 1
|
|
9
|
+
description: |
|
|
10
|
+
Canonical billing-list composite — a pre-configured <table-ui> with
|
|
11
|
+
invoice-shaped columns (number, issued, due, amount, status, actions),
|
|
12
|
+
status-badge cell renderer (paid/open/past-due/void/draft → semantic
|
|
13
|
+
badge variant), currency cell renderer, optional search + filter
|
|
14
|
+
chips via <table-toolbar-ui>, and a row-click that navigates to the
|
|
15
|
+
invoice detail page.
|
|
16
|
+
|
|
17
|
+
Wraps <table-ui> with billing-shaped columns + cell renderers + a
|
|
18
|
+
CSV-export toolbar. Consumer passes invoices[]; the composite owns
|
|
19
|
+
column shape, status-to-badge mapping, currency formatting, date
|
|
20
|
+
formatting, and navigation. Sibling to SPEC-007 (invoice detail).
|
|
21
|
+
|
|
22
|
+
Each invoice record: {id, number, status, issuedAt, dueAt, amount,
|
|
23
|
+
currency}. status MUST be one of "draft" | "open" | "paid" |
|
|
24
|
+
"past-due" | "void"; unknown values fall back to a neutral badge.
|
|
25
|
+
|
|
26
|
+
Spec: .claude/docs/specs/implementation-ready/SPEC-008-invoice-history-table.md.
|
|
27
|
+
|
|
28
|
+
# Per ADR-0027 — composites do NOT auto-import the primitives they
|
|
29
|
+
# stamp in connected()/render(). The consumer (or this primitive's
|
|
30
|
+
# .html demo shell) must explicitly side-effect-import each one.
|
|
31
|
+
composes:
|
|
32
|
+
- table-ui
|
|
33
|
+
- table-toolbar-ui
|
|
34
|
+
- badge-ui
|
|
35
|
+
- button-ui
|
|
36
|
+
- empty-state-ui
|
|
37
|
+
- pagination-ui
|
|
38
|
+
|
|
39
|
+
props:
|
|
40
|
+
invoices:
|
|
41
|
+
description: |
|
|
42
|
+
Array of invoice records. Source of truth for the rendered rows.
|
|
43
|
+
Shape per record: {id, number, status, issuedAt, dueAt, amount,
|
|
44
|
+
currency?}. status must be one of "draft" | "open" | "paid" |
|
|
45
|
+
"past-due" | "void". Empty array renders the empty-state.
|
|
46
|
+
type: array
|
|
47
|
+
default: []
|
|
48
|
+
dynamic: true
|
|
49
|
+
required: true
|
|
50
|
+
|
|
51
|
+
currency:
|
|
52
|
+
description: |
|
|
53
|
+
Default ISO 4217 currency code for amount formatting. Overridable
|
|
54
|
+
per-row via invoices[].currency.
|
|
55
|
+
type: string
|
|
56
|
+
default: "USD"
|
|
57
|
+
reflect: true
|
|
58
|
+
|
|
59
|
+
density:
|
|
60
|
+
description: |
|
|
61
|
+
Row density, forwarded to <table-ui>. `compact` for dense lists,
|
|
62
|
+
`standard` for default rows, `comfortable` for spacious rows.
|
|
63
|
+
type: string
|
|
64
|
+
default: standard
|
|
65
|
+
enum:
|
|
66
|
+
- compact
|
|
67
|
+
- standard
|
|
68
|
+
- comfortable
|
|
69
|
+
reflect: true
|
|
70
|
+
|
|
71
|
+
loading:
|
|
72
|
+
description: |
|
|
73
|
+
Forwarded to <table-ui> — renders skeleton rows instead of data
|
|
74
|
+
while a fetch is in flight.
|
|
75
|
+
type: boolean
|
|
76
|
+
default: false
|
|
77
|
+
reflect: true
|
|
78
|
+
dynamic: true
|
|
79
|
+
|
|
80
|
+
selectable:
|
|
81
|
+
description: |
|
|
82
|
+
When set, enables row selection via a leading checkbox column on
|
|
83
|
+
the underlying <table-ui> (bulk-action surface).
|
|
84
|
+
type: boolean
|
|
85
|
+
default: false
|
|
86
|
+
reflect: true
|
|
87
|
+
|
|
88
|
+
hrefPattern:
|
|
89
|
+
description: |
|
|
90
|
+
URL template for row-click navigation. The literal `{number}` is
|
|
91
|
+
replaced with the invoice's number on click. Defaults to
|
|
92
|
+
`/invoices/{number}`.
|
|
93
|
+
type: string
|
|
94
|
+
default: "/invoices/{number}"
|
|
95
|
+
reflect: true
|
|
96
|
+
attribute: href-pattern
|
|
97
|
+
|
|
98
|
+
paginate:
|
|
99
|
+
description: |
|
|
100
|
+
Rows per page, forwarded to <table-ui>. 0 = show all rows.
|
|
101
|
+
type: number
|
|
102
|
+
default: 25
|
|
103
|
+
reflect: true
|
|
104
|
+
|
|
105
|
+
exportable:
|
|
106
|
+
description: |
|
|
107
|
+
When set, the default toolbar carries an "Export CSV" button.
|
|
108
|
+
Consumers overriding the toolbar via slot="toolbar" can omit
|
|
109
|
+
this and stamp their own export affordance.
|
|
110
|
+
type: boolean
|
|
111
|
+
default: true
|
|
112
|
+
reflect: true
|
|
113
|
+
|
|
114
|
+
locale:
|
|
115
|
+
description: |
|
|
116
|
+
Locale for Intl.NumberFormat (amount) and Intl.DateTimeFormat
|
|
117
|
+
(issuedAt / dueAt). Defaults to document.documentElement.lang
|
|
118
|
+
(or "en-US" when absent).
|
|
119
|
+
type: string
|
|
120
|
+
default: ""
|
|
121
|
+
|
|
122
|
+
filter:
|
|
123
|
+
description: |
|
|
124
|
+
Active status filter — narrows visible rows to a single status
|
|
125
|
+
bucket. Empty string = show all. Mirrors the toolbar chip-group
|
|
126
|
+
selection state.
|
|
127
|
+
type: string
|
|
128
|
+
default: ""
|
|
129
|
+
reflect: true
|
|
130
|
+
enum:
|
|
131
|
+
- ""
|
|
132
|
+
- draft
|
|
133
|
+
- open
|
|
134
|
+
- paid
|
|
135
|
+
- past-due
|
|
136
|
+
- void
|
|
137
|
+
dynamic: true
|
|
138
|
+
|
|
139
|
+
data-stream-src:
|
|
140
|
+
description: |
|
|
141
|
+
Optional endpoint returning the `invoices` array (universal
|
|
142
|
+
data-stream-* trait). On successful load, `invoices` is replaced
|
|
143
|
+
and a `load` event fires; on failure an `error` event fires.
|
|
144
|
+
type: string
|
|
145
|
+
default: ""
|
|
146
|
+
attribute: data-stream-src
|
|
147
|
+
|
|
148
|
+
events:
|
|
149
|
+
invoice-row-click:
|
|
150
|
+
description: |
|
|
151
|
+
Fired when an invoice row is activated (mouse click or keyboard
|
|
152
|
+
Enter / Space). Listener can preventDefault() to suppress the
|
|
153
|
+
default `window.location.assign(href)` navigation. Bubbles.
|
|
154
|
+
detail:
|
|
155
|
+
invoice:
|
|
156
|
+
type: object
|
|
157
|
+
description: The invoice record under the clicked row.
|
|
158
|
+
href:
|
|
159
|
+
type: string
|
|
160
|
+
description: Resolved navigation URL.
|
|
161
|
+
|
|
162
|
+
invoice-selection-change:
|
|
163
|
+
description: |
|
|
164
|
+
Fired when row selection changes (only when `selectable` is set).
|
|
165
|
+
Bubbles.
|
|
166
|
+
detail:
|
|
167
|
+
selected:
|
|
168
|
+
type: array
|
|
169
|
+
description: Array of selected invoice records.
|
|
170
|
+
|
|
171
|
+
invoice-filter-change:
|
|
172
|
+
description: |
|
|
173
|
+
Fired when the status filter changes via the toolbar chip group.
|
|
174
|
+
Bubbles.
|
|
175
|
+
detail:
|
|
176
|
+
filter:
|
|
177
|
+
type: string
|
|
178
|
+
description: New status filter value (empty string = all).
|
|
179
|
+
enum:
|
|
180
|
+
- ""
|
|
181
|
+
- draft
|
|
182
|
+
- open
|
|
183
|
+
- paid
|
|
184
|
+
- past-due
|
|
185
|
+
- void
|
|
186
|
+
previous:
|
|
187
|
+
type: string
|
|
188
|
+
description: Previous filter value.
|
|
189
|
+
|
|
190
|
+
invoice-export:
|
|
191
|
+
description: |
|
|
192
|
+
Fired when the default "Export CSV" toolbar button is pressed.
|
|
193
|
+
Detail carries the generated blob; consumers may preventDefault
|
|
194
|
+
to suppress the default download. Bubbles.
|
|
195
|
+
detail:
|
|
196
|
+
blob:
|
|
197
|
+
type: object
|
|
198
|
+
description: The generated text/csv Blob.
|
|
199
|
+
rowCount:
|
|
200
|
+
type: integer
|
|
201
|
+
description: Number of rows in the export.
|
|
202
|
+
|
|
203
|
+
load:
|
|
204
|
+
description: |
|
|
205
|
+
Fired when `data-stream-src` finishes a successful fetch and
|
|
206
|
+
`invoices` is populated. Bubbles.
|
|
207
|
+
detail:
|
|
208
|
+
count:
|
|
209
|
+
type: integer
|
|
210
|
+
description: Number of invoices loaded.
|
|
211
|
+
|
|
212
|
+
error:
|
|
213
|
+
description: |
|
|
214
|
+
Fired when a `data-stream-src` fetch fails. Bubbles.
|
|
215
|
+
detail:
|
|
216
|
+
reason:
|
|
217
|
+
type: string
|
|
218
|
+
description: One of `fetch-failed`.
|
|
219
|
+
|
|
220
|
+
slots:
|
|
221
|
+
toolbar:
|
|
222
|
+
description: |
|
|
223
|
+
Optional pre-table action toolbar — overrides the default
|
|
224
|
+
<table-toolbar-ui> + export button stamp. Use when the host
|
|
225
|
+
surface needs custom actions (e.g. "New invoice", "Reconcile").
|
|
226
|
+
|
|
227
|
+
empty:
|
|
228
|
+
description: |
|
|
229
|
+
Custom empty-state content when `invoices` is empty. Falls back
|
|
230
|
+
to a default <empty-state-ui icon="receipt"> when omitted.
|
|
231
|
+
|
|
232
|
+
states:
|
|
233
|
+
- name: idle
|
|
234
|
+
description: Default — rows rendered, ready for interaction.
|
|
235
|
+
- name: loading
|
|
236
|
+
description: A `data-stream-src` fetch is in flight.
|
|
237
|
+
attribute: loading
|
|
238
|
+
- name: empty
|
|
239
|
+
description: No invoices to render (computed from invoices.length).
|
|
240
|
+
attribute: empty
|
|
241
|
+
- name: error
|
|
242
|
+
description: Last `data-stream-src` fetch failed.
|
|
243
|
+
attribute: error
|
|
244
|
+
|
|
245
|
+
traits: []
|
|
246
|
+
|
|
247
|
+
tokens:
|
|
248
|
+
--invoice-history-bg:
|
|
249
|
+
description: Host background. Defaults to transparent.
|
|
250
|
+
default: transparent
|
|
251
|
+
--invoice-history-gap:
|
|
252
|
+
description: Vertical gap between toolbar / table / pagination regions.
|
|
253
|
+
default: var(--a-space-3)
|
|
254
|
+
--invoice-history-row-min-height:
|
|
255
|
+
description: Forwarded as `--table-row-h` to <table-ui>; row minimum height.
|
|
256
|
+
default: var(--table-row-h, 3rem)
|
|
257
|
+
--invoice-history-toolbar-gap:
|
|
258
|
+
description: Gap between toolbar clusters (title · filter chips · export).
|
|
259
|
+
default: var(--a-space-3)
|
|
260
|
+
--invoice-history-amount-font:
|
|
261
|
+
description: Font family for tabular amounts; defaults to the mono stack.
|
|
262
|
+
default: var(--a-font-mono)
|
|
263
|
+
--invoice-history-amount-fg:
|
|
264
|
+
description: Amount cell foreground.
|
|
265
|
+
default: var(--a-fg-strong, var(--a-fg))
|
|
266
|
+
--invoice-history-date-fg:
|
|
267
|
+
description: Secondary metadata (issued / due dates) foreground.
|
|
268
|
+
default: var(--a-fg-muted)
|
|
269
|
+
--invoice-history-filter-gap:
|
|
270
|
+
description: Gap between status-filter chips.
|
|
271
|
+
default: var(--a-space-2)
|
|
272
|
+
|
|
273
|
+
requiredIcons:
|
|
274
|
+
- download-simple
|
|
275
|
+
- receipt
|
|
276
|
+
- magnifying-glass
|
|
277
|
+
|
|
278
|
+
a2ui:
|
|
279
|
+
rules:
|
|
280
|
+
- >-
|
|
281
|
+
InvoiceHistory.invoices MUST be a non-empty array on commit. Empty
|
|
282
|
+
arrays render the empty-state (no rows).
|
|
283
|
+
- >-
|
|
284
|
+
invoices[].status MUST be one of "draft" | "open" | "paid" |
|
|
285
|
+
"past-due" | "void". Unknown values fall back to a neutral
|
|
286
|
+
badge variant.
|
|
287
|
+
- >-
|
|
288
|
+
InvoiceHistory MUST NOT receive a `columns` prop — columns are
|
|
289
|
+
owned by the composite. Consumers needing custom columns should
|
|
290
|
+
compose <table-ui> directly with their own column array.
|
|
291
|
+
- >-
|
|
292
|
+
`hrefPattern` is a string template with `{number}` interpolation.
|
|
293
|
+
Consumers needing dynamic resolution (query-strings, function-
|
|
294
|
+
based routes) should preventDefault on `invoice-row-click` and
|
|
295
|
+
route themselves.
|
|
296
|
+
- >-
|
|
297
|
+
Pair with `InvoiceDetail` (SPEC-007) at the route resolved by
|
|
298
|
+
`hrefPattern` so the row-click destination exists.
|
|
299
|
+
|
|
300
|
+
anti_patterns:
|
|
301
|
+
- wrong: |
|
|
302
|
+
<table-ui sortable>
|
|
303
|
+
<col-def key="number" label="Invoice"></col-def>
|
|
304
|
+
<col-def key="status" label="Status"></col-def>
|
|
305
|
+
</table-ui>
|
|
306
|
+
why: |
|
|
307
|
+
Hand-rolled billing list. Reinvents the canonical composite,
|
|
308
|
+
drifts on status-badge mapping, currency formatting, and
|
|
309
|
+
date format.
|
|
310
|
+
fix: |
|
|
311
|
+
<invoice-history-ui .invoices="${rows}"></invoice-history-ui>
|
|
312
|
+
- wrong: |
|
|
313
|
+
<invoice-history-ui .columns="${customColumns}"
|
|
314
|
+
.invoices="${rows}"></invoice-history-ui>
|
|
315
|
+
why: |
|
|
316
|
+
Columns are owned by the composite. Custom columns belong on a
|
|
317
|
+
different <table-ui> composition.
|
|
318
|
+
fix: |
|
|
319
|
+
<invoice-history-ui .invoices="${rows}"></invoice-history-ui>
|
|
320
|
+
|
|
321
|
+
examples:
|
|
322
|
+
- name: canonical
|
|
323
|
+
description: 6-column billing list with status badges, currency formatting, and pagination.
|
|
324
|
+
a2ui: |
|
|
325
|
+
[
|
|
326
|
+
{
|
|
327
|
+
"id": "inv-hist-1",
|
|
328
|
+
"component": "InvoiceHistory",
|
|
329
|
+
"currency": "USD",
|
|
330
|
+
"paginate": 25,
|
|
331
|
+
"invoices": [
|
|
332
|
+
{"id":"i1","number":"INV-001234","status":"paid","issuedAt":"2026-05-01","dueAt":"2026-05-15","amount":24.50},
|
|
333
|
+
{"id":"i2","number":"INV-001235","status":"open","issuedAt":"2026-05-08","dueAt":"2026-05-22","amount":24.50},
|
|
334
|
+
{"id":"i3","number":"INV-001236","status":"past-due","issuedAt":"2026-04-15","dueAt":"2026-04-29","amount":24.50}
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
- name: streamed
|
|
339
|
+
description: Server-streamed invoices via data-stream-src.
|
|
340
|
+
a2ui: |
|
|
341
|
+
[
|
|
342
|
+
{
|
|
343
|
+
"id": "inv-hist-stream",
|
|
344
|
+
"component": "InvoiceHistory",
|
|
345
|
+
"data-stream-src": "/api/invoices",
|
|
346
|
+
"currency": "USD",
|
|
347
|
+
"paginate": 50
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
|
|
351
|
+
keywords:
|
|
352
|
+
- invoice
|
|
353
|
+
- invoices
|
|
354
|
+
- billing
|
|
355
|
+
- invoice-history
|
|
356
|
+
- invoice-list
|
|
357
|
+
- payments-history
|
|
358
|
+
- receipt
|
|
359
|
+
- receipts
|
|
360
|
+
- statement
|
|
361
|
+
- statements
|
|
362
|
+
- subscription
|
|
363
|
+
- charges
|
|
364
|
+
- past-due
|
|
365
|
+
- paid
|
|
366
|
+
- billing-list
|
|
367
|
+
- billing-table
|
|
368
|
+
- download-invoice
|
|
369
|
+
- export-invoices
|
|
370
|
+
|
|
371
|
+
synonyms:
|
|
372
|
+
invoice:
|
|
373
|
+
- bill
|
|
374
|
+
- statement
|
|
375
|
+
- receipt
|
|
376
|
+
billing:
|
|
377
|
+
- invoice
|
|
378
|
+
- payment
|
|
379
|
+
- subscription
|
|
380
|
+
statement:
|
|
381
|
+
- invoice
|
|
382
|
+
- bill
|
|
383
|
+
receipts:
|
|
384
|
+
- invoices
|
|
385
|
+
- billing
|
|
386
|
+
history:
|
|
387
|
+
- log
|
|
388
|
+
- audit
|
|
389
|
+
- record
|
|
390
|
+
- timeline
|
|
391
|
+
|
|
392
|
+
related:
|
|
393
|
+
- Table
|
|
394
|
+
- TableToolbar
|
|
395
|
+
- Badge
|
|
396
|
+
- Button
|
|
397
|
+
- EmptyState
|
|
398
|
+
- Pagination
|