@block-auth.io/angular 0.3.1 → 0.4.0

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 (35) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/.turbo/turbo-lint.log +4 -4
  3. package/.turbo/turbo-test.log +1400 -94
  4. package/.turbo/turbo-typecheck.log +19 -19
  5. package/CHANGELOG.md +46 -0
  6. package/package.json +3 -3
  7. package/src/lib/components/btns/btn-base-provider.component.test.ts +14 -0
  8. package/src/lib/components/btns/btn-base-provider.component.ts +7 -1
  9. package/src/lib/components/btns/btn-block-auth.component.test.ts +27 -1
  10. package/src/lib/components/btns/btn-block-auth.component.ts +6 -2
  11. package/src/lib/components/contents/content-signup.component.test.ts +8 -0
  12. package/src/lib/components/contents/content-signup.component.ts +15 -18
  13. package/src/lib/components/dds/dropdown-profile-btn.component.ts +5 -3
  14. package/src/lib/components/flow-block-auth.component.test.ts +2 -0
  15. package/src/lib/components/flow-block-auth.component.ts +10 -8
  16. package/src/lib/components/modals/modal-signin.component.ts +2 -2
  17. package/src/lib/components/modals/modal-signup.component.ts +1 -1
  18. package/src/lib/components/sections/internals/providers-buttons.component.ts +1 -11
  19. package/src/lib/components/sections/login-section.component.ts +4 -5
  20. package/src/lib/components/txns/internals/permissions-required-modal.component.ts +1 -1
  21. package/src/lib/components/txns/internals/solicited-data-modal.component.test.ts +39 -0
  22. package/src/lib/components/txns/internals/solicited-data-modal.component.ts +25 -10
  23. package/src/lib/components/txns/internals/txn.component.test.ts +13 -0
  24. package/src/lib/components/txns/internals/txn.component.ts +15 -23
  25. package/src/lib/components/txns/txns-overview.component.ts +49 -12
  26. package/src/lib/primitives/horizontal-loader.component.test.ts +3 -2
  27. package/src/lib/primitives/horizontal-loader.component.ts +15 -39
  28. package/src/lib/primitives/img-loader.component.test.ts +10 -0
  29. package/src/lib/primitives/img-loader.component.ts +5 -2
  30. package/src/lib/primitives/oval-spinner.component.test.ts +10 -2
  31. package/src/lib/primitives/oval-spinner.component.ts +35 -57
  32. package/src/lib/primitives/progressbar.component.test.ts +27 -11
  33. package/src/lib/primitives/progressbar.component.ts +24 -81
  34. package/src/lib/primitives/providersStyles.ts +0 -50
  35. package/src/lib/transitions.css +0 -4
