@@ -81,7 +85,12 @@ export class CurrencySwitcher extends withTwind()(BitcoinConnectElement) {
class="${selectedCurrency === currency.value
? 'bg-blue-500 text-white'
: ''} flex items-center justify-center py-2 px-4 hover:text-white hover:bg-blue-500 rounded-lg hover:border-blue-500 cursor-pointer"
+ role="option"
+ aria-selected="${selectedCurrency === currency.value}"
+ tabindex="0"
@click=${() => this._selectCurrency(currency.value)}
+ @keydown=${(event: KeyboardEvent) =>
+ this._handleCurrencyKeydown(event, currency.value)}
>
${currency.flag}
store.getState().pushRoute('/help')}
+ @keydown=${this._handleKeydownHelp}
>
${helpIcon}
`
@@ -39,7 +45,11 @@ export class ModalHeader extends withTwind()(BitcoinConnectElement) {
${this.closable
? html`
${crossIcon}
`
@@ -54,6 +64,22 @@ export class ModalHeader extends withTwind()(BitcoinConnectElement) {
private _handleClose() {
this.dispatchEvent(new Event('onclose', {bubbles: true, composed: true}));
}
+
+ // Handle keyboard interactions for the close button
+ private _handleKeydownClose(event: KeyboardEvent) {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ this._handleClose();
+ }
+ }
+
+ // Handle keyboard interactions for the help button
+ private _handleKeydownHelp(event: KeyboardEvent) {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ store.getState().pushRoute('/help');
+ }
+ }
}
declare global {
diff --git a/src/components/bc-modal.ts b/src/components/bc-modal.ts
index 2b08287..64c9b61 100644
--- a/src/components/bc-modal.ts
+++ b/src/components/bc-modal.ts
@@ -11,18 +11,26 @@ import {closeModal} from '../api';
@customElement('bc-modal')
export class Modal extends withTwind()(BitcoinConnectElement) {
override render() {
- return html`
@@ -32,6 +40,12 @@ export class Modal extends withTwind()(BitcoinConnectElement) {
private _handleClose = () => {
closeModal();
};
+
+ public _handleKeydown = (event: KeyboardEvent) => {
+ if (event.key === 'Escape') {
+ this._handleClose();
+ }
+ };
}
declare global {
diff --git a/src/components/bc-navbar.ts b/src/components/bc-navbar.ts
index c42c3a5..2900ef1 100644
--- a/src/components/bc-navbar.ts
+++ b/src/components/bc-navbar.ts
@@ -12,27 +12,44 @@ export class Navbar extends withTwind()(BitcoinConnectElement) {
heading?: string;
override render() {
- return html`
-
`;
+ `;
}
private _goBack = () => {
store.getState().popRoute();
store.getState().setError(undefined);
};
+
+ public _handleKeydown(event: KeyboardEvent) {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ this._goBack();
+ }
+ }
}
declare global {
diff --git a/src/components/bc-pay-button.ts b/src/components/bc-pay-button.ts
index b6f4e49..726fcc7 100644
--- a/src/components/bc-pay-button.ts
+++ b/src/components/bc-pay-button.ts
@@ -64,7 +64,16 @@ export class PayButton extends withTwind()(BitcoinConnectElement) {
override render() {
const isLoading = this._waitingForInvoice || this._modalOpen;
- return html`
+ return html`
${isLoading
? html`${waitingIcon(`w-11 h-11 -mr-2 -ml-2.5 `)}`
diff --git a/src/components/bc-router-outlet.ts b/src/components/bc-router-outlet.ts
index 1d53d0d..00e03e1 100644
--- a/src/components/bc-router-outlet.ts
+++ b/src/components/bc-router-outlet.ts
@@ -8,7 +8,9 @@ import {routes} from './routes';
export class RouterOutlet extends withTwind()(BitcoinConnectElement) {
override render() {
//TODO: r = routes[this._route](this._routeParams);
- return html`${routes[this._route]}
`;
+ return html`
+ ${routes[this._route]}
+
`;
}
}
diff --git a/src/components/bc-start.ts b/src/components/bc-start.ts
index 4a0e6f0..81767aa 100644
--- a/src/components/bc-start.ts
+++ b/src/components/bc-start.ts
@@ -33,6 +33,11 @@ export class Start extends withTwind()(BitcoinConnectElement) {
override render() {
return html`
${this._connected
? html`
@@ -46,7 +51,7 @@ export class Start extends withTwind()(BitcoinConnectElement) {
`
- : html`
How would you like to
connect${this._appName ? `\nto ${this._appName}` : ''}?
-
-
-
+
+
+
diff --git a/src/components/connectors/ConnectorElement.ts b/src/components/connectors/ConnectorElement.ts
index 5ea0830..453087f 100644
--- a/src/components/connectors/ConnectorElement.ts
+++ b/src/components/connectors/ConnectorElement.ts
@@ -30,7 +30,13 @@ export abstract class ConnectorElement extends withTwind()(
override render() {
return html`
`;
}
+ // Handle keyboard events for accessibility (Enter/Space key triggers click)
+ public _handleKeydown(event: KeyboardEvent) {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ this._onClick();
+ }
+ }
+
protected _connect(
config: Omit
) {
diff --git a/src/components/flows/bc-connect.ts b/src/components/flows/bc-connect.ts
index 56ca538..5947a85 100644
--- a/src/components/flows/bc-connect.ts
+++ b/src/components/flows/bc-connect.ts
@@ -29,8 +29,19 @@ export class ConnectFlow extends withTwind()(BitcoinConnectElement) {
closable?: boolean;
override render() {
- return html`
-
+ return html`
+
diff --git a/src/components/pages/bc-lnfi.ts b/src/components/pages/bc-lnfi.ts
index 6928c66..20ef6e2 100644
--- a/src/components/pages/bc-lnfi.ts
+++ b/src/components/pages/bc-lnfi.ts
@@ -44,7 +44,10 @@ export class LnfiNWCPage extends withTwind()(BitcoinConnectElement) {
'border-neutral-secondary'
]}"
/>
-
+
Connect
diff --git a/src/components/pages/bc-send-payment.ts b/src/components/pages/bc-send-payment.ts
index e69d479..f50e887 100644
--- a/src/components/pages/bc-send-payment.ts
+++ b/src/components/pages/bc-send-payment.ts
@@ -63,15 +63,21 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
private renderHeading(decodedInvoice: Invoice) {
return html`
-
+
${decodedInvoice.satoshi.toLocaleString(undefined, {
+ >
+ ${decodedInvoice.satoshi.toLocaleString(undefined, {
useGrouping: true,
- })} sats
+ })}
+
+ sats
`;
}
@@ -82,6 +88,8 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
class="flex flex-col justify-center items-center ${classes[
'text-brand-mixed'
]}"
+ role="alert"
+ aria-live="assertive"
>
Paid!
${successAnimation}
@@ -91,7 +99,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
private renderPayingState() {
return html`
-
+
Paying...
${waitingIcon(`w-48 h-48 ${classes['text-brand-mixed']}`)}
@@ -100,7 +112,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
private renderPaymentConfirmation() {
return html`
-
+
${bcIcon}
Confirm Payment
@@ -110,7 +126,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
private renderWaitingForPayment() {
return html`
-
+
${waitingIcon(`w-7 h-7 ${classes['text-brand-mixed']}`)}
Waiting for payment
@@ -124,7 +144,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
if (this.paymentMethods === 'all' || this.paymentMethods === 'internal') {
internalMethods = html`
-
+
${bcIcon}Connect Wallet
`;
@@ -132,7 +156,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
if (this.paymentMethods === 'all' || this.paymentMethods === 'external') {
externalMethods = html`
-
+
${qrIcon} Copy & Display Invoice
`;
@@ -145,8 +173,11 @@ export class SendPayment extends withTwind()(BitcoinConnectElement) {
return html`