commit 0513c426ee5240e5bf898a7149b3f36dd5633622
parent a0c06b5a89bd61a30f24055681c16e64b11ea225
Author: Sebastian <sebasjm@gmail.com>
Date: Mon, 3 Nov 2025 11:59:05 -0300
fix colors and bind problem
Diffstat:
4 files changed, 244 insertions(+), 8 deletions(-)
diff --git a/packages/challenger-ui/src/pages/AnswerChallenge.tsx b/packages/challenger-ui/src/pages/AnswerChallenge.tsx
@@ -131,7 +131,7 @@ export function AnswerChallenge({
const contact = lastStatus?.last_address;
const sendAgain = safeFunctionHandler(
- lib.challenger.challenge,
+ lib.challenger.challenge.bind(lib.challenger),
contact === undefined ||
lastStatus === undefined ||
lastStatus.pin_transmissions_left === 0 ||
@@ -162,7 +162,7 @@ export function AnswerChallenge({
};
const check = safeFunctionHandler(
- lib.challenger.solve,
+ lib.challenger.solve.bind(lib.challenger),
errors !== undefined ||
lastStatus == undefined ||
lastStatus.auth_attempts_left === 0 ||
diff --git a/packages/challenger-ui/src/pages/AskChallenge.tsx b/packages/challenger-ui/src/pages/AskChallenge.tsx
@@ -162,7 +162,7 @@ export function AskChallenge({
const info = lastStatus.fix_address ? lastStatus.last_address! : contact;
const send = safeFunctionHandler(
- lib.challenger.challenge,
+ lib.challenger.challenge.bind(lib.challenger),
form.status.errors || !info ? undefined : [session.nonce, info],
);
send.onSuccess = (ok) => {
diff --git a/packages/challenger-ui/src/pages/Setup.tsx b/packages/challenger-ui/src/pages/Setup.tsx
@@ -66,7 +66,7 @@ export function Setup({
});
const doStart = safeFunctionHandler(
- (token: AccessToken, url: string) => lib.challenger.setup(clientId, token),
+ (token: AccessToken, url) => lib.challenger.setup(clientId, token),
!!errors || password === undefined || url === undefined
? undefined
: [createRFC8959AccessTokenEncoded(password), url],
@@ -86,7 +86,7 @@ export function Setup({
doStart.onFail = (fail) => {
switch (fail.case) {
case HttpStatusCode.NotFound:
- return i18n.str`Client doesn't exist.`;
+ return i18n.str`The server doesn't know about this client. Either the URL or the secret is wrong.`;
}
};
diff --git a/packages/challenger-ui/tailwind.config.js b/packages/challenger-ui/tailwind.config.js
@@ -25,7 +25,243 @@ export default {
],
},
theme: {
- extend: {},
- },
- plugins: [tw_typo, tw_form],
+ extend: {
+ colors: {
+ // https://docs.taler.net/design-documents/066-wallet-color-scheme.html
+
+ // PRIMARY
+ /**
+ * Main action color (e.g. filled buttons, tabs, icons)
+ */
+ 'primary': '#0042b3',
+ /**
+ * Text/icons placed on top of primary
+ */
+ 'onPrimary': '#ffffff',
+ /**
+ * Background for FABs, cards, filled fields
+ */
+ 'primaryContainer': '#d3deff',
+ /**
+ * Foreground for primaryContainer
+ */
+ 'onPrimaryContainer': '#00134a',
+ /**
+ * primary in dark mode
+ */
+ 'darkPrimary': '#b4c5ff',
+ /**
+ * Text/icons on darkPrimary
+ */
+ 'darkOnPrimary': '#002a78',
+ /**
+ * Container in dark mode
+ */
+ 'darkPrimaryContainer': '#0042b3',
+ /**
+ * Foreground on container in dark
+ */
+ 'darkOnPrimaryContainer': '#e5ebff',
+
+ // SECONDARY
+ /**
+ * Secondary buttons, chips, and passive UI states
+ */
+ 'secondary': '#586a88',
+ /**
+ * Foreground on secondary
+ */
+ 'onSecondary': '#ffffff',
+ /**
+ * Background for secondary surfaces
+ */
+ 'secondaryContainer': '#d9e3f9',
+ /**
+ * Foreground on secondaryContainer
+ */
+ 'onSecondaryContainer': '#111c2b',
+ /**
+ * Secondary color in dark mode
+ */
+ 'darkSecondary': '#a4c9ff',
+ /**
+ * Text/icons on darkPrimary
+ */
+ 'darkOnSecondary': '#00315d',
+ /**
+ * Container in dark mode
+ */
+ 'darkSecondaryContainer': '#72a3e5',
+ /**
+ * Foreground on container in dark
+ */
+ 'darkOnSecondaryContainer': '#003869',
+ },
+
+ // TERTIARY
+ /**
+ * Used for tags, emphasis markers
+ */
+ 'tertiary': '#338af0',
+ /**
+ * Text/icons on tertiary
+ */
+ 'onTertiary': '#ffffff',
+ /**
+ * Input field backgrounds, selected indicators
+ */
+ 'tertiaryContainer': '#d1e4ff',
+ /**
+ * Text/icons on tertiaryContainer
+ */
+ 'onTertiaryContainer': '#001c39',
+ /**
+ * Accent color in dark mode
+ */
+ 'darkTertiary': '#8dd1e5',
+ /**
+ * Foreground in dark
+ */
+ 'darkOnTertiary': '#003641',
+ /**
+ * Container fill in dark
+ */
+ 'darkTertiaryContainer': '#166577',
+ /**
+ * Text/icons on dark container
+ */
+ 'darkOnTertiaryContainer': '#9ce0f5',
+
+ // ERROR
+ /**
+ * Main error color for messages or outlines
+ */
+ 'error': '#b3261e',
+ /**
+ * Text/icons on error surfaces
+ */
+ 'onError': '#ffffff',
+ /**
+ *
+ */
+ 'errorContainer': '#f9dedc',
+ /**
+ *
+ */
+ 'onErrorContainer': '#410e0b',
+ /**
+ *
+ */
+ 'darkError': '#ffb4aa',
+ /**
+ *
+ */
+ 'darkOnError': '#690003',
+ /**
+ *
+ */
+ 'darkErrorContainer': '#b3261e',
+ /**
+ *
+ */
+ 'darkOnErrorContainer': '#ffcbc4',
+
+ // SUCCESS
+ /**
+ *
+ */
+ 'success': '#337a40',
+ /**
+ *
+ */
+ 'onSuccess': '#ffffff',
+ /**
+ *
+ */
+ 'successContainer': '#2e8534',
+ /**
+ *
+ */
+ 'onSuccessContainer': '#f7fff1',
+ /**
+ *
+ */
+ 'darkSuccess': '#337a40',
+ /**
+ *
+ */
+ 'darkOnSuccess': '#ffffff',
+ /**
+ *
+ */
+ 'darkSuccessContainer': '#1d3522',
+ /**
+ *
+ */
+ 'darkOnSuccessContainer': '#eaf6ec',
+
+ // WARNING
+ /**
+ * Alert banners, passive warnings
+ */
+ 'warning': '#f99c06',
+ /**
+ *
+ */
+ 'onWarning': '#000000',
+ /**
+ *
+ */
+ 'warningContainer': '#fdedd3',
+ /**
+ *
+ */
+ 'onWarningContainer': '#6b4706',
+ /**
+ *
+ */
+ 'darkWarning': '#f99c06',
+ /**
+ *
+ */
+ 'darkOnWarning': '#000000',
+ /**
+ *
+ */
+ 'darkWarningContainer': '#664200',
+ /**
+ *
+ */
+ 'darkOnWarningContainer': '#fdedd3',
+
+ // BACKGROUND
+ /**
+ * App-wide background color
+ */
+ 'background': '#fdfdff',
+ /**
+ *
+ */
+ 'onBackground': '#1a1c1f',
+ /**
+ * Background in dark mode
+ */
+ 'darkBackground': '#11131a',
+ /**
+ *
+ */
+ 'darkOnBackground': '#e2e2eb',
+
+ // OUTLINE
+ /**
+ * Used for input borders, field outlines
+ */
+ 'outline': '#767880',
+ /**
+ * Decorative borders, dividers
+ */
+ 'outlineVariant': '#c4c6d0',
+
+ },
+ }, plugins: [tw_typo, tw_form],
};