@adia-ai/web-modules 0.8.36 → 0.8.38
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 +25 -0
- package/README.md +4 -4
- 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 +2 -2
- 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 +6 -6
- package/chat/chat-sidebar/chat-sidebar.js +2 -2
- package/chat/chat-surfaces/chat-surfaces.js +3 -3
- 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/chat/chat-shell.min.js +1 -1
- package/dist/everything.min.js +121 -102
- 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,128 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
<payment-method-list-ui> — Saved payment methods (cards / bank /
|
|
3
|
+
wallet) rendered as a 1-of-N radiogroup list.
|
|
4
|
+
|
|
5
|
+
Composite over <card-ui> + <icon-ui> + <tag-ui> + <button-ui> +
|
|
6
|
+
<empty-state-ui>. Each row is a <card-ui data-row> with a single
|
|
7
|
+
<header> child carrying the canonical card-ui slot composition:
|
|
8
|
+
slot=icon brand mark
|
|
9
|
+
slot=heading "Visa ···· 4242" + inline <tag-ui> when default
|
|
10
|
+
slot=description "Expires 05/27"
|
|
11
|
+
slot=action set-default / edit / remove buttons
|
|
12
|
+
card-ui's @scope rules own the 3-column grid + slot positioning;
|
|
13
|
+
this file styles only the inter-row stack, default-row chrome,
|
|
14
|
+
hover/focus, empty/disabled states, and the add CTA.
|
|
15
|
+
|
|
16
|
+
SPEC: docs/specs/implementation-ready/SPEC-010-payment-method-list.md
|
|
17
|
+
Two-block @scope pattern per docs/specs/component-token-contract.md.
|
|
18
|
+
Zero raw color values (repo hard rule); zero raw px ≥ 3 (rem only).
|
|
19
|
+
═══════════════════════════════════════════════════════════════ */
|
|
20
|
+
|
|
21
|
+
/* ── Block 1: TOKEN DECLARATIONS ───────────────────────────────── */
|
|
22
|
+
|
|
23
|
+
payment-method-list-ui {
|
|
24
|
+
--payment-method-list-bg: transparent;
|
|
25
|
+
--payment-method-list-gap: var(--a-space-2);
|
|
26
|
+
|
|
27
|
+
--payment-method-list-row-bg: var(--md-sys-color-primary-container);
|
|
28
|
+
--payment-method-list-row-border: 1px solid var(--md-sys-color-primary);
|
|
29
|
+
|
|
30
|
+
--payment-method-list-add-justify: flex-start;
|
|
31
|
+
|
|
32
|
+
--payment-method-list-disabled-opacity: var(--a-opacity-disabled, 0.5);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Block 2: SCOPED LAYOUT ────────────────────────────────────── */
|
|
36
|
+
|
|
37
|
+
@scope (payment-method-list-ui) {
|
|
38
|
+
|
|
39
|
+
:scope {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: var(--a-space-4);
|
|
43
|
+
background: var(--payment-method-list-bg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ── Rows host — column stack of <card-ui> rows ── */
|
|
47
|
+
:scope > [data-rows] {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: var(--payment-method-list-gap);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ── Per-row card — chrome only; card-ui owns layout via <header>. ── */
|
|
54
|
+
:scope > [data-rows] > [data-row] {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
transition:
|
|
57
|
+
background var(--a-duration-fast, 120ms) var(--a-easing, ease),
|
|
58
|
+
box-shadow var(--a-duration-fast, 120ms) var(--a-easing, ease);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:scope > [data-rows] > [data-row]:hover {
|
|
62
|
+
box-shadow: var(--a-shadow-sm);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:scope > [data-rows] > [data-row]:focus-visible {
|
|
66
|
+
outline: var(--a-focus-ring, 2px solid var(--md-sys-color-primary));
|
|
67
|
+
outline-offset: 2px;
|
|
68
|
+
border-color: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Default row — accent border + tinted background, applied via card-ui's
|
|
72
|
+
consumer-extension tokens (--card-bg / --card-border per card-ui.css
|
|
73
|
+
OD-5 token-shadowing pattern). */
|
|
74
|
+
:scope > [data-rows] > [data-row][data-default] {
|
|
75
|
+
--card-bg: var(--payment-method-list-row-bg);
|
|
76
|
+
--card-border: var(--payment-method-list-row-border);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ── Empty-state — gated by [empty] attribute ──
|
|
80
|
+
Hide [data-empty] when host is NOT empty; do NOT set a display
|
|
81
|
+
value when shown (that would clobber empty-state-ui's intrinsic
|
|
82
|
+
flex-column-centered layout from its own @scope). */
|
|
83
|
+
:scope:not([empty]) > [data-empty] {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
:scope[empty] > [data-rows] {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ── Add CTA row ── */
|
|
91
|
+
:scope > [data-add] {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: var(--payment-method-list-add-justify);
|
|
94
|
+
}
|
|
95
|
+
:scope > [data-add][hidden] {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ── Disabled state ── */
|
|
100
|
+
:scope[disabled] {
|
|
101
|
+
opacity: var(--payment-method-list-disabled-opacity);
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* gh#1079 — the host opacity above already reads as disabled; each child
|
|
106
|
+
button ALSO painting its own [disabled] surface stacked pale pill blobs
|
|
107
|
+
onto the dimmed rows ("weird color effects"). Flatten the buttons'
|
|
108
|
+
chrome — the host-level dim is the one disabled treatment. */
|
|
109
|
+
:scope[disabled] button-ui {
|
|
110
|
+
--button-bg: transparent;
|
|
111
|
+
--button-bg-disabled: transparent;
|
|
112
|
+
--button-border: transparent;
|
|
113
|
+
--button-border-disabled: transparent;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* gh#1079 — rows read as table-like entries: icon and actions center
|
|
117
|
+
against the WHOLE two-row card (card-ui's default anchors the icon to
|
|
118
|
+
the heading row and actions to row 1, which reads top-heavy here).
|
|
119
|
+
Consumer-extension via card-ui's own grid, scoped to this list. */
|
|
120
|
+
:scope > [data-rows] > [data-row] > header > [data-pml-icon] {
|
|
121
|
+
grid-row: 1 / span 2;
|
|
122
|
+
align-self: center;
|
|
123
|
+
}
|
|
124
|
+
:scope > [data-rows] > [data-row] > header > [data-pml-action] {
|
|
125
|
+
grid-row: 1 / span 2;
|
|
126
|
+
align-self: center;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<payment-method-list-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 `./payment-method-list.class.js`:
|
|
6
|
+
*
|
|
7
|
+
* import { PaymentMethodList } from '@adia-ai/web-modules/billing/payment-method-list/class';
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { PaymentMethodList } from './payment-method-list.class.js';
|
|
11
|
+
|
|
12
|
+
if (!customElements.get('payment-method-list-ui')) {
|
|
13
|
+
customElements.define('payment-method-list-ui', PaymentMethodList);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { PaymentMethodList };
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
+
name: PaymentMethodList
|
|
4
|
+
tag: payment-method-list-ui
|
|
5
|
+
status: experimental
|
|
6
|
+
component: PaymentMethodList
|
|
7
|
+
category: input
|
|
8
|
+
version: 1
|
|
9
|
+
description: |
|
|
10
|
+
Compound billing primitive that renders the user's saved payment
|
|
11
|
+
methods (cards, bank accounts, wallets) as a vertical list with one
|
|
12
|
+
row designated as the default. Each row shows a brand mark, the
|
|
13
|
+
last-4 / account identifier, an optional expiry, and per-row actions
|
|
14
|
+
(set-default / edit / remove). A trailing "Add payment method" CTA
|
|
15
|
+
emits `add` so consumers can route the consumer flow.
|
|
16
|
+
|
|
17
|
+
Default is a strict 1-of-N radiogroup — exactly one row carries the
|
|
18
|
+
default state when the list is non-empty. The primitive does NOT
|
|
19
|
+
mutate the data source; all changes flow as events (`change`,
|
|
20
|
+
`add`, `remove`, `select`) and the consumer applies the side
|
|
21
|
+
effect against their billing API.
|
|
22
|
+
|
|
23
|
+
Spec: .claude/docs/specs/implementation-ready/SPEC-010-payment-method-list.md.
|
|
24
|
+
|
|
25
|
+
# Per ADR-0027 — composites do NOT auto-import the primitives they
|
|
26
|
+
# stamp in connected()/render(). The consumer (or this primitive's
|
|
27
|
+
# .html demo shell) must explicitly side-effect-import each one.
|
|
28
|
+
composes:
|
|
29
|
+
- card-ui
|
|
30
|
+
- button-ui
|
|
31
|
+
- icon-ui
|
|
32
|
+
- tag-ui
|
|
33
|
+
- text-ui
|
|
34
|
+
- empty-state-ui
|
|
35
|
+
|
|
36
|
+
props:
|
|
37
|
+
methods:
|
|
38
|
+
description: |
|
|
39
|
+
Array of saved payment-method records. Source of truth for the
|
|
40
|
+
rendered rows. Shape per record:
|
|
41
|
+
{id, brand, last4?, expiry?, holder?, type, default?, status?}.
|
|
42
|
+
Empty array renders the empty-state.
|
|
43
|
+
type: array
|
|
44
|
+
default: []
|
|
45
|
+
dynamic: true
|
|
46
|
+
required: false
|
|
47
|
+
|
|
48
|
+
value:
|
|
49
|
+
description: |
|
|
50
|
+
Id of the row currently marked default (the form value). When
|
|
51
|
+
both `value` and `methods[].default` are set, `value` wins and
|
|
52
|
+
the primitive emits `change` to reconcile.
|
|
53
|
+
type: string
|
|
54
|
+
default: ""
|
|
55
|
+
reflect: true
|
|
56
|
+
dynamic: true
|
|
57
|
+
|
|
58
|
+
name:
|
|
59
|
+
description: |
|
|
60
|
+
Form field name for the default-method id. Serialized via
|
|
61
|
+
ElementInternals; mirrors UIFormElement conventions.
|
|
62
|
+
type: string
|
|
63
|
+
default: ""
|
|
64
|
+
reflect: true
|
|
65
|
+
|
|
66
|
+
add-label:
|
|
67
|
+
description: Label for the trailing add CTA.
|
|
68
|
+
type: string
|
|
69
|
+
default: "Add payment method"
|
|
70
|
+
attribute: add-label
|
|
71
|
+
|
|
72
|
+
add-icon:
|
|
73
|
+
description: Phosphor icon name for the add CTA.
|
|
74
|
+
type: string
|
|
75
|
+
default: "plus"
|
|
76
|
+
attribute: add-icon
|
|
77
|
+
|
|
78
|
+
no-add:
|
|
79
|
+
description: |
|
|
80
|
+
Hide the trailing "Add payment method" CTA (read-only flow,
|
|
81
|
+
checkout drawer, etc.).
|
|
82
|
+
type: boolean
|
|
83
|
+
default: false
|
|
84
|
+
reflect: true
|
|
85
|
+
attribute: no-add
|
|
86
|
+
|
|
87
|
+
no-remove:
|
|
88
|
+
description: Hide per-row remove buttons.
|
|
89
|
+
type: boolean
|
|
90
|
+
default: false
|
|
91
|
+
reflect: true
|
|
92
|
+
attribute: no-remove
|
|
93
|
+
|
|
94
|
+
disabled:
|
|
95
|
+
description: Block all interaction; rows remain visible.
|
|
96
|
+
type: boolean
|
|
97
|
+
default: false
|
|
98
|
+
reflect: true
|
|
99
|
+
|
|
100
|
+
events:
|
|
101
|
+
change:
|
|
102
|
+
description: |
|
|
103
|
+
Fired when the default method changes — via row activation or
|
|
104
|
+
programmatic value set. Bubbles.
|
|
105
|
+
detail:
|
|
106
|
+
value:
|
|
107
|
+
type: string
|
|
108
|
+
description: Id of the new default.
|
|
109
|
+
previous:
|
|
110
|
+
type: string
|
|
111
|
+
description: Id of the previous default (empty string when none).
|
|
112
|
+
method:
|
|
113
|
+
type: object
|
|
114
|
+
description: The full method record now marked default.
|
|
115
|
+
|
|
116
|
+
add:
|
|
117
|
+
description: |
|
|
118
|
+
Fired when the user activates the trailing add CTA. Consumer
|
|
119
|
+
routes to its add-method flow (drawer / modal / page). Bubbles.
|
|
120
|
+
|
|
121
|
+
remove:
|
|
122
|
+
description: |
|
|
123
|
+
Fired when the user activates a row's remove affordance. Consumer
|
|
124
|
+
removes the method on its end and writes back via `.remove(id)`
|
|
125
|
+
or by mutating `methods`. Bubbles.
|
|
126
|
+
detail:
|
|
127
|
+
id:
|
|
128
|
+
type: string
|
|
129
|
+
description: Method id targeted for removal.
|
|
130
|
+
method:
|
|
131
|
+
type: object
|
|
132
|
+
description: The full method record.
|
|
133
|
+
|
|
134
|
+
select:
|
|
135
|
+
description: |
|
|
136
|
+
Fired when the user activates a row without changing the default
|
|
137
|
+
(e.g. an "Edit" action). Bubbles.
|
|
138
|
+
detail:
|
|
139
|
+
id:
|
|
140
|
+
type: string
|
|
141
|
+
description: Method id.
|
|
142
|
+
method:
|
|
143
|
+
type: object
|
|
144
|
+
description: The full method record.
|
|
145
|
+
|
|
146
|
+
slots:
|
|
147
|
+
empty:
|
|
148
|
+
description: |
|
|
149
|
+
Custom empty-state shown when `methods` is empty. Falls back to a
|
|
150
|
+
default <empty-state-ui icon="credit-card"> when omitted.
|
|
151
|
+
|
|
152
|
+
add:
|
|
153
|
+
description: |
|
|
154
|
+
Custom add-CTA replacement. When absent the primitive stamps a
|
|
155
|
+
default `<button-ui variant="outline" icon="plus">`. Hidden
|
|
156
|
+
entirely when `[no-add]` is set.
|
|
157
|
+
|
|
158
|
+
states:
|
|
159
|
+
- name: idle
|
|
160
|
+
description: Default — rows rendered, ready for interaction.
|
|
161
|
+
- name: empty
|
|
162
|
+
description: No methods to render.
|
|
163
|
+
attribute: empty
|
|
164
|
+
- name: disabled
|
|
165
|
+
description: All rows non-interactive.
|
|
166
|
+
attribute: disabled
|
|
167
|
+
|
|
168
|
+
traits:
|
|
169
|
+
- focusable
|
|
170
|
+
|
|
171
|
+
tokens:
|
|
172
|
+
--payment-method-list-bg:
|
|
173
|
+
description: Host background. Defaults to transparent.
|
|
174
|
+
default: transparent
|
|
175
|
+
--payment-method-list-gap:
|
|
176
|
+
description: Gap between rows.
|
|
177
|
+
default: var(--a-space-2)
|
|
178
|
+
--payment-method-list-row-bg:
|
|
179
|
+
description: Default row background.
|
|
180
|
+
default: var(--a-bg)
|
|
181
|
+
--payment-method-list-row-bg-hover:
|
|
182
|
+
description: Row hover background.
|
|
183
|
+
default: var(--a-bg-muted)
|
|
184
|
+
--payment-method-list-row-bg-default:
|
|
185
|
+
description: Background tint applied to the default row.
|
|
186
|
+
default: var(--md-sys-color-primary-container)
|
|
187
|
+
--payment-method-list-row-border:
|
|
188
|
+
description: Row border.
|
|
189
|
+
default: 1px solid var(--a-border-subtle)
|
|
190
|
+
--payment-method-list-row-border-default:
|
|
191
|
+
description: Border on the default row.
|
|
192
|
+
default: 1px solid var(--md-sys-color-primary)
|
|
193
|
+
--payment-method-list-row-radius:
|
|
194
|
+
description: Row corner radius.
|
|
195
|
+
default: var(--a-radius-lg)
|
|
196
|
+
--payment-method-list-row-py:
|
|
197
|
+
description: Row vertical padding.
|
|
198
|
+
default: var(--a-space-3)
|
|
199
|
+
--payment-method-list-row-px:
|
|
200
|
+
description: Row horizontal padding.
|
|
201
|
+
default: var(--a-space-4)
|
|
202
|
+
--payment-method-list-row-gap:
|
|
203
|
+
description: Gap between brand mark, meta, and actions cells.
|
|
204
|
+
default: var(--a-space-3)
|
|
205
|
+
--payment-method-list-brand-size:
|
|
206
|
+
description: Brand-mark frame size.
|
|
207
|
+
default: 2.5rem
|
|
208
|
+
--payment-method-list-brand-radius:
|
|
209
|
+
description: Brand-mark frame radius.
|
|
210
|
+
default: var(--a-radius-md)
|
|
211
|
+
--payment-method-list-brand-frame:
|
|
212
|
+
description: Brand-mark frame background.
|
|
213
|
+
default: var(--a-bg-strong)
|
|
214
|
+
--payment-method-list-add-justify:
|
|
215
|
+
description: Justification of the trailing add CTA row.
|
|
216
|
+
default: flex-start
|
|
217
|
+
--payment-method-list-disabled-opacity:
|
|
218
|
+
description: Opacity applied when the host is disabled.
|
|
219
|
+
default: 0.5
|
|
220
|
+
|
|
221
|
+
requiredIcons:
|
|
222
|
+
- plus
|
|
223
|
+
- trash
|
|
224
|
+
- credit-card
|
|
225
|
+
- check-circle
|
|
226
|
+
- bank
|
|
227
|
+
- pencil
|
|
228
|
+
|
|
229
|
+
a2ui:
|
|
230
|
+
rules:
|
|
231
|
+
- >-
|
|
232
|
+
PaymentMethodList.methods MUST be an array. Empty array is valid
|
|
233
|
+
and renders the empty-state.
|
|
234
|
+
- >-
|
|
235
|
+
methods[].id MUST be unique within the list. Duplicate ids cause
|
|
236
|
+
row collision at diff time.
|
|
237
|
+
- >-
|
|
238
|
+
Exactly one record in `methods` MAY have `default: true`. If
|
|
239
|
+
none does, the primitive marks the first row as default on
|
|
240
|
+
connect.
|
|
241
|
+
- >-
|
|
242
|
+
methods[].brand SHOULD be from the enumerated set
|
|
243
|
+
(visa | mastercard | amex | discover | jcb | unionpay | diners |
|
|
244
|
+
paypal | apple-pay | google-pay | ach | sepa). Unknown brands
|
|
245
|
+
fall back to a generic credit-card mark.
|
|
246
|
+
- >-
|
|
247
|
+
methods[].type MUST be `card`, `bank`, or `wallet`. Drives the
|
|
248
|
+
brand-icon fallback when `brand` is unknown.
|
|
249
|
+
- >-
|
|
250
|
+
`value` wins on conflict with methods[].default — if both are
|
|
251
|
+
set and disagree, value is the source of truth and the
|
|
252
|
+
primitive emits `change` to reconcile.
|
|
253
|
+
- >-
|
|
254
|
+
Mutations are events, not props. Wire `change` / `add` /
|
|
255
|
+
`remove` / `select` to your billing API; the primitive does NOT
|
|
256
|
+
write to the underlying data source.
|
|
257
|
+
|
|
258
|
+
anti_patterns:
|
|
259
|
+
- wrong: |
|
|
260
|
+
<payment-method-list-ui methods='[
|
|
261
|
+
{"id":"pm_1","default":true},
|
|
262
|
+
{"id":"pm_2","default":true}
|
|
263
|
+
]'></payment-method-list-ui>
|
|
264
|
+
why: |
|
|
265
|
+
Two rows marked default. The primitive clears all but the first
|
|
266
|
+
and emits a corrective `change` event; this is wasted round-trips.
|
|
267
|
+
Source of truth should mark exactly one row.
|
|
268
|
+
fix: |
|
|
269
|
+
<payment-method-list-ui methods='[
|
|
270
|
+
{"id":"pm_1","default":true},
|
|
271
|
+
{"id":"pm_2"}
|
|
272
|
+
]'></payment-method-list-ui>
|
|
273
|
+
- wrong: |
|
|
274
|
+
A <col-ui> of bespoke <card-ui> rows with manual radio markup
|
|
275
|
+
and a per-row "make default" button.
|
|
276
|
+
why: |
|
|
277
|
+
Reinvents 1-of-N default semantics. Drops radiogroup a11y.
|
|
278
|
+
Re-derives the brand-icon dictionary per consumer.
|
|
279
|
+
fix: |
|
|
280
|
+
<payment-method-list-ui methods="..."></payment-method-list-ui>
|
|
281
|
+
- wrong: |
|
|
282
|
+
<payment-method-list-ui methods='[{"id":"pm_1","brand":"discover-it","type":"card"}]'>
|
|
283
|
+
</payment-method-list-ui>
|
|
284
|
+
why: |
|
|
285
|
+
"discover-it" is a card product, not a brand from the enumerated
|
|
286
|
+
set. The primitive renders the generic credit-card fallback.
|
|
287
|
+
fix: |
|
|
288
|
+
<payment-method-list-ui methods='[{"id":"pm_1","brand":"discover","type":"card"}]'>
|
|
289
|
+
</payment-method-list-ui>
|
|
290
|
+
|
|
291
|
+
examples:
|
|
292
|
+
- name: settings-list
|
|
293
|
+
description: Saved payment methods in a billing settings panel.
|
|
294
|
+
a2ui: |
|
|
295
|
+
[
|
|
296
|
+
{
|
|
297
|
+
"id": "pml-settings",
|
|
298
|
+
"component": "PaymentMethodList",
|
|
299
|
+
"name": "default-method",
|
|
300
|
+
"value": "pm_1",
|
|
301
|
+
"methods": [
|
|
302
|
+
{"id":"pm_1","brand":"visa","last4":"4242","expiry":"2027-05-01","holder":"Ada Lovelace","type":"card","default":true},
|
|
303
|
+
{"id":"pm_2","brand":"mastercard","last4":"0009","expiry":"2026-06-01","holder":"Ada Lovelace","type":"card"},
|
|
304
|
+
{"id":"pm_3","brand":"ach","last4":"6789","holder":"Chase ••6789","type":"bank"}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
- name: checkout-drawer
|
|
309
|
+
description: Checkout-drawer picker — no add CTA; read-only-ish.
|
|
310
|
+
a2ui: |
|
|
311
|
+
[
|
|
312
|
+
{
|
|
313
|
+
"id": "pml-checkout",
|
|
314
|
+
"component": "PaymentMethodList",
|
|
315
|
+
"name": "checkout-method",
|
|
316
|
+
"noAdd": true,
|
|
317
|
+
"methods": [
|
|
318
|
+
{"id":"pm_1","brand":"visa","last4":"4242","expiry":"2027-05-01","type":"card","default":true},
|
|
319
|
+
{"id":"pm_2","brand":"mastercard","last4":"0009","expiry":"2026-06-01","type":"card"}
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
keywords:
|
|
325
|
+
- payment-method
|
|
326
|
+
- payment-methods
|
|
327
|
+
- saved-cards
|
|
328
|
+
- billing
|
|
329
|
+
- cards
|
|
330
|
+
- payment-card
|
|
331
|
+
- credit-card
|
|
332
|
+
- default-card
|
|
333
|
+
- wallet
|
|
334
|
+
- bank-account
|
|
335
|
+
- ach
|
|
336
|
+
- method-list
|
|
337
|
+
|
|
338
|
+
synonyms:
|
|
339
|
+
payment:
|
|
340
|
+
- billing
|
|
341
|
+
- charge
|
|
342
|
+
card:
|
|
343
|
+
- credit-card
|
|
344
|
+
- debit-card
|
|
345
|
+
- payment-method
|
|
346
|
+
saved:
|
|
347
|
+
- stored
|
|
348
|
+
|
|
349
|
+
related:
|
|
350
|
+
- PlanPicker
|
|
351
|
+
- Card
|
|
352
|
+
- Button
|
|
353
|
+
- Tag
|
|
354
|
+
- Icon
|
|
355
|
+
- EmptyState
|