@@ -1,19 +1,19 @@
1
-
2
- > @block-auth.io/angular@0.3.0 pretypecheck /home/wenqi/Documents/blockauthio/blockauth-sdk/packages/angular
3
- > pnpm build:css
4
-
5
-
6
- > @block-auth.io/angular@0.3.0 build:css /home/wenqi/Documents/blockauthio/blockauth-sdk/packages/angular
7
- > tailwindcss -i ../ui-styles/src/input.css -c ./tailwind.config.cjs -o ./src/styles.generated.css --minify && node scripts/css-to-ts.mjs
8
-
9
- Browserslist: caniuse-lite is outdated. Please run:
10
- npx update-browserslist-db@latest
11
- Why you should do it regularly: https://github.com/browserslist/update-db#readme
12
-
13
- Rebuilding...
14
-
15
- Done in 3222ms.
16
-
17
- > @block-auth.io/angular@0.3.0 typecheck /home/wenqi/Documents/blockauthio/blockauth-sdk/packages/angular
18
- > tsc -p tsconfig.lib.json --noEmit
19
-
1
+
2
+ > @block-auth.io/angular@0.4.0 pretypecheck /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
3
+ > pnpm build:css
4
+
5
+
6
+ > @block-auth.io/angular@0.4.0 build:css /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
7
+ > tailwindcss -i ../ui-styles/src/input.css -c ./tailwind.config.cjs -o ./src/styles.generated.css --minify && node scripts/css-to-ts.mjs
8
+
9
+ Browserslist: caniuse-lite is outdated. Please run:
10
+ npx update-browserslist-db@latest
11
+ Why you should do it regularly: https://github.com/browserslist/update-db#readme
12
+
13
+ Rebuilding...
14
+
15
+ Done in 1767ms.
16
+
17
+ > @block-auth.io/angular@0.4.0 typecheck /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
18
+ > tsc -p tsconfig.lib.json --noEmit
19
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @block-auth.io/angular
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 409f7c3: Las tarjetas de inicio de sesión, registro y consentimiento pasan al diseño
8
+ glass, igual que en React, y `OvalSpinner` y `HorizontalLoader` usan el loader
9
+ glass. `ImgLoader` acepta `showLoaderRing` para ocultar el anillo, y el
10
+ proveedor elegido se expone con `aria-pressed`. Los datos solicitados no se
11
+ pueden aceptar mientras falte alguno obligatorio, y "Cancelar" descarta los
12
+ cambios. Requiere `@block-auth.io/core` 0.12, que ya no tiene `apiUrl` por
13
+ defecto: las apps first-party tienen que pasarlo.
14
+
15
+ ### Patch Changes
16
+
17
+ - baf72f4: La barra de pasos de la tarjeta de registro pinta siempre el paso actual: ya no
18
+ deja círculos a medio dibujar, tramos sin rellenar ni dos subrayados a la vez al
19
+ saltar o volver de paso. Mismo diseño en React, Vue y Angular, con la línea
20
+ redondeada, un halo suave en el paso activo y transiciones CSS.
21
+ - Updated dependencies [409f7c3]
22
+ - Updated dependencies [acefee6]
23
+ - Updated dependencies [4f8e9ce]
24
+ - Updated dependencies [1b33e98]
25
+ - Updated dependencies [4413898]
26
+ - Updated dependencies [baf72f4]
27
+ - Updated dependencies [409f7c3]
28
+ - @block-auth.io/core@0.12.0
29
+ - @block-auth.io/ui-styles@0.6.0
30
+
31
+ ## 0.3.2
32
+
33
+ ### Patch Changes
34
+
35
+ - 1daf2df: Con la extensión conectada pero su sesión pendiente del OTP, la tarjeta de
36
+ registro ya no muestra el perfil sin `did` y el botón "Log In". La página solo
37
+ recibe el `did` cuando la extensión le pasa su sesión, y con el token caducado
38
+ eso no ocurre hasta que el usuario mete el OTP en la extensión. Ahora
39
+ `ContentSignup` (react, vue y angular) trata esa cuenta como todavía no
40
+ conectada y muestra el botón de Block-Auth ("Desbloquear OTP" cuando la
41
+ extensión avisa de que está bloqueada), que abre la extensión. `BtnBlockAuth`
42
+ también abre la extensión en vez de reconectar cuando el servicio `blockauth`
43
+ ya está conectado sin `did`, porque reconectar no devuelve la sesión.
44
+ `@block-auth.io/core` exporta el helper
45
+ `needsExtensionUnlock(serviceName, did, isLocked)` que decide este caso.
46
+ - Updated dependencies [1daf2df]
47
+ - @block-auth.io/core@0.11.1
48
+
3
49
  ## 0.3.1
4
50
 
5
51
  ### Patch Changes
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@block-auth.io/angular",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "dependencies": {
5
5
  "nanostores": "^0.10.0",
6
6
  "tslib": "^2.6.0",
7
- "@block-auth.io/core": "0.11.0",
8
- "@block-auth.io/ui-styles": "0.5.0"
7
+ "@block-auth.io/core": "0.12.0",
8
+ "@block-auth.io/ui-styles": "0.6.0"
9
9
  },
10
10
  "peerDependencies": {
11
11
  "@angular/core": ">=20.0.0",
@@ -20,3 +20,17 @@ describe('BtnBaseProvider', () => {
20
20
  expect(onProviderClicked).toHaveBeenCalled();
21
21
  });
22
22
  });
23
+
24
+ describe('BtnBaseProviderComponent estado seleccionado', () => {
25
+ it('expone la selección con aria-pressed', async () => {
26
+ await render(BtnBaseProviderComponent, {
27
+ componentInputs: { text: 'google', isSelected: true },
28
+ });
29
+ expect(screen.getByRole('button').getAttribute('aria-pressed')).toBe('true');
30
+ });
31
+
32
+ it('no está seleccionado por defecto', async () => {
33
+ await render(BtnBaseProviderComponent, { componentInputs: { text: 'google' } });
34
+ expect(screen.getByRole('button').getAttribute('aria-pressed')).toBe('false');
35
+ });
36
+ });
@@ -9,7 +9,12 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
9
9
  standalone: true,
10
10
  changeDetection: ChangeDetectionStrategy.OnPush,
