@salas-ds/cli 0.1.0 → 0.2.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/dist/index.js +296 -94
- package/package.json +4 -5
- package/templates/angular/accordion/accordion-content.component.ts +9 -0
- package/templates/angular/accordion/accordion-item.component.ts +138 -0
- package/templates/angular/accordion/accordion-trigger.component.ts +9 -0
- package/templates/angular/accordion/accordion.component.ts +120 -0
- package/templates/angular/accordion/accordion.module.ts +21 -0
- package/templates/angular/autocomplete/autocomplete.component.ts +707 -0
- package/templates/angular/autocomplete/autocomplete.module.ts +8 -0
- package/templates/angular/avatar/avatar-badge.component.ts +18 -0
- package/templates/angular/avatar/avatar-fallback.component.ts +39 -0
- package/templates/angular/avatar/avatar-group-count.component.ts +46 -0
- package/templates/angular/avatar/avatar-group.component.ts +33 -0
- package/templates/angular/avatar/avatar-image.component.ts +57 -0
- package/templates/angular/avatar/avatar.component.ts +73 -0
- package/templates/angular/avatar/avatar.module.ts +27 -0
- package/templates/angular/badge/badge.component.ts +84 -0
- package/templates/angular/badge/badge.module.ts +9 -0
- package/templates/angular/button/button.component.ts +24 -4
- package/templates/angular/card/card.component.ts +100 -0
- package/templates/angular/card/card.module.ts +8 -0
- package/templates/angular/checkbox/checkbox.component.ts +172 -0
- package/templates/angular/checkbox/checkbox.module.ts +8 -0
- package/templates/angular/datepicker/datepicker.component.ts +660 -0
- package/templates/angular/datepicker/datepicker.module.ts +8 -0
- package/templates/angular/dialog/dialog-content.component.ts +9 -0
- package/templates/angular/dialog/dialog-description.component.ts +17 -0
- package/templates/angular/dialog/dialog-footer.component.ts +17 -0
- package/templates/angular/dialog/dialog-header.component.ts +14 -0
- package/templates/angular/dialog/dialog-title.component.ts +18 -0
- package/templates/angular/dialog/dialog-trigger.component.ts +9 -0
- package/templates/angular/dialog/dialog.component.ts +212 -0
- package/templates/angular/dialog/dialog.module.ts +31 -0
- package/templates/angular/input/input.component.ts +229 -0
- package/templates/angular/input/input.module.ts +8 -0
- package/templates/angular/scroll-area/scroll-area.component.ts +72 -0
- package/templates/angular/scroll-area/scroll-area.module.ts +9 -0
- package/templates/angular/scroll-area/scroll-bar.component.ts +15 -0
- package/templates/angular/select/select.component.ts +292 -0
- package/templates/angular/select/select.module.ts +8 -0
- package/templates/angular/separator/separator.component.ts +63 -0
- package/templates/angular/separator/separator.module.ts +9 -0
- package/templates/angular/sheet/sheet-content.component.ts +13 -0
- package/templates/angular/sheet/sheet-description.component.ts +29 -0
- package/templates/angular/sheet/sheet-footer.component.ts +27 -0
- package/templates/angular/sheet/sheet-header.component.ts +26 -0
- package/templates/angular/sheet/sheet-title.component.ts +31 -0
- package/templates/angular/sheet/sheet-trigger.component.ts +11 -0
- package/templates/angular/sheet/sheet.component.ts +251 -0
- package/templates/angular/sheet/sheet.module.ts +30 -0
- package/templates/angular/sidebar/sidebar-content.component.ts +25 -0
- package/templates/angular/sidebar/sidebar-footer.component.ts +20 -0
- package/templates/angular/sidebar/sidebar-group-content.component.ts +16 -0
- package/templates/angular/sidebar/sidebar-group-label.component.ts +20 -0
- package/templates/angular/sidebar/sidebar-group.component.ts +14 -0
- package/templates/angular/sidebar/sidebar-header.component.ts +25 -0
- package/templates/angular/sidebar/sidebar-inset.component.ts +85 -0
- package/templates/angular/sidebar/sidebar-menu-button.component.ts +75 -0
- package/templates/angular/sidebar/sidebar-menu-item.component.ts +14 -0
- package/templates/angular/sidebar/sidebar-menu.component.ts +19 -0
- package/templates/angular/sidebar/sidebar-provider.component.ts +77 -0
- package/templates/angular/sidebar/sidebar-trigger.component.ts +58 -0
- package/templates/angular/sidebar/sidebar.component.ts +228 -0
- package/templates/angular/sidebar/sidebar.module.ts +48 -0
- package/templates/angular/sidebar/sidebar.service.ts +93 -0
- package/templates/angular/skeleton/skeleton.component.ts +44 -0
- package/templates/angular/skeleton/skeleton.module.ts +8 -0
- package/templates/angular/spinner/spinner.component.ts +75 -0
- package/templates/angular/spinner/spinner.module.ts +8 -0
- package/templates/angular/table/table-body.component.ts +23 -0
- package/templates/angular/table/table-caption.component.ts +29 -0
- package/templates/angular/table/table-cell.component.ts +49 -0
- package/templates/angular/table/table-footer.component.ts +32 -0
- package/templates/angular/table/table-head.component.ts +48 -0
- package/templates/angular/table/table-header.component.ts +28 -0
- package/templates/angular/table/table-row.component.ts +36 -0
- package/templates/angular/table/table.component.ts +35 -0
- package/templates/angular/table/table.module.ts +33 -0
- package/templates/angular/tabs/tabs-content.component.ts +71 -0
- package/templates/angular/tabs/tabs-list.component.ts +70 -0
- package/templates/angular/tabs/tabs-trigger.component.ts +149 -0
- package/templates/angular/tabs/tabs.component.ts +155 -0
- package/templates/angular/tabs/tabs.module.ts +21 -0
- package/templates/angular/textarea/textarea.component.ts +268 -0
- package/templates/angular/textarea/textarea.module.ts +8 -0
- package/templates/angular/toast/toast.module.ts +8 -0
- package/templates/angular/toast/toast.service.ts +104 -0
- package/templates/angular/toast/toaster.component.ts +329 -0
- package/templates/angular/tooltip/tooltip-content.component.ts +43 -0
- package/templates/angular/tooltip/tooltip-trigger.component.ts +13 -0
- package/templates/angular/tooltip/tooltip.component.ts +243 -0
- package/templates/angular/tooltip/tooltip.module.ts +10 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'salas-avatar-badge',
|
|
5
|
+
standalone: true,
|
|
6
|
+
imports: [],
|
|
7
|
+
encapsulation: ViewEncapsulation.None,
|
|
8
|
+
host: {
|
|
9
|
+
style: 'position: absolute; bottom: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: center; width: 0.75rem; height: 0.75rem; border-radius: 9999px; border: 2px solid var(--salas-bg-elevated, #fff); background-color: var(--salas-success-500, #22c55e); overflow: hidden;',
|
|
10
|
+
},
|
|
11
|
+
template: `<ng-content></ng-content>`,
|
|
12
|
+
styles: [`
|
|
13
|
+
:host-context([data-theme="dark"]) salas-avatar-badge {
|
|
14
|
+
border-color: var(--salas-bg-elevated);
|
|
15
|
+
}
|
|
16
|
+
`],
|
|
17
|
+
})
|
|
18
|
+
export class SalasAvatarBadgeComponent {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export type AvatarSize = 'default' | 'sm' | 'lg';
|
|
4
|
+
|
|
5
|
+
export interface AvatarProps {
|
|
6
|
+
size?: AvatarSize;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AvatarImageProps {
|
|
10
|
+
src?: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AvatarFallbackProps {
|
|
15
|
+
delayMs?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'salas-avatar-fallback',
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [],
|
|
23
|
+
host: {
|
|
24
|
+
'[style.display]': '"flex"',
|
|
25
|
+
'[style.alignItems]': '"center"',
|
|
26
|
+
'[style.justifyContent]': '"center"',
|
|
27
|
+
'[style.width.%]': '100',
|
|
28
|
+
'[style.height.%]': '100',
|
|
29
|
+
'[style.fontSize.rem]': '0.875',
|
|
30
|
+
'[style.fontWeight]': '"500"',
|
|
31
|
+
'[style.lineHeight]': '"1"',
|
|
32
|
+
'[style.userSelect]': '"none"',
|
|
33
|
+
'[style.zIndex]': '"0"',
|
|
34
|
+
},
|
|
35
|
+
template: `<ng-content></ng-content>`,
|
|
36
|
+
})
|
|
37
|
+
export class SalasAvatarFallbackComponent implements AvatarFallbackProps {
|
|
38
|
+
@Input() delayMs?: number;
|
|
39
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'salas-avatar-group-count',
|
|
5
|
+
standalone: true,
|
|
6
|
+
imports: [],
|
|
7
|
+
encapsulation: ViewEncapsulation.None,
|
|
8
|
+
template: `
|
|
9
|
+
<div class="salas-avatar-group-count">
|
|
10
|
+
<ng-content></ng-content>
|
|
11
|
+
@if (count !== undefined && count !== null) {
|
|
12
|
+
<span>+{{ count }}</span>
|
|
13
|
+
}
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
styles: [`
|
|
17
|
+
.salas-avatar-group-count {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: 2.5rem;
|
|
23
|
+
height: 2.5rem;
|
|
24
|
+
border-radius: 9999px;
|
|
25
|
+
background-color: var(--salas-gray-100);
|
|
26
|
+
color: var(--salas-gray-600);
|
|
27
|
+
border: 2px solid var(--salas-bg-elevated, #fff);
|
|
28
|
+
font-size: 0.875rem;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
margin-left: -0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.salas-avatar-group-count > span {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host-context([data-theme="dark"]) .salas-avatar-group-count {
|
|
38
|
+
background-color: var(--salas-gray-800);
|
|
39
|
+
color: var(--salas-gray-300);
|
|
40
|
+
border-color: var(--salas-bg-elevated);
|
|
41
|
+
}
|
|
42
|
+
`],
|
|
43
|
+
})
|
|
44
|
+
export class SalasAvatarGroupCountComponent {
|
|
45
|
+
@Input() count?: number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'salas-avatar-group',
|
|
5
|
+
standalone: true,
|
|
6
|
+
imports: [],
|
|
7
|
+
encapsulation: ViewEncapsulation.None,
|
|
8
|
+
template: `
|
|
9
|
+
<div class="salas-avatar-group">
|
|
10
|
+
<ng-content></ng-content>
|
|
11
|
+
</div>
|
|
12
|
+
`,
|
|
13
|
+
styles: [`
|
|
14
|
+
.salas-avatar-group {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row-reverse;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.salas-avatar-group ::ng-deep salas-avatar {
|
|
20
|
+
margin-left: -0.5rem;
|
|
21
|
+
border: 2px solid var(--salas-bg-elevated, #fff);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.salas-avatar-group ::ng-deep salas-avatar:last-child {
|
|
25
|
+
margin-left: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host-context([data-theme="dark"]) .salas-avatar-group ::ng-deep salas-avatar {
|
|
29
|
+
border-color: var(--salas-bg-elevated);
|
|
30
|
+
}
|
|
31
|
+
`],
|
|
32
|
+
})
|
|
33
|
+
export class SalasAvatarGroupComponent {}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export type AvatarSize = 'default' | 'sm' | 'lg';
|
|
4
|
+
|
|
5
|
+
export interface AvatarProps {
|
|
6
|
+
size?: AvatarSize;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AvatarImageProps {
|
|
10
|
+
src?: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AvatarFallbackProps {
|
|
15
|
+
delayMs?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'salas-avatar-image',
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [],
|
|
23
|
+
host: {
|
|
24
|
+
'[style.display]': '"block"',
|
|
25
|
+
'[style.position]': '"absolute"',
|
|
26
|
+
'[style.top]': '"0"',
|
|
27
|
+
'[style.left]': '"0"',
|
|
28
|
+
'[style.width.%]': '100',
|
|
29
|
+
'[style.height.%]': '100',
|
|
30
|
+
'[style.zIndex]': '"1"',
|
|
31
|
+
},
|
|
32
|
+
template: `
|
|
33
|
+
@if (!imageError && src) {
|
|
34
|
+
<img
|
|
35
|
+
[src]="src"
|
|
36
|
+
[alt]="alt"
|
|
37
|
+
style="width: 100%; height: 100%; object-fit: cover; border-radius: inherit;"
|
|
38
|
+
(error)="onError()"
|
|
39
|
+
(load)="onLoad()"
|
|
40
|
+
/>
|
|
41
|
+
}
|
|
42
|
+
`,
|
|
43
|
+
})
|
|
44
|
+
export class SalasAvatarImageComponent implements AvatarImageProps {
|
|
45
|
+
@Input() src?: string;
|
|
46
|
+
@Input() alt?: string;
|
|
47
|
+
|
|
48
|
+
imageError = false;
|
|
49
|
+
|
|
50
|
+
onError(): void {
|
|
51
|
+
this.imageError = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
onLoad(): void {
|
|
55
|
+
this.imageError = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { cn } from '../utils';
|
|
3
|
+
|
|
4
|
+
export type AvatarSize = 'default' | 'sm' | 'lg';
|
|
5
|
+
|
|
6
|
+
export interface AvatarProps {
|
|
7
|
+
size?: AvatarSize;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AvatarImageProps {
|
|
11
|
+
src?: string;
|
|
12
|
+
alt?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AvatarFallbackProps {
|
|
16
|
+
delayMs?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'salas-avatar',
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [],
|
|
24
|
+
encapsulation: ViewEncapsulation.None,
|
|
25
|
+
template: `
|
|
26
|
+
<div [class]="avatarClasses">
|
|
27
|
+
<ng-content></ng-content>
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
styles: [`
|
|
31
|
+
.salas-avatar {
|
|
32
|
+
position: relative;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
border-radius: 9999px;
|
|
38
|
+
background-color: var(--salas-gray-100);
|
|
39
|
+
color: var(--salas-gray-600);
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.salas-avatar--default {
|
|
44
|
+
width: 2.5rem;
|
|
45
|
+
height: 2.5rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.salas-avatar--sm {
|
|
49
|
+
width: 2rem;
|
|
50
|
+
height: 2rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.salas-avatar--lg {
|
|
54
|
+
width: 3.5rem;
|
|
55
|
+
height: 3.5rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host-context([data-theme="dark"]) .salas-avatar {
|
|
59
|
+
background-color: var(--salas-gray-800);
|
|
60
|
+
color: var(--salas-gray-300);
|
|
61
|
+
}
|
|
62
|
+
`],
|
|
63
|
+
})
|
|
64
|
+
export class SalasAvatarComponent implements AvatarProps {
|
|
65
|
+
@Input() size: AvatarSize = 'default';
|
|
66
|
+
|
|
67
|
+
get avatarClasses(): string {
|
|
68
|
+
return cn(
|
|
69
|
+
'salas-avatar',
|
|
70
|
+
`salas-avatar--${this.size}`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { SalasAvatarComponent } from './avatar.component';
|
|
3
|
+
import { SalasAvatarImageComponent } from './avatar-image.component';
|
|
4
|
+
import { SalasAvatarFallbackComponent } from './avatar-fallback.component';
|
|
5
|
+
import { SalasAvatarBadgeComponent } from './avatar-badge.component';
|
|
6
|
+
import { SalasAvatarGroupComponent } from './avatar-group.component';
|
|
7
|
+
import { SalasAvatarGroupCountComponent } from './avatar-group-count.component';
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
imports: [
|
|
11
|
+
SalasAvatarComponent,
|
|
12
|
+
SalasAvatarImageComponent,
|
|
13
|
+
SalasAvatarFallbackComponent,
|
|
14
|
+
SalasAvatarBadgeComponent,
|
|
15
|
+
SalasAvatarGroupComponent,
|
|
16
|
+
SalasAvatarGroupCountComponent,
|
|
17
|
+
],
|
|
18
|
+
exports: [
|
|
19
|
+
SalasAvatarComponent,
|
|
20
|
+
SalasAvatarImageComponent,
|
|
21
|
+
SalasAvatarFallbackComponent,
|
|
22
|
+
SalasAvatarBadgeComponent,
|
|
23
|
+
SalasAvatarGroupComponent,
|
|
24
|
+
SalasAvatarGroupCountComponent,
|
|
25
|
+
],
|
|
26
|
+
})
|
|
27
|
+
export class SalasAvatarModule {}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { cn } from '../utils';
|
|
3
|
+
|
|
4
|
+
export type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
|
5
|
+
|
|
6
|
+
export interface BadgeProps {
|
|
7
|
+
variant?: BadgeVariant;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'salas-badge',
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [],
|
|
15
|
+
template: `<span [class]="badgeClasses"><ng-content></ng-content></span>`,
|
|
16
|
+
styles: [`
|
|
17
|
+
.salas-badge {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
border-radius: 9999px;
|
|
22
|
+
padding: 0.125rem 0.625rem;
|
|
23
|
+
font-size: 0.75rem;
|
|
24
|
+
line-height: 1rem;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
border: 1px solid transparent;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.salas-badge--default {
|
|
31
|
+
background-color: #000000;
|
|
32
|
+
color: #ffffff;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.salas-badge--secondary {
|
|
36
|
+
background-color: var(--salas-gray-100);
|
|
37
|
+
color: var(--salas-gray-900);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.salas-badge--destructive {
|
|
41
|
+
background-color: var(--salas-destructive-100);
|
|
42
|
+
color: var(--salas-destructive-600);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.salas-badge--outline {
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
color: var(--salas-gray-900);
|
|
48
|
+
border-color: var(--salas-gray-200);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Dark mode tweaks */
|
|
52
|
+
:host-context([data-theme="dark"]) .salas-badge--default {
|
|
53
|
+
background-color: #ffffff;
|
|
54
|
+
color: #09090b;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host-context([data-theme="dark"]) .salas-badge--secondary {
|
|
58
|
+
background-color: var(--salas-gray-100);
|
|
59
|
+
color: var(--salas-gray-900);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host-context([data-theme="dark"]) .salas-badge--destructive {
|
|
63
|
+
background-color: #4c1d1d;
|
|
64
|
+
color: #fecaca;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host-context([data-theme="dark"]) .salas-badge--outline {
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
color: var(--salas-text);
|
|
70
|
+
border-color: var(--salas-gray-200);
|
|
71
|
+
}
|
|
72
|
+
`],
|
|
73
|
+
})
|
|
74
|
+
export class SalasBadgeComponent implements BadgeProps {
|
|
75
|
+
@Input() variant: BadgeVariant = 'default';
|
|
76
|
+
|
|
77
|
+
get badgeClasses(): string {
|
|
78
|
+
return cn(
|
|
79
|
+
'salas-badge',
|
|
80
|
+
this.variant && `salas-badge--${this.variant}`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { cn } from '
|
|
1
|
+
import { Component, Input, Output, EventEmitter, forwardRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { cn } from '../utils';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Button component types
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type ButtonVariant = 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
10
|
+
export type ButtonSize = 'default' | 'sm' | 'lg' | 'icon';
|
|
11
|
+
|
|
12
|
+
export interface ButtonProps {
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
type?: 'button' | 'submit' | 'reset';
|
|
19
|
+
}
|
|
20
|
+
|
|
4
21
|
|
|
5
22
|
@Component({
|
|
6
23
|
selector: 'salas-button',
|
|
@@ -49,6 +66,7 @@ import { cn } from '@salas-ds/core';
|
|
|
49
66
|
cursor: not-allowed;
|
|
50
67
|
}
|
|
51
68
|
|
|
69
|
+
/* Variants */
|
|
52
70
|
.salas-button--default {
|
|
53
71
|
background-color: var(--salas-primary-500);
|
|
54
72
|
color: white;
|
|
@@ -106,6 +124,7 @@ import { cn } from '@salas-ds/core';
|
|
|
106
124
|
color: var(--salas-primary-600);
|
|
107
125
|
}
|
|
108
126
|
|
|
127
|
+
/* Sizes */
|
|
109
128
|
.salas-button--sm {
|
|
110
129
|
height: 2rem;
|
|
111
130
|
padding: 0 0.75rem;
|
|
@@ -134,6 +153,7 @@ import { cn } from '@salas-ds/core';
|
|
|
134
153
|
width: 100%;
|
|
135
154
|
}
|
|
136
155
|
|
|
156
|
+
/* Loader */
|
|
137
157
|
.salas-button-loader {
|
|
138
158
|
width: 1rem;
|
|
139
159
|
height: 1rem;
|
|
@@ -150,7 +170,7 @@ import { cn } from '@salas-ds/core';
|
|
|
150
170
|
}
|
|
151
171
|
`],
|
|
152
172
|
})
|
|
153
|
-
export class SalasButtonComponent {
|
|
173
|
+
export class SalasButtonComponent implements ButtonProps {
|
|
154
174
|
@Input() variant: ButtonVariant = 'default';
|
|
155
175
|
@Input() size: ButtonSize = 'default';
|
|
156
176
|
@Input() disabled = false;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { cn } from '../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Card component types
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type CardVariant = 'default' | 'elevated' | 'outlined';
|
|
9
|
+
|
|
10
|
+
export interface CardProps {
|
|
11
|
+
variant?: CardVariant;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'salas-card',
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [],
|
|
19
|
+
template: `
|
|
20
|
+
<div [class]="cardClasses">
|
|
21
|
+
<div class="salas-card-header">
|
|
22
|
+
<ng-content select="[slot=header]"></ng-content>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="salas-card-body">
|
|
25
|
+
<ng-content></ng-content>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="salas-card-footer">
|
|
28
|
+
<ng-content select="[slot=footer]"></ng-content>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
styles: [`
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.salas-card {
|
|
38
|
+
border-radius: 0.5rem;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
background-color: var(--salas-bg-elevated);
|
|
41
|
+
color: var(--salas-text);
|
|
42
|
+
border: 1px solid var(--salas-gray-200);
|
|
43
|
+
transition: box-shadow 0.2s, border-color 0.2s;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.salas-card--elevated {
|
|
47
|
+
border-color: transparent;
|
|
48
|
+
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host-context([data-theme="dark"]) .salas-card--elevated {
|
|
52
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.salas-card--outlined {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
border-width: 1px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.salas-card-header {
|
|
61
|
+
padding: 1rem 1.25rem;
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
font-size: 1rem;
|
|
64
|
+
border-bottom: 1px solid var(--salas-gray-200);
|
|
65
|
+
color: var(--salas-text);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.salas-card-header:empty {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.salas-card-body {
|
|
73
|
+
padding: 1.25rem;
|
|
74
|
+
font-size: 0.875rem;
|
|
75
|
+
line-height: 1.5;
|
|
76
|
+
color: var(--salas-text);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.salas-card-footer {
|
|
80
|
+
padding: 1rem 1.25rem;
|
|
81
|
+
border-top: 1px solid var(--salas-gray-200);
|
|
82
|
+
color: var(--salas-text-muted);
|
|
83
|
+
font-size: 0.875rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.salas-card-footer:empty {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
`],
|
|
90
|
+
})
|
|
91
|
+
export class SalasCardComponent implements CardProps {
|
|
92
|
+
@Input() variant: CardVariant = 'default';
|
|
93
|
+
|
|
94
|
+
get cardClasses(): string {
|
|
95
|
+
return cn(
|
|
96
|
+
'salas-card',
|
|
97
|
+
this.variant !== 'default' && `salas-card--${this.variant}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|