@block-auth.io/angular 0.3.2 → 0.4.1
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/fesm2022/block-auth.io-angular.mjs +9828 -0
- package/fesm2022/block-auth.io-angular.mjs.map +1 -0
- package/index.d.ts +1144 -0
- package/package.json +16 -37
- package/.turbo/turbo-build.log +0 -37
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -2001
- package/.turbo/turbo-typecheck.log +0 -19
- package/CHANGELOG.md +0 -245
- package/ng-package.json +0 -6
- package/scripts/css-to-ts.mjs +0 -14
- package/src/lib/__tests__/integration.test.ts +0 -45
- package/src/lib/block-auth.service.test.ts +0 -69
- package/src/lib/block-auth.service.ts +0 -81
- package/src/lib/components/btns/btn-base-provider.component.test.ts +0 -22
- package/src/lib/components/btns/btn-base-provider.component.ts +0 -55
- package/src/lib/components/btns/btn-block-auth.component.test.ts +0 -105
- package/src/lib/components/btns/btn-block-auth.component.ts +0 -117
- package/src/lib/components/btns/btn-gmail.component.test.ts +0 -16
- package/src/lib/components/btns/btn-gmail.component.ts +0 -41
- package/src/lib/components/btns/btn-google-base.component.test.ts +0 -16
- package/src/lib/components/btns/btn-google-base.component.ts +0 -73
- package/src/lib/components/btns/btn-metamask.component.test.ts +0 -20
- package/src/lib/components/btns/btn-metamask.component.ts +0 -98
- package/src/lib/components/btns/btn-microsoft.component.test.ts +0 -16
- package/src/lib/components/btns/btn-microsoft.component.ts +0 -77
- package/src/lib/components/btns/btn-phantom.component.test.ts +0 -20
- package/src/lib/components/btns/btn-phantom.component.ts +0 -93
- package/src/lib/components/btns/btn-signin.component.test.ts +0 -55
- package/src/lib/components/btns/btn-signin.component.ts +0 -108
- package/src/lib/components/btns/btn-wallet-connect.component.test.ts +0 -20
- package/src/lib/components/btns/btn-wallet-connect.component.ts +0 -109
- package/src/lib/components/btns/index.ts +0 -11
- package/src/lib/components/contents/content-signin.component.test.ts +0 -33
- package/src/lib/components/contents/content-signin.component.ts +0 -68
- package/src/lib/components/contents/content-signup.component.test.ts +0 -86
- package/src/lib/components/contents/content-signup.component.ts +0 -234
- package/src/lib/components/dds/change-account.component.test.ts +0 -66
- package/src/lib/components/dds/change-account.component.ts +0 -112
- package/src/lib/components/dds/dropdown-profile-btn.component.test.ts +0 -66
- package/src/lib/components/dds/dropdown-profile-btn.component.ts +0 -170
- package/src/lib/components/dds/dropdown-profile-item.component.test.ts +0 -75
- package/src/lib/components/dds/dropdown-profile-item.component.ts +0 -74
- package/src/lib/components/dds/dropdown-profile.component.test.ts +0 -110
- package/src/lib/components/dds/dropdown-profile.component.ts +0 -264
- package/src/lib/components/flow-block-auth.component.test.ts +0 -93
- package/src/lib/components/flow-block-auth.component.ts +0 -226
- package/src/lib/components/modals/modal-overlay.component.test.ts +0 -81
- package/src/lib/components/modals/modal-overlay.component.ts +0 -43
- package/src/lib/components/modals/modal-restoration-expired.component.test.ts +0 -71
- package/src/lib/components/modals/modal-restoration-expired.component.ts +0 -83
- package/src/lib/components/modals/modal-restore.component.test.ts +0 -74
- package/src/lib/components/modals/modal-restore.component.ts +0 -104
- package/src/lib/components/modals/modal-signin.component.test.ts +0 -66
- package/src/lib/components/modals/modal-signin.component.ts +0 -44
- package/src/lib/components/modals/modal-signup.component.test.ts +0 -56
- package/src/lib/components/modals/modal-signup.component.ts +0 -40
- package/src/lib/components/sections/footer-section.component.test.ts +0 -19
- package/src/lib/components/sections/footer-section.component.ts +0 -49
- package/src/lib/components/sections/internals/providers-buttons.component.test.ts +0 -27
- package/src/lib/components/sections/internals/providers-buttons.component.ts +0 -290
- package/src/lib/components/sections/internals/providers-filters.component.test.ts +0 -25
- package/src/lib/components/sections/internals/providers-filters.component.ts +0 -139
- package/src/lib/components/sections/internals/selected-button.component.test.ts +0 -36
- package/src/lib/components/sections/internals/selected-button.component.ts +0 -92
- package/src/lib/components/sections/login-section.component.test.ts +0 -49
- package/src/lib/components/sections/login-section.component.ts +0 -120
- package/src/lib/components/sections/providers-section.component.test.ts +0 -22
- package/src/lib/components/sections/providers-section.component.ts +0 -187
- package/src/lib/components/txns/internals/permissions-required-modal.component.test.ts +0 -36
- package/src/lib/components/txns/internals/permissions-required-modal.component.ts +0 -43
- package/src/lib/components/txns/internals/phone-input.component.test.ts +0 -119
- package/src/lib/components/txns/internals/phone-input.component.ts +0 -301
- package/src/lib/components/txns/internals/solicited-data-modal.component.test.ts +0 -661
- package/src/lib/components/txns/internals/solicited-data-modal.component.ts +0 -415
- package/src/lib/components/txns/internals/txn-error.component.test.ts +0 -127
- package/src/lib/components/txns/internals/txn-error.component.ts +0 -144
- package/src/lib/components/txns/internals/txn-type.component.test.ts +0 -52
- package/src/lib/components/txns/internals/txn-type.component.ts +0 -51
- package/src/lib/components/txns/internals/txn.component.test.ts +0 -580
- package/src/lib/components/txns/internals/txn.component.ts +0 -461
- package/src/lib/components/txns/txns-overview.component.test.ts +0 -421
- package/src/lib/components/txns/txns-overview.component.ts +0 -424
- package/src/lib/icons/ai-outline-disconnect.component.ts +0 -21
- package/src/lib/icons/bi-logo-gmail.component.ts +0 -21
- package/src/lib/icons/cg-profile.component.ts +0 -31
- package/src/lib/icons/check-icon.component.ts +0 -27
- package/src/lib/icons/ci-clock2.component.ts +0 -31
- package/src/lib/icons/fa-arrow-right.component.ts +0 -21
- package/src/lib/icons/fa-times.component.ts +0 -21
- package/src/lib/icons/fa-undo.component.ts +0 -21
- package/src/lib/icons/icons.test.ts +0 -25
- package/src/lib/icons/index.ts +0 -22
- package/src/lib/icons/io-ios-arrow-back.component.ts +0 -21
- package/src/lib/icons/io-ios-arrow-forward.component.ts +0 -21
- package/src/lib/icons/io-md-arrow-back.component.ts +0 -19
- package/src/lib/icons/io-md-arrow-forward.component.ts +0 -19
- package/src/lib/icons/pi-warning-fill.component.ts +0 -21
- package/src/lib/icons/tb-arrows-exchange2.component.ts +0 -30
- package/src/lib/icons/tb-copy-check-filled.component.ts +0 -21
- package/src/lib/icons/tb-copy.component.ts +0 -34
- package/src/lib/icons/ti-vendor-microsoft.component.ts +0 -21
- package/src/lib/inject-store.test.ts +0 -26
- package/src/lib/inject-store.ts +0 -16
- package/src/lib/primitives/arrow-icon.component.test.ts +0 -25
- package/src/lib/primitives/arrow-icon.component.ts +0 -45
- package/src/lib/primitives/btn-arrow-dir.component.test.ts +0 -22
- package/src/lib/primitives/btn-arrow-dir.component.ts +0 -65
- package/src/lib/primitives/btn-base.component.test.ts +0 -38
- package/src/lib/primitives/btn-base.component.ts +0 -140
- package/src/lib/primitives/divider-base.component.test.ts +0 -12
- package/src/lib/primitives/divider-base.component.ts +0 -74
- package/src/lib/primitives/dropdown-arrow.component.test.ts +0 -12
- package/src/lib/primitives/dropdown-arrow.component.ts +0 -46
- package/src/lib/primitives/dropdown-base.component.test.ts +0 -49
- package/src/lib/primitives/dropdown-base.component.ts +0 -329
- package/src/lib/primitives/helpers.ts +0 -151
- package/src/lib/primitives/horizontal-loader.component.test.ts +0 -19
- package/src/lib/primitives/horizontal-loader.component.ts +0 -70
- package/src/lib/primitives/icon-base.component.test.ts +0 -19
- package/src/lib/primitives/icon-base.component.ts +0 -58
- package/src/lib/primitives/img-loader.component.test.ts +0 -12
- package/src/lib/primitives/img-loader.component.ts +0 -118
- package/src/lib/primitives/index.ts +0 -29
- package/src/lib/primitives/input-base.component.test.ts +0 -20
- package/src/lib/primitives/input-base.component.ts +0 -210
- package/src/lib/primitives/lifetime-slider-base.component.test.ts +0 -88
- package/src/lib/primitives/lifetime-slider-base.component.ts +0 -75
- package/src/lib/primitives/oval-spinner.component.test.ts +0 -9
- package/src/lib/primitives/oval-spinner.component.ts +0 -158
- package/src/lib/primitives/pickers/dropdown-picker-animated-base.component.ts +0 -220
- package/src/lib/primitives/pickers/picker-button.component.ts +0 -74
- package/src/lib/primitives/pickers/time-picker-dropdown-selector.component.ts +0 -188
- package/src/lib/primitives/pickers/time-picker.component.ts +0 -124
- package/src/lib/primitives/pickers/time-unit-selector.component.ts +0 -82
- package/src/lib/primitives/progressbar.component.test.ts +0 -18
- package/src/lib/primitives/progressbar.component.ts +0 -93
- package/src/lib/primitives/providersStyles.ts +0 -268
- package/src/lib/primitives/slider-base.component.ts +0 -56
- package/src/lib/provide-block-auth.test.ts +0 -43
- package/src/lib/provide-block-auth.ts +0 -43
- package/src/lib/runtime/block-auth-runtime.directive.test.ts +0 -89
- package/src/lib/runtime/block-auth-runtime.directive.ts +0 -68
- package/src/lib/teleport-body.directive.test.ts +0 -29
- package/src/lib/teleport-body.directive.ts +0 -21
- package/src/lib/testing.ts +0 -15
- package/src/lib/transitions.css +0 -23
- package/src/public-api.ts +0 -86
- package/src/vitest.setup.ts +0 -8
- package/tailwind.config.cjs +0 -6
- package/tsconfig.json +0 -15
- package/tsconfig.lib.json +0 -9
- package/vite.config.mts +0 -44
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/io (IoIosArrowBack), espejo de
|
|
4
|
-
// packages/vue/src/icons/IoIosArrowBack.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-io-ios-arrow-back',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path
|
|
14
|
-
d="M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
export class IoIosArrowBackComponent {
|
|
20
|
-
class = input('');
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/io (IoIosArrowForward), espejo de
|
|
4
|
-
// packages/vue/src/icons/IoIosArrowForward.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-io-ios-arrow-forward',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path
|
|
14
|
-
d="M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
export class IoIosArrowForwardComponent {
|
|
20
|
-
class = input('');
|
|
21
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/io (IoMdArrowBack), espejo de
|
|
4
|
-
// packages/vue/src/icons/IoMdArrowBack.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-io-md-arrow-back',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path d="M427 234.625H167.296l119.702-119.702L256 85 85 256l171 171 29.922-29.924-118.626-119.701H427v-42.75z" />
|
|
14
|
-
</svg>
|
|
15
|
-
`,
|
|
16
|
-
})
|
|
17
|
-
export class IoMdArrowBackComponent {
|
|
18
|
-
class = input('');
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/io (IoMdArrowForward), espejo de
|
|
4
|
-
// packages/vue/src/icons/IoMdArrowForward.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-io-md-arrow-forward',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path d="M85 277.375h259.704L225.002 397.077 256 427l171-171L256 85l-29.922 29.924 118.626 119.701H85v42.75z" />
|
|
14
|
-
</svg>
|
|
15
|
-
`,
|
|
16
|
-
})
|
|
17
|
-
export class IoMdArrowForwardComponent {
|
|
18
|
-
class = input('');
|
|
19
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/pi (PiWarningFill), espejo de
|
|
4
|
-
// packages/vue/src/icons/PiWarningFill.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-pi-warning-fill',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path
|
|
14
|
-
d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
export class PiWarningFillComponent {
|
|
20
|
-
class = input('');
|
|
21
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/tb (TbArrowsExchange2), espejo de
|
|
4
|
-
// packages/vue/src/icons/TbArrowsExchange2.vue (mismo `viewBox`/`d`, trazo en
|
|
5
|
-
// vez de relleno: `fill="none"` + `stroke="currentColor"`).
|
|
6
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'ba-tb-arrows-exchange2',
|
|
9
|
-
standalone: true,
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
host: { style: 'display: contents' },
|
|
12
|
-
template: `
|
|
13
|
-
<svg
|
|
14
|
-
[class]="class()"
|
|
15
|
-
viewBox="0 0 24 24"
|
|
16
|
-
fill="none"
|
|
17
|
-
stroke="currentColor"
|
|
18
|
-
stroke-width="2"
|
|
19
|
-
stroke-linecap="round"
|
|
20
|
-
stroke-linejoin="round"
|
|
21
|
-
aria-hidden="true"
|
|
22
|
-
>
|
|
23
|
-
<path d="M17 10h-14l4 -4" />
|
|
24
|
-
<path d="M7 14h14l-4 4" />
|
|
25
|
-
</svg>
|
|
26
|
-
`,
|
|
27
|
-
})
|
|
28
|
-
export class TbArrowsExchange2Component {
|
|
29
|
-
class = input('');
|
|
30
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/tb (TbCopyCheckFilled), espejo de
|
|
4
|
-
// packages/vue/src/icons/TbCopyCheckFilled.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-tb-copy-check-filled',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path
|
|
14
|
-
d="M18.333 6a3.667 3.667 0 0 1 3.667 3.667v8.666a3.667 3.667 0 0 1 -3.667 3.667h-8.666a3.667 3.667 0 0 1 -3.667 -3.667v-8.666a3.667 3.667 0 0 1 3.667 -3.667zm-3.333 -4c1.094 0 1.828 .533 2.374 1.514a1 1 0 1 1 -1.748 .972c-.221 -.398 -.342 -.486 -.626 -.486h-10c-.548 0 -1 .452 -1 1v9.998c0 .32 .154 .618 .407 .805l.1 .065a1 1 0 1 1 -.99 1.738a3 3 0 0 1 -1.517 -2.606v-10c0 -1.652 1.348 -3 3 -3zm1.293 9.293l-3.293 3.292l-1.293 -1.292a1 1 0 0 0 -1.414 1.414l2 2a1 1 0 0 0 1.414 0l4 -4a1 1 0 0 0 -1.414 -1.414"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
export class TbCopyCheckFilledComponent {
|
|
20
|
-
class = input('');
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/tb (TbCopy), espejo de
|
|
4
|
-
// packages/vue/src/icons/TbCopy.vue (mismo `viewBox`/`d`, trazo en vez de
|
|
5
|
-
// relleno: `fill="none"` + `stroke="currentColor"`).
|
|
6
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'ba-tb-copy',
|
|
9
|
-
standalone: true,
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
host: { style: 'display: contents' },
|
|
12
|
-
template: `
|
|
13
|
-
<svg
|
|
14
|
-
[class]="class()"
|
|
15
|
-
viewBox="0 0 24 24"
|
|
16
|
-
fill="none"
|
|
17
|
-
stroke="currentColor"
|
|
18
|
-
stroke-width="2"
|
|
19
|
-
stroke-linecap="round"
|
|
20
|
-
stroke-linejoin="round"
|
|
21
|
-
aria-hidden="true"
|
|
22
|
-
>
|
|
23
|
-
<path
|
|
24
|
-
d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"
|
|
25
|
-
/>
|
|
26
|
-
<path
|
|
27
|
-
d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"
|
|
28
|
-
/>
|
|
29
|
-
</svg>
|
|
30
|
-
`,
|
|
31
|
-
})
|
|
32
|
-
export class TbCopyComponent {
|
|
33
|
-
class = input('');
|
|
34
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Icono inline extraído de react-icons/ti (TiVendorMicrosoft), espejo de
|
|
4
|
-
// packages/vue/src/icons/TiVendorMicrosoft.vue (mismo `viewBox`/`d`).
|
|
5
|
-
// Ver check-icon.component.ts para la explicación del enrutado de `class`.
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'ba-ti-vendor-microsoft',
|
|
8
|
-
standalone: true,
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
host: { style: 'display: contents' },
|
|
11
|
-
template: `
|
|
12
|
-
<svg [class]="class()" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
13
|
-
<path
|
|
14
|
-
d="M10 12.5c0-.3-.2-.5-.5-.5h-6c-.3 0-.5.2-.5.5v5c0 .3.2.5.5.6l6 .7c.3 0 .5-.2.5-.4v-5.9zM11.5 12c-.3 0-.5.2-.5.5v5.9c0 .3.2.5.5.6l9 1c.3 0 .5-.2.5-.4v-7c0-.3-.2-.5-.5-.5l-9-.1zM10 4.7c0-.3-.2-.5-.5-.4l-6 .7c-.3 0-.5.2-.5.5v5c0 .3.2.5.5.5h6c.3 0 .5-.2.5-.5v-5.8zM11.5 4.1c-.3 0-.5.3-.5.6v5.9c0 .3.2.5.5.5h9c.3 0 .5-.2.5-.5v-7c0-.3-.2-.5-.5-.4l-9 .9z"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
export class TiVendorMicrosoftComponent {
|
|
20
|
-
class = input('');
|
|
21
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { render, screen } from '@testing-library/angular';
|
|
4
|
-
import { atom } from 'nanostores';
|
|
5
|
-
import { injectStore } from './inject-store';
|
|
6
|
-
|
|
7
|
-
const $count = atom(0);
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'ba-probe',
|
|
11
|
-
standalone: true,
|
|
12
|
-
template: `<span data-testid="count">{{ count() }}</span>`,
|
|
13
|
-
})
|
|
14
|
-
class ProbeComponent {
|
|
15
|
-
count = injectStore($count);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
describe('injectStore', () => {
|
|
19
|
-
it('refleja el valor inicial y reacciona a cambios del atom', async () => {
|
|
20
|
-
const { detectChanges } = await render(ProbeComponent);
|
|
21
|
-
expect(screen.getByTestId('count').textContent).toBe('0');
|
|
22
|
-
$count.set(5);
|
|
23
|
-
detectChanges();
|
|
24
|
-
expect(screen.getByTestId('count').textContent).toBe('5');
|
|
25
|
-
});
|
|
26
|
-
});
|
package/src/lib/inject-store.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DestroyRef, inject, signal, type Signal } from '@angular/core';
|
|
2
|
-
import type { Store, StoreValue } from 'nanostores';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Puente nanostores → Angular Signal (equivalente a useStore de
|
|
6
|
-
* @nanostores/react and /vue). Debe llamarse en contexto de inyección
|
|
7
|
-
* (constructor / inicializador de campo), como cualquier inject().
|
|
8
|
-
* La suscripción se limpia con DestroyRef.
|
|
9
|
-
*/
|
|
10
|
-
export function injectStore<S extends Store>(store: S): Signal<StoreValue<S>> {
|
|
11
|
-
const destroyRef = inject(DestroyRef);
|
|
12
|
-
const state = signal<StoreValue<S>>(store.get());
|
|
13
|
-
const unsubscribe = store.listen((value) => state.set(value));
|
|
14
|
-
destroyRef.onDestroy(unsubscribe);
|
|
15
|
-
return state.asReadonly();
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { render } from '@testing-library/angular';
|
|
4
|
-
import { ArrowIconComponent } from './arrow-icon.component';
|
|
5
|
-
describe('ArrowIconComponent', () => {
|
|
6
|
-
it('renderiza la flecha con la clase segun la direccion', async () => {
|
|
7
|
-
@Component({ standalone: true, imports: [ArrowIconComponent], template: `<ba-arrow-icon direction="left" />` })
|
|
8
|
-
class Host {}
|
|
9
|
-
const { container } = await render(Host);
|
|
10
|
-
expect(container.querySelector('.bal-ba-arrow-left')).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('es visible por defecto y se oculta con visible=false', async () => {
|
|
14
|
-
@Component({
|
|
15
|
-
standalone: true,
|
|
16
|
-
imports: [ArrowIconComponent],
|
|
17
|
-
template: `<ba-arrow-icon direction="right" /><ba-arrow-icon direction="left" [visible]="false" />`,
|
|
18
|
-
})
|
|
19
|
-
class Host {}
|
|
20
|
-
const { container } = await render(Host);
|
|
21
|
-
const wrappers = container.querySelectorAll('[aria-hidden="true"]');
|
|
22
|
-
expect(wrappers[0].className).not.toContain('bas-invisible');
|
|
23
|
-
expect(wrappers[1].className).toContain('bas-invisible');
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
// Port directo de ArrowIcon.tsx / ArrowIcon.vue (triple-chevron animado con
|
|
4
|
-
// las clases `bal-ba-arrow*` absorbidas en lib-styles.css).
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'ba-arrow-icon',
|
|
7
|
-
standalone: true,
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
template: `
|
|
10
|
-
<div
|
|
11
|
-
aria-hidden="true"
|
|
12
|
-
[class]="
|
|
13
|
-
'bal-ba-transition-3 bas-flex bas-h-[30px] bas-w-[65px] bas-items-center bas-justify-center ' +
|
|
14
|
-
(visible() ? 'bas-opacity-100' : 'bas-invisible bas-opacity-0')
|
|
15
|
-
"
|
|
16
|
-
>
|
|
17
|
-
<div
|
|
18
|
-
[class]="
|
|
19
|
-
'bal-ba-arrow bas-relative bas-flex bas-h-[65px] bas-w-[65px] bas-cursor-pointer bas-justify-center ' +
|
|
20
|
-
(direction() === 'right' ? 'bal-ba-arrow-right bas-items-start' : '') +
|
|
21
|
-
' ' +
|
|
22
|
-
(direction() === 'left' ? 'bal-ba-arrow-left bas-items-center' : '')
|
|
23
|
-
"
|
|
24
|
-
>
|
|
25
|
-
<span [class]="spanClassNames()"></span>
|
|
26
|
-
<span [class]="spanClassNames()"></span>
|
|
27
|
-
<span [class]="spanClassNames()"></span>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
`,
|
|
31
|
-
})
|
|
32
|
-
export class ArrowIconComponent {
|
|
33
|
-
direction = input<'right' | 'left'>('right');
|
|
34
|
-
visible = input(true);
|
|
35
|
-
|
|
36
|
-
spanClassNames = computed(
|
|
37
|
-
() =>
|
|
38
|
-
`bas-block bas-w-2.5 bas-h-2.5 bas-border-solid
|
|
39
|
-
bas-border-[var(--bal-primary-500)] bas-absolute -bas-m-2.5 ${
|
|
40
|
-
this.direction() === 'right'
|
|
41
|
-
? 'bas-border-t-[2.5px] bas-border-l-[2.5px] bas-border-b-0 bas-border-r-0'
|
|
42
|
-
: 'bas-border-b-[2.5px] bas-border-r-[2.5px] bas-border-t-0 bas-border-l-0'
|
|
43
|
-
}`,
|
|
44
|
-
);
|
|
45
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { render, screen, fireEvent } from '@testing-library/angular';
|
|
4
|
-
import { BtnArrowDirComponent } from './btn-arrow-dir.component';
|
|
5
|
-
describe('BtnArrowDirComponent', () => {
|
|
6
|
-
it('emite clicked al pulsar si no esta disabled', async () => {
|
|
7
|
-
const onClicked = vi.fn();
|
|
8
|
-
@Component({ standalone: true, imports: [BtnArrowDirComponent], template: `<ba-btn-arrow-dir direction="forward" (clicked)="f()" />` })
|
|
9
|
-
class Host { f = onClicked; }
|
|
10
|
-
await render(Host);
|
|
11
|
-
await fireEvent.click(screen.getByTestId('btn-arrow-forward'));
|
|
12
|
-
expect(onClicked).toHaveBeenCalled();
|
|
13
|
-
});
|
|
14
|
-
it('no emite clicked cuando disabled', async () => {
|
|
15
|
-
const onClicked = vi.fn();
|
|
16
|
-
@Component({ standalone: true, imports: [BtnArrowDirComponent], template: `<ba-btn-arrow-dir [disabled]="true" (clicked)="f()" />` })
|
|
17
|
-
class Host { f = onClicked; }
|
|
18
|
-
await render(Host);
|
|
19
|
-
await fireEvent.click(screen.getByTestId('btn-arrow-back'));
|
|
20
|
-
expect(onClicked).not.toHaveBeenCalled();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
IoIosArrowBackComponent,
|
|
4
|
-
IoIosArrowForwardComponent,
|
|
5
|
-
IoMdArrowBackComponent,
|
|
6
|
-
IoMdArrowForwardComponent,
|
|
7
|
-
} from '../icons';
|
|
8
|
-
|
|
9
|
-
// Mapeo dirección+arrowType -> icono:
|
|
10
|
-
// chevron `IoIos*` para arrowType 'arrow', flecha Material `IoMd*` para
|
|
11
|
-
// 'arrow-round', según dirección. Los componentes vienen del módulo de
|
|
12
|
-
// iconos inline dedicado (`../icons`, Task A6).
|
|
13
|
-
// DISCLAIMER: se usa un <span> en vez de <button>
|
|
14
|
-
// porque el elemento button no posiciona bien el icono de flecha.
|
|
15
|
-
@Component({
|
|
16
|
-
selector: 'ba-btn-arrow-dir',
|
|
17
|
-
standalone: true,
|
|
18
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
-
imports: [IoIosArrowBackComponent, IoIosArrowForwardComponent, IoMdArrowBackComponent, IoMdArrowForwardComponent],
|
|
20
|
-
template: `
|
|
21
|
-
<span
|
|
22
|
-
[class]="
|
|
23
|
-
'bal-ba-transition-2 bal-ba-outline-none bas-group bas-flex bas-items-center bas-justify-center bas-border-none ' +
|
|
24
|
-
bgtnSizeClassNames() + ' ' + (!disabled() ? btnClassNames() : btnDisabledClassNames())
|
|
25
|
-
"
|
|
26
|
-
[attr.data-testid]="'btn-arrow-' + direction()"
|
|
27
|
-
(click)="onBtnClicked()"
|
|
28
|
-
>
|
|
29
|
-
@if (arrowType() === 'arrow' && direction() === 'back') {
|
|
30
|
-
<ba-io-ios-arrow-back [class]="arrowClasses()" />
|
|
31
|
-
} @else if (arrowType() === 'arrow' && direction() === 'forward') {
|
|
32
|
-
<ba-io-ios-arrow-forward [class]="arrowClasses()" />
|
|
33
|
-
} @else if (arrowType() === 'arrow-round' && direction() === 'back') {
|
|
34
|
-
<ba-io-md-arrow-back [class]="arrowClasses()" />
|
|
35
|
-
} @else {
|
|
36
|
-
<ba-io-md-arrow-forward [class]="arrowClasses()" />
|
|
37
|
-
}
|
|
38
|
-
</span>
|
|
39
|
-
`,
|
|
40
|
-
})
|
|
41
|
-
export class BtnArrowDirComponent {
|
|
42
|
-
direction = input<'back' | 'forward'>('back');
|
|
43
|
-
disabled = input(false);
|
|
44
|
-
arrowType = input<'arrow' | 'arrow-round'>('arrow');
|
|
45
|
-
btnClassNames = input('bas-rounded-full bas-cursor-pointer bas-bg-[var(--bal-primary-10)] hover:bas-bg-[#e0edf5]');
|
|
46
|
-
btnDisabledClassNames = input('bas-rounded-full bas-cursor-not-allowed bas-bg-[var(--bal-primary-10)]');
|
|
47
|
-
bgtnSizeClassNames = input('bas-h-8 bas-w-8');
|
|
48
|
-
arrowClassNames = input('bas-text-[var(--bal-primary-600)] group-hover:bas-text-[var(--bal-primary-800)]');
|
|
49
|
-
arrowDisabledClassNames = input('bas-text-[var(--bal-primary-500)]');
|
|
50
|
-
arrowSizesClassNames = input('bas-h-6 bas-w-6');
|
|
51
|
-
|
|
52
|
-
clicked = output<void>();
|
|
53
|
-
|
|
54
|
-
arrowClasses = computed(
|
|
55
|
-
() =>
|
|
56
|
-
`bal-ba-transition-2 ${this.arrowSizesClassNames()} ${
|
|
57
|
-
!this.disabled() ? this.arrowClassNames() : this.arrowDisabledClassNames()
|
|
58
|
-
}`,
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
onBtnClicked(): void {
|
|
62
|
-
if (this.disabled()) return;
|
|
63
|
-
this.clicked.emit();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { render, screen, fireEvent } from '@testing-library/angular';
|
|
4
|
-
import { BtnBaseComponent } from './btn-base.component';
|
|
5
|
-
|
|
6
|
-
// Los signal inputs se fijan con binding de plantilla desde un host component
|
|
7
|
-
// (forma inequívoca con `input()`), en vez de `componentInputs` (que no aplica
|
|
8
|
-
// signal inputs de forma fiable en @testing-library/angular 18).
|
|
9
|
-
describe('BtnBaseComponent', () => {
|
|
10
|
-
it('renderiza el texto', async () => {
|
|
11
|
-
@Component({ standalone: true, imports: [BtnBaseComponent], template: `<ba-btn-base text="Entrar" />` })
|
|
12
|
-
class HostComponent {}
|
|
13
|
-
await render(HostComponent);
|
|
14
|
-
expect(screen.getByRole('button').textContent).toContain('Entrar');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('al hacer click emite action', async () => {
|
|
18
|
-
const onAction = vi.fn();
|
|
19
|
-
@Component({
|
|
20
|
-
standalone: true,
|
|
21
|
-
imports: [BtnBaseComponent],
|
|
22
|
-
template: `<ba-btn-base text="Entrar" (action)="onAction()" />`,
|
|
23
|
-
})
|
|
24
|
-
class HostComponent {
|
|
25
|
-
onAction = onAction;
|
|
26
|
-
}
|
|
27
|
-
await render(HostComponent);
|
|
28
|
-
await fireEvent.click(screen.getByRole('button'));
|
|
29
|
-
expect(onAction).toHaveBeenCalled();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('en modo loader no muestra cursor-pointer y monta el loader', async () => {
|
|
33
|
-
@Component({ standalone: true, imports: [BtnBaseComponent], template: `<ba-btn-base [isLoader]="true" />` })
|
|
34
|
-
class HostComponent {}
|
|
35
|
-
await render(HostComponent);
|
|
36
|
-
expect(screen.getByRole('button').className).toContain('bas-cursor-default');
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
|
|
2
|
-
import { HorizontalLoaderComponent } from './horizontal-loader.component';
|
|
3
|
-
import { IconBaseComponent } from './icon-base.component';
|
|
4
|
-
|
|
5
|
-
// El JSX de React/Vue renderiza dos <button> distintos por `type`; aquí
|
|
6
|
-
// `btnClass()` computa la clase según `type()` con un único <button> — el
|
|
7
|
-
// DOM resultante es el mismo.
|
|
8
|
-
type BtnSize = 'xxs' | 'xs' | 'tiny' | 'small' | 'base' | 'large';
|
|
9
|
-
|
|
10
|
-
@Component({
|
|
11
|
-
selector: 'ba-btn-base',
|
|
12
|
-
standalone: true,
|
|
13
|
-
// El <button> interno lleva las clases de layout (p.ej. bas-w-full). El host
|
|
14
|
-
// debe ser transparente para que el <button> sea el hijo real del flex/grid
|
|
15
|
-
// del padre (como en React, donde BtnBase renderiza el <button> directamente).
|
|
16
|
-
// Sin esto, `bas-w-full` mide el 100% del host inline (que se encoge al
|
|
17
|
-
// contenido) y el botón "Sign Up" del flow no ocupa todo el ancho.
|
|
18
|
-
host: { style: 'display: contents' },
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
-
imports: [HorizontalLoaderComponent, IconBaseComponent],
|
|
21
|
-
template: `
|
|
22
|
-
<button
|
|
23
|
-
[id]="btnId()"
|
|
24
|
-
[type]="btnType()"
|
|
25
|
-
[disabled]="disabled()"
|
|
26
|
-
[class]="btnClass()"
|
|
27
|
-
(click)="onBtnClicked($event)"
|
|
28
|
-
>
|
|
29
|
-
@if (isLoader()) {
|
|
30
|
-
<ba-horizontal-loader
|
|
31
|
-
[loaderColor]="loaderColor()"
|
|
32
|
-
[loaderHeight]="loaderHeight()"
|
|
33
|
-
[loaderWidth]="loaderWidth()"
|
|
34
|
-
[classNames]="loaderContainerClassNames()"
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
@if (isIcon()) {
|
|
38
|
-
<ba-icon-base
|
|
39
|
-
[iconUrl]="iconUrl()"
|
|
40
|
-
[iconWidth]="iconWidth()"
|
|
41
|
-
[iconHeight]="iconHeight()"
|
|
42
|
-
[iconClassNames]="iconClassNames()"
|
|
43
|
-
><ng-content select="[slot=icon]" /></ba-icon-base>
|
|
44
|
-
}
|
|
45
|
-
<span [class]="'bal-ba-transition-2 ' + realTextClassNames() + ' bas-flex bas-h-full bas-items-center'">
|
|
46
|
-
<ng-content />{{ text() }}
|
|
47
|
-
</span>
|
|
48
|
-
</button>
|
|
49
|
-
`,
|
|
50
|
-
})
|
|
51
|
-
export class BtnBaseComponent {
|
|
52
|
-
btnId = input('btn-base');
|
|
53
|
-
text = input('');
|
|
54
|
-
size = input<BtnSize>('base');
|
|
55
|
-
type = input<'button-outlined' | 'button-border'>('button-outlined');
|
|
56
|
-
btnType = input<'button' | 'submit' | 'reset'>('button');
|
|
57
|
-
ringClassNames = input('bal-ba-hover-ring-primary-200 bal-ba-focus-ring-primary-300');
|
|
58
|
-
offsetClassNames = input('bal-ba-focus-ring-offset-2 bal-ba-hover-ring-offset-2');
|
|
59
|
-
commonClassNames = input(`bal-ba-transition-2 bas-group bas-relative bas-box-border
|
|
60
|
-
bas-flex bas-flex-row bas-gap-2 bas-items-center bas-overflow-hidden`);
|
|
61
|
-
classNames = input('bas-justify-center');
|
|
62
|
-
bgClassNames = input<string | undefined>(undefined);
|
|
63
|
-
borderClassNames = input<string | undefined>(undefined);
|
|
64
|
-
paddingClassNames = input<string | undefined>(undefined);
|
|
65
|
-
textClassNames = input<string | undefined>(undefined);
|
|
66
|
-
isIcon = input(true);
|
|
67
|
-
iconUrl = input<string | undefined>(undefined);
|
|
68
|
-
iconWidth = input(24);
|
|
69
|
-
iconHeight = input(24);
|
|
70
|
-
iconClassNames = input('bas-rounded-full');
|
|
71
|
-
isLoader = input(false);
|
|
72
|
-
loaderColor = input('#003e79');
|
|
73
|
-
loaderWidth = input(80);
|
|
74
|
-
loaderContainerClassNames = input('bas-rounded-md');
|
|
75
|
-
isFocusOutlinedEnabled = input(true);
|
|
76
|
-
disabled = input(false);
|
|
77
|
-
applyDisabledStyles = input(true);
|
|
78
|
-
|
|
79
|
-
/** Equivalente al emit `click` de BtnBase.vue / onClick de BtnBase.tsx. */
|
|
80
|
-
action = output<void>();
|
|
81
|
-
|
|
82
|
-
onBtnClicked(e: MouseEvent): void {
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
this.action.emit();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private realBorderClassNames = computed(
|
|
88
|
-
() =>
|
|
89
|
-
this.borderClassNames() ??
|
|
90
|
-
(this.type() === 'button-border'
|
|
91
|
-
? `bas-rounded-md bas-border-2 bas-border-solid bas-border-[var(--bal-primary-100)]
|
|
92
|
-
hover:bas-border-[var(--bal-primary-300)]`
|
|
93
|
-
: 'bas-border-none bas-rounded-md'),
|
|
94
|
-
);
|
|
95
|
-
realTextClassNames = computed(() => {
|
|
96
|
-
if (this.textClassNames()) return this.textClassNames()!;
|
|
97
|
-
const textBase = 'bas-text-sm bas-font-semibold bas-leading-6';
|
|
98
|
-
return this.type() === 'button-border'
|
|
99
|
-
? `${textBase} bas-text-[var(--bal-primary-700)] group-hover:bas-text-[var(--bal-primary-900)]`
|
|
100
|
-
: `${textBase} bas-text-white`;
|
|
101
|
-
});
|
|
102
|
-
private realBgClassNames = computed(
|
|
103
|
-
() =>
|
|
104
|
-
this.bgClassNames() ??
|
|
105
|
-
(this.type() === 'button-border'
|
|
106
|
-
? 'bas-bg-transparent'
|
|
107
|
-
: 'bas-bg-[var(--bal-primary-500)] hover:bas-bg-[var(--bal-primary-600)]'),
|
|
108
|
-
);
|
|
109
|
-
private sizeStyles = computed(
|
|
110
|
-
() =>
|
|
111
|
-
({
|
|
112
|
-
xxs: `bas-h-[34px] ${this.paddingClassNames() || 'bas-px-1 bas-py-0'}`,
|
|
113
|
-
xs: `bas-h-[36px] ${this.paddingClassNames() || 'bas-px-1.5 bas-py-0'}`,
|
|
114
|
-
tiny: `bas-h-[38px] ${this.paddingClassNames() || 'bas-px-2 bas-py-0'}`,
|
|
115
|
-
small: `bas-h-[42px] ${this.paddingClassNames() || 'bas-px-2.5 bas-py-0'}`,
|
|
116
|
-
base: `bas-h-[46px] ${this.paddingClassNames() || 'bas-px-3 bas-py-0'}`,
|
|
117
|
-
large: `bas-h-[54px] ${this.paddingClassNames() || 'bas-px-3.5 bas-py-0'}`,
|
|
118
|
-
})[this.size()],
|
|
119
|
-
);
|
|
120
|
-
loaderHeight = computed(
|
|
121
|
-
() =>
|
|
122
|
-
({ xxs: 34, xs: 36, tiny: 38, small: 42, base: 46, large: 54 }[this.size()] -
|
|
123
|
-
(this.type() === 'button-border' ? 4 : 0)),
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
btnClass = computed(() => {
|
|
127
|
-
if (this.type() === 'button-outlined') {
|
|
128
|
-
return `bal-ba-ring-base bal-ba-ring ${this.commonClassNames()} ${this.realBgClassNames()}
|
|
129
|
-
${this.ringClassNames()} ${this.sizeStyles()}
|
|
130
|
-
${this.applyDisabledStyles() ? 'disabled:bas-cursor-not-allowed disabled:bas-opacity-50' : ''}
|
|
131
|
-
${this.isLoader() ? 'bas-cursor-default' : 'bal-ba-hover-ring-2 bas-cursor-pointer'}
|
|
132
|
-
${this.isFocusOutlinedEnabled() && !this.isLoader() ? 'bal-ba-focus-ring-2 focus:bas-opacity-90' : ''}
|
|
133
|
-
${this.offsetClassNames()} ${this.classNames() || ''} ${this.realBorderClassNames()}`;
|
|
134
|
-
}
|
|
135
|
-
return `${this.commonClassNames()} ${this.sizeStyles()}
|
|
136
|
-
${this.isLoader() ? 'bas-cursor-default' : 'bas-cursor-pointer'}
|
|
137
|
-
${this.applyDisabledStyles() ? 'disabled:bas-cursor-not-allowed disabled:bas-opacity-50' : ''}
|
|
138
|
-
${this.realBorderClassNames()} ${this.realBgClassNames()} ${this.classNames() || ''}`;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { render, screen } from '@testing-library/angular';
|
|
4
|
-
import { DividerBaseComponent } from './divider-base.component';
|
|
5
|
-
describe('DividerBaseComponent', () => {
|
|
6
|
-
it('proyecta el contenido central cuando lo hay', async () => {
|
|
7
|
-
@Component({ standalone: true, imports: [DividerBaseComponent], template: `<ba-divider-base><span data-testid="mid">or</span></ba-divider-base>` })
|
|
8
|
-
class Host {}
|
|
9
|
-
await render(Host);
|
|
10
|
-
expect(screen.getByTestId('mid')).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
});
|