11
11
  template: `
12
- <button [class]="btnClass()" (click)="onClick($event)">
12
+ <button
13
+ type="button"
14
+ [attr.aria-pressed]="isSelected()"
15
+ [class]="btnClass()"
16
+ (click)="onClick($event)"
17
+ >
13
18
  <ng-content select="[slot=icon]" />
14
19
  @if (text() && text() !== '') {
15
20
  <p [class]="'bas-m-0 bas-text-gray-700 ' + textClass()">{{ capitalizedText() }}</p>
@@ -22,6 +27,7 @@ export class BtnBaseProviderComponent {
22
27
  sizeClassNames = input('bas-h-16 bas-w-full');
23
28
  text = input('');
24
29
  isEditable = input(false);
30
+ isSelected = input(false);
25
31
  device = input<'desktop' | 'phone'>('desktop');
26
32
 
27
33
  providerClicked = output<void>();
@@ -13,7 +13,12 @@ import { provideBlockAuthClientForTest } from '../../testing';
13
13
 
14
14
  function makeClient() {
15
15
  const connectBlockAuth = vi.fn();
16
- const $ui = map({ isSdkSignedIn: false, uiConfig: null });
16
+ const $ui = map({
17
+ isSdkSignedIn: false,
18
+ uiConfig: null,
19
+ isServiceConnected: false,
20
+ serviceName: null as string | null,
21
+ });
17
22
  const $ws = map({ ready: false });
18
23
  const client = { connectBlockAuth, state: { $ui, $ws } } as any;
19
24
  return { client, connectBlockAuth, $ui, $ws };
@@ -76,4 +81,25 @@ describe('BtnBlockAuth', () => {
76
81
  await fireEvent.click(screen.getByRole('button'));
77
82
  expect(connectBlockAuth).toHaveBeenCalledOnce();
78
83
  });
84
+
85
+ it('despacha ext:open en vez de reconectar cuando está conectada sin did', async () => {
86
+ const c = makeClient();
87
+ const { client, connectBlockAuth } = c;
88
+ ready(c);
89
+ c.$ui.setKey('isServiceConnected', true);
90
+ c.$ui.setKey('serviceName', 'blockauth');
91
+ const dispatchSpy = vi.spyOn(document, 'dispatchEvent');
92
+ await render(BtnBlockAuthComponent, { providers: [provideBlockAuthClientForTest(client)] });
93
+ setExtensionInstalled(true);
94
+ setExtensionIsUser(true);
95
+ setExtensionIsUserActive(true);
96
+ setExtensionIsLocked(false);
97
+ await fireEvent.click(screen.getByRole('button'));
98
+ const dispatchedExtOpen = dispatchSpy.mock.calls.some(
99
+ (c) => (c[0] as Event).type === 'ext:open',
100
+ );
101
+ expect(dispatchedExtOpen).toBe(true);
102
+ expect(connectBlockAuth).not.toHaveBeenCalled();
103
+ dispatchSpy.mockRestore();
104
+ });
79
105
  });
@@ -14,7 +14,8 @@ import { injectStore } from '../../inject-store';
14
14
  * que no está envuelto por `BlockAuthService`, se lee aquí con `injectStore`).
15
15
  * Según el estado (installed/isUser/isUserActive/isLocked):
16
16
  * - no instalada → abre la Chrome Web Store,
17
- * - no user / no activo / bloqueada → despacha el evento DOM `ext:open`,
17
+ * - no user / no activo / bloqueada, o conectada sin sesión (OTP pendiente
18
+ * en la extensión) → despacha el evento DOM `ext:open`,
18
19
  * - conectable → `client.connectBlockAuth()`.
19
20
  * El label sale del mapa localizado `uiConfig.config.content.btns`.
20
21
  */
@@ -102,7 +103,10 @@ export class BtnBlockAuthComponent {
102
103
  window.open(getExtensionStoreUrl(), '_blank');
103
104
  return;
104
105
  }
105
- if (!ext.isUser || !ext.isUserActive || ext.isLocked) {
106
+ // Connected but without a did: only the OTP in the extension brings the session back.
107
+ const ui = this.ui();
108
+ const isPendingOtp = ui.isServiceConnected && ui.serviceName === 'blockauth' && !this.ws().did;
109
+ if (!ext.isUser || !ext.isUserActive || ext.isLocked || isPendingOtp) {
106
110
  if (typeof document !== 'undefined') {
107
111
  document.dispatchEvent(new CustomEvent('ext:open', { detail: {} }));
108
112
  }
@@ -75,4 +75,12 @@ describe('ContentSignup', () => {
75
75
  expect(screen.queryByAltText('MetaMask')).toBeNull();
76
76
  expect(screen.queryByAltText('Phantom')).toBeNull();
77
77
  });
78
+
79
+ it('con blockauth conectada pero sin did muestra el botón del proveedor, no el perfil', async () => {
80
+ // La sesión de la extensión espera su OTP: todavía no ha llegado el did.
81
+ const client = makeClient({ isServiceConnected: true, serviceName: 'blockauth' });
82
+ await render(ContentSignupComponent, { providers: [provideBlockAuthClientForTest(client)] });
83
+ expect(document.getElementById('btn-provider-blockauth')).not.toBeNull();
84
+ expect(screen.queryByTestId('dropdown-profile')).toBeNull();
85
+ });
78
86
  });
@@ -8,9 +8,11 @@ import {
8
8
  untracked,
9
9
  } from '@angular/core';
10
10
  import {
11
+ $extension,
11
12
  $locale,
12
13
  deepLinkFor,
13
14
  makeQrDataUrl,
15
+ needsExtensionUnlock,
14
16
  t as translate,
15
17
  type TextKey,
16
18
  } from '@block-auth.io/core';
@@ -54,7 +56,7 @@ function applyFilters(providers: string[], { webType, search }: { webType: strin
54
56
  data-testid="content-signup"
55
57
  [attr.data-device]="device()"
56
58
  [class]="
57
- 'bas-grid bas-h-full ' +
59
+ 'bal-ba-glass-signup bas-grid bas-h-full ' +
58
60
  (!isEditable()
59
61
  ? 'bas-w-full bas-grid-cols-1 bas-grid-rows-[52px_140px_228px_48px] sm1:bas-w-fit sm1:bas-grid-cols-[240px_384px] sm1:bas-grid-rows-[52px_auto_auto] lg:bas-grid-cols-[240px_640px]'
60
62
  : 'bas-w-fit')
@@ -78,13 +80,9 @@ function applyFilters(providers: string[], { webType, search }: { webType: strin
78
80
  'bas-flex bas-items-center bas-justify-center ' + (!isEditable() ? 'bas-row-start-1 sm1:bas-row-start-auto' : '')
79
81
  "
80
82
  >
81
- <ba-progressbar
82
- [step1]="false"
83
- [fillStep1]="true"
84
- [step2]="!hasBeenConnected() && showImgLoader()"
85
- [step3]="!showImgLoader()"
86
- [goBackToStep2]="(serviceName() !== selectedService() || !isServiceConnected()) && hasBeenConnected()"
87
- />
83
+ <span class="bal-ba-glass-stepper">
84
+ <ba-progressbar [step]="showImgLoader() ? 2 : 3" />
85
+ </span>
88
86
  </section>
89
87
 
90
88
  <ba-login-section
@@ -117,6 +115,8 @@ export class ContentSignupComponent {
117
115
 
118
116
  private readonly client = injectBlockAuthClient();
119
117
  private readonly ui = injectStore(this.client.state.$ui);
118
+ private readonly ws = injectStore(this.client.state.$ws);
119
+ private readonly ext = injectStore($extension);
120
120
  private readonly locale = injectStore($locale);
121
121
  private readonly t = (key: TextKey): string => translate(key, this.locale());
122
122
 
@@ -130,7 +130,12 @@ export class ContentSignupComponent {
130
130
  protected footerHref = computed(() => this.content()?.footer?.url ?? 'https://block-auth.io');
131
131
 
132
132
  protected serviceName = computed(() => (this.ui() as Record<string, any>)?.serviceName);
133
- protected isServiceConnected = computed(() => !!(this.ui() as Record<string, any>)?.isServiceConnected);
133
+ // An extension account still waiting for its OTP is not connected yet.
134
+ protected isServiceConnected = computed(
135
+ () =>
136
+ !!(this.ui() as Record<string, any>)?.isServiceConnected &&
137
+ !needsExtensionUnlock(this.serviceName(), this.ws().did, this.ext().isLocked),
138
+ );
134
139
  private readonly domain = computed(
135
140
  () => (this.ui() as Record<string, any>)?.uiConfig?.domain as string | undefined,
136
141
  );
@@ -168,7 +173,6 @@ export class ContentSignupComponent {
168
173
 
169
174
  protected selectedService = signal<string>(this.allProviders()[0] ?? 'blockauth');
170
175
  protected showedProviders = signal<string[]>(this.allProviders());
171
- protected hasBeenConnected = signal(false);
172
176
  protected imgQR = signal<string | null>(null);
173
177
  // Estado de filtros no reactivo: mutarlo no dispara reactividad.
174
178
  private filterState: { webType: string; search: string } = { webType: 'all', search: '' };
@@ -186,14 +190,7 @@ export class ContentSignupComponent {
186
190
  this.selectedService.set(providers.includes(cur) ? cur : providers[0] ?? 'blockauth');
187
191
  });
188
192
 
189
- // Efecto 2: marca hasBeenConnected cuando el servicio seleccionado conecta.
190
- effect(() => {
191
- if (this.serviceName() === this.selectedService() && this.isServiceConnected()) {
192
- this.hasBeenConnected.set(true);
193
- }
194
- });
195
-
196
- // Efecto 3: genera el QR para providers web3 (metamask/phantom), con guard
193
+ // Efecto 2: genera el QR para providers web3 (metamask/phantom), con guard
197
194
  // de cancelación.
198
195
  effect((onCleanup) => {
199
196
  const svc = this.selectedService();
@@ -22,18 +22,20 @@ import { TbCopyComponent, TbCopyCheckFilledComponent } from '../../icons';
22
22
  data-testid="dropdown-profile-btn"
23
23
  [attr.data-service]="serviceNameResolved()"
24
24
  [class]="
25
- 'bal-ba-transition-2 bas-group bas-relative bas-box-border bas-grid bas-h-full bas-w-full bas-cursor-pointer bas-flex-row bas-items-center bas-justify-between bas-gap-1 bas-overflow-hidden bas-rounded-lg bas-mx-auto ' +
25
+ 'bal-ba-glass-profile bal-ba-transition-2 bas-group bas-relative bas-box-border bas-grid bas-h-full bas-w-full bas-cursor-pointer bas-flex-row bas-items-center bas-justify-between bas-gap-1 bas-overflow-hidden bas-rounded-lg bas-mx-auto ' +
26
26
  dropdownBtnBgClassNames() + ' bas-border-2 bas-border-solid ' +
27
27
  gridClassNames() + ' ' +
28
- (dropdownBtnBorderClassNames() || style().borderStyles + ' ' + style().hoverBorderStyles)
28
+ (dropdownBtnBorderClassNames() || 'bal-ba-glass-profile-rim')
29
29
  "
30
+ [style.--bal-ba-provider]="style().colorBase"
30
31
  [style.minHeight]="height() != null ? height() + 'px' : null"
31
32
  [style.width]="widthStyle()"
32
33
  (click)="clicked.emit()"
33
34
  >
34
35
  <span
36
+ [attr.data-status]="!isSignedFirstCheck() ? 'pending' : !isSigned() ? 'unsigned' : 'signed'"
35
37
  [class]="
36
- 'bas-absolute bas-right-2.5 bas-top-1.5 bas-h-2 bas-w-2 bas-rounded-full ' +
38
+ 'bal-ba-glass-status-dot bas-absolute bas-right-2.5 bas-top-1.5 bas-h-2 bas-w-2 bas-rounded-full ' +
37
39
  (!isSignedFirstCheck() ? 'bas-bg-gray-400' : !isSigned() ? 'bas-bg-red-400' : 'bas-bg-green-400')
38
40
  "
39
41
  ></span>
@@ -85,6 +85,8 @@ describe('FlowBlockAuth', () => {
85
85
  const btn = container.querySelector('#btn-flow-blockauth') as HTMLButtonElement;
86
86
  expect(btn).toBeTruthy();
87
87
  expect(btn.disabled).toBe(false);
88
+ expect(btn.className).toContain('bal-ba-glass-status-btn');
89
+ expect(btn.className).toContain('bal-ba-glass-tone-ready');
88
90
  await fireEvent.click(btn);
89
91
 
90
92
  await waitFor(() => expect(client.requestSignin).toHaveBeenCalled());
@@ -159,14 +159,16 @@ export class FlowBlockAuthComponent {
159
159
 
160
160
  // Azul mientras arranca, transparente una vez firmado en el SDK, naranja en
161
161
  // on-deletion, rojo si la api key es inválida.
162
- protected readonly bgClassNames = computed(() =>
163
- !(this.ws().ready && this.isUiConfig())
164
- ? 'bas-bg-[rgba(0,78,152,0.8)] hover:bas-bg-[rgba(0,62,121,0.8)]'
165
- : this.ui().isSdkSignedIn
166
- ? undefined
167
- : this.ui().isOnDeletion
168
- ? 'bas-bg-orange-500 hover:bas-bg-orange-600'
169
- : 'bas-bg-red-500 hover:bas-bg-red-600',
162
+ protected readonly bgClassNames = computed(
163
+ () =>
164
+ 'bal-ba-glass-status-btn ' +
165
+ (!(this.ws().ready && this.isUiConfig())
166
+ ? 'bal-ba-glass-tone-boot'
167
+ : this.ui().isSdkSignedIn
168
+ ? 'bal-ba-glass-tone-ready'
169
+ : this.ui().isOnDeletion
170
+ ? 'bal-ba-glass-tone-deletion'
171
+ : 'bal-ba-glass-tone-error'),
170
172
  );
171
173
 
172
174
  protected readonly isLoading = computed(
@@ -22,11 +22,11 @@ import { BlockAuthService } from '../../block-auth.service';
22
22
  <ba-modal-overlay
23
23
  testId="modal-signin"
24
24
  [open]="open()"
25
- panelClassName="xmd:bas-top-24 bas-w-full xsm1:bas-w-[380px] bas-overflow-hidden bas-bg-white bas-text-left bal-ba-shadow-base bal-ba-shadow-xl bas-h-[600px] bas-rounded-tl-lg bas-rounded-tr-lg xmd:bas-rounded-br-lg xmd:bas-rounded-bl-lg"
25
+ panelClassName="bal-ba-glass-card xmd:bas-top-24 bas-w-full xsm1:bas-w-[380px] bas-text-left bas-h-[600px] bas-rounded-tl-[18px] bas-rounded-tr-[18px] xmd:bas-rounded-br-[18px] xmd:bas-rounded-bl-[18px]"
26
26
  (closed)="handleClose()"
27
27
  >
28
28
  <div class="bas-flex bas-h-full bas-w-full bas-items-center bas-justify-center">
29
- <div class="bas-relative bas-h-full bas-w-fit">
29
+ <div class="bas-relative bas-h-full bas-w-full">
30
30
  <ba-content-signin [closeTxns]="handleClose" />
31
31
  </div>
32
32
  </div>
@@ -21,7 +21,7 @@ import { BlockAuthService } from '../../block-auth.service';
21
21
  <ba-modal-overlay
22
22
  testId="modal-signup"
23
23
  [open]="open()"
24
- panelClassName="xmd:bas-top-24 xmd:bas-m-1 bas-min-w-fit bas-overflow-hidden bas-bg-white bas-text-left bal-ba-shadow-base bal-ba-shadow-xl xmd:bas-my-8 sm1:bas-h-[364px] bas-w-full xmd:bas-w-fit lg:bas-h-[376px] bas-h-[508px] bas-rounded-tl-lg bas-rounded-tr-lg xmd:bas-rounded-br-lg xmd:bas-rounded-bl-lg"
24
+ panelClassName="bal-ba-glass-card xmd:bas-top-24 xmd:bas-m-1 bas-min-w-fit bas-text-left xmd:bas-my-8 sm1:bas-h-[364px] bas-w-full xmd:bas-w-fit lg:bas-h-[376px] bas-h-[508px] bas-rounded-tl-[18px] bas-rounded-tr-[18px] xmd:bas-rounded-br-[18px] xmd:bas-rounded-bl-[18px]"
25
25
  (closed)="onClose()"
26
26
  >
27
27
  <div class="bas-box-border bas-h-full bas-w-full bas-px-4 bas-pb-4 bas-pt-6 sm1:bas-pt-5 xmd:bas-pb-3.5 lg:bas-px-6 lg:bas-pb-5 lg:bas-pt-[26px]">
@@ -71,7 +71,7 @@ import { BtnBaseProviderComponent } from '../../btns/btn-base-provider.component
71
71
  <ba-btn-base-provider
72
72
  [text]="getBtnProviderText(item, uiConfigProvidersInfo().providersColumns ?? 3, isMobile(), uiConfigProvidersInfo().showProviderNameOnMobile)"
73
73
  [sizeClassNames]="getBtnProviderSize(isMobile(), uiConfigProvidersInfo().showProviderNameOnMobile, isEditable(), device())"
74
- [borderClassNames]="getBtnProviderBorderClassNames(item, selectedService())"
74
+ [isSelected]="selectedService() === item"
75
75
  [isEditable]="isEditable()"
76
76
  [device]="device()"
77
77
  (providerClicked)="selectedServiceChange.emit(item)"
@@ -238,16 +238,6 @@ export class ProvidersButtonsComponent {
238
238
  return classNames;
239
239
  }
240
240
 
241
- getBtnProviderBorderClassNames(item: string, selected: string): string {
242
- const style = providersStyles[item];
243
- let classNames = `${style ? style.hoverBorderStyles : 'hover:bas-border-slate-400'}`;
244
- if (item === 'blockauth') classNames += ' bas-border-[3px] ';
245
- else classNames += ' bas-border-2 ';
246
- if (selected === item && style) classNames += ` ${style.borderStyles} `;
247
- else classNames += ' bas-border-slate-300 ';
248
- return classNames;
249
- }
250
-
251
241
  getBtnBaseProviderContainerClassNames(editable: boolean, dev: string): string {
252
242
  if (!editable) return 'bas-h-fit bas-w-fit sm1:bas-h-16 sm1:bas-w-full';
253
243
  if (dev === 'phone') return 'bas-h-fit bas-w-fit';
@@ -47,8 +47,7 @@ import { DropdownProfileComponent } from '../dds/dropdown-profile.component';
47
47
  loaderId="signup-provider-loader"
48
48
  [imgSrc]="isWeb3ProviderSelected() && imgQR() ? imgQR() : style().imgSrc"
49
49
  [imgAlt]="'Img of ' + selectedService() + ' provider'"
50
- [imgBgColor]="style().imgBgColor"
51
- [loaderColor]="style().loaderColor"
50
+ [showLoaderRing]="false"
52
51
  [scaleImgWhenHovered]="!isWeb3ProviderSelected()"
53
52
  [size]="isWeb3ProviderSelected() ? 'medium' : 'small'"
54
53
  />
@@ -75,9 +74,9 @@ import { DropdownProfileComponent } from '../dds/dropdown-profile.component';
75
74
  <!-- CONECTADO: "Completa el último paso" + fila de Log In -->
76
75
  <div class="bas-flex bas-w-full bas-flex-col bas-items-center bas-gap-4 bas-pt-2">
77
76
  <div class="bas-flex bas-w-full bas-items-center bas-justify-center bas-gap-3">
78
- <span class="bas-h-px bas-flex-1 bas-bg-[var(--bal-primary-300)]"></span>
79
- <p class="bas-m-0 bas-text-center bas-text-[var(--bal-primary-600)]">{{ lastStepTxt() }}</p>
80
- <span class="bas-h-px bas-flex-1 bas-bg-[var(--bal-primary-300)]"></span>
77
+ <span class="bal-ba-glass-divider bas-h-px bas-flex-1"></span>
78
+ <p class="bas-m-0 bas-text-center bas-text-[var(--bal-primary-700)]">{{ lastStepTxt() }}</p>
79
+ <span class="bal-ba-glass-divider bal-ba-glass-divider-end bas-h-px bas-flex-1"></span>
81
80
  </div>
82
81
  <div class="bas-flex bas-h-fit bas-w-full bas-flex-row bas-items-center bas-justify-center bas-gap-4">
83
82
  <ba-arrow-icon direction="right" />
@@ -12,7 +12,7 @@ const iconClassNames = 'bal-ba-glass-icon bas-text-[#009F6B]';
12
12
  changeDetection: ChangeDetectionStrategy.OnPush,
13
13
  template: `
14
14
  <div
15
- class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-stagger bas-box-border bas-grid bas-w-[334px] bas-grid-rows-3 bas-gap-3 bas-py-4 bas-pl-3"
15
+ class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-stagger bas-box-border bas-grid bas-w-full bas-grid-rows-3 bas-gap-3 bas-py-4 bas-pl-3"
16
16
  >
17
17
  @for (permission of requiredPermissions(); track $index) {
18
18
  <div class="bal-ba-glass-row">
@@ -544,6 +544,7 @@ describe('SolicitedDataModal botón de cerrar', () => {
544
544
  imports: [SolicitedDataModalComponent],
545
545
  template: `<ba-solicited-data-modal
546
546
  [requiredParams]="['users-email']"
547
+ [userParamValues]="{ 'users-email': 'user@test.com' }"
547
548
  [closable]="true"
548
549
  [acceptable]="true"
549
550
  (accepted)="onAccepted()"
@@ -561,6 +562,44 @@ describe('SolicitedDataModal botón de cerrar', () => {
561
562
  expect(accepts).toBe(1);
562
563
  });
563
564
 
565
+ it('deshabilita Aceptar mientras falte un obligatorio', async () => {
566
+ @Component({
567
+ standalone: true,
568
+ imports: [SolicitedDataModalComponent],
569
+ template: `<ba-solicited-data-modal
570
+ [requiredParams]="['users-email']"
571
+ [acceptable]="true"
572
+ />`,
573
+ })
574
+ class Host {}
575
+ await render(Host);
576
+ const accept = screen.getByRole('button', { name: 'Accept' }) as HTMLButtonElement;
577
+ expect(accept.disabled).toBe(true);
578
+ });
579
+
580
+ it('coloca Cancelar a la izquierda de Aceptar y emite closed', async () => {
581
+ let closes = 0;
582
+ @Component({
583
+ standalone: true,
584
+ imports: [SolicitedDataModalComponent],
585
+ template: `<ba-solicited-data-modal
586
+ [requiredParams]="['users-email']"
587
+ [closable]="true"
588
+ [acceptable]="true"
589
+ (closed)="onClosed()"
590
+ />`,
591
+ })
592
+ class Host {
593
+ onClosed = () => closes++;
594
+ }
595
+ await render(Host);
596
+ const cancel = screen.getByRole('button', { name: 'Cancel' });
597
+ const accept = screen.getByRole('button', { name: 'Accept' });
598
+ expect(cancel.nextElementSibling).toBe(accept);
599
+ await fireEvent.click(cancel);
600
+ expect(closes).toBe(1);
601
+ });
602
+
564
603
  it('traduce el botón Aceptar', async () => {
565
604
  setLocale('es');
566
605
  @Component({
@@ -67,7 +67,7 @@ interface SolicitedFieldView extends SolicitedField {
67
67
  changeDetection: ChangeDetectionStrategy.OnPush,
68
68
  template: `
69
69
  <div
70
- class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-modal bas-box-border bas-w-[334px] bas-gap-4 bas-p-4"
70
+ class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-modal bas-box-border bas-w-full bas-max-w-[334px] bas-gap-4 bas-p-4"
71
71
  >
72
72
  @if (closable()) {
73
73
  <div class="bal-ba-glass-modal-head">
@@ -265,15 +265,29 @@ interface SolicitedFieldView extends SolicitedField {
265
265
  <p role="alert" class="bal-ba-glass-notice bal-ba-glass-notice-error bal-ba-glass-rise">
266
266
  {{ errorTxt() }}
267
267
  </p>
268
- } @if (acceptable()) {
269
- <button
270
- type="button"
271
- id="solicited-data-accept"
272
- class="bal-ba-glass-action bal-ba-glass-action-primary"
273
- (click)="accepted.emit()"
274
- >
275
- {{ acceptTxt() ?? t('acceptData') }}
276
- </button>
268
+ } @if (closable() || acceptable()) {
269
+ <div class="bal-ba-glass-actions">
270
+ @if (closable()) {
271
+ <button
272
+ type="button"
273
+ id="solicited-data-cancel"
274
+ class="bal-ba-glass-action bal-ba-glass-action-primary bal-ba-glass-action-secondary"
275
+ (click)="closed.emit()"
276
+ >
277
+ {{ cancelTxt() ?? t('cancelData') }}
278
+ </button>
279
+ } @if (acceptable()) {
280
+ <button
281
+ type="button"
282
+ id="solicited-data-accept"
283
+ class="bal-ba-glass-action bal-ba-glass-action-primary"
284
+ [disabled]="!allRequiredFilled()"
285
+ (click)="accepted.emit()"
286
+ >
287
+ {{ acceptTxt() ?? t('acceptData') }}
288
+ </button>
289
+ }
290
+ </div>
277
291
  }
278
292
  </div>
279
293
  `,
@@ -292,6 +306,7 @@ export class SolicitedDataModalComponent {
292
306
  closable = input(false);
293
307
  acceptable = input(false);
294
308
  acceptTxt = input<string>();
309
+ cancelTxt = input<string>();
295
310
 
296
311
  paramChange = output<ParamChange>();
297
312
  shareChange = output<ShareChange>();
@@ -48,6 +48,19 @@ describe('Txn', () => {
48
48
  expect(screen.getByText('REJECT')).toBeDefined();
49
49
  });
50
50
 
51
+ it('lee el consentimiento como una sola frase que fluye', async () => {
52
+ setLocale('es');
53
+ await render(TxnComponent, {
54
+ inputs: { hasSolicitedData: true },
55
+ providers: [provideBlockAuthClientForTest(makeClient())],
56
+ });
57
+ const sentence = screen.getByTestId('btn-privacy-policy').parentElement;
58
+ expect(sentence?.tagName).toBe('P');
59
+ expect(sentence?.textContent?.replace(/\s+/g, ' ').trim()).toBe(
60
+ 'Autorizo la Política de Privacidad y los Términos y Condiciones',
61
+ );
62
+ });
63
+
51
64
  it('respeta el locale activo cuando no se pasan textos custom', async () => {
52
65
  setLocale('es');
53
66
  await render(TxnComponent, {