@sarasanalytics-com/design-system 0.0.3

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 (136) hide show
  1. package/.editorconfig +16 -0
  2. package/.eslintrc.json +22 -0
  3. package/.storybook/main.ts +21 -0
  4. package/.storybook/manager.ts +17 -0
  5. package/.storybook/preview-head.html +5 -0
  6. package/.storybook/preview.ts +65 -0
  7. package/.storybook/tsconfig.doc.json +10 -0
  8. package/.storybook/tsconfig.json +11 -0
  9. package/.storybook/typings.d.ts +4 -0
  10. package/.vscode/extensions.json +7 -0
  11. package/.vscode/launch.json +20 -0
  12. package/.vscode/settings.json +13 -0
  13. package/.vscode/tasks.json +42 -0
  14. package/README.md +27 -0
  15. package/angular.json +189 -0
  16. package/build-storybook.log +39 -0
  17. package/documentation.json +0 -0
  18. package/package.json +74 -0
  19. package/projects/component-library/README.md +24 -0
  20. package/projects/component-library/ng-package.json +8 -0
  21. package/projects/component-library/package.json +12 -0
  22. package/projects/component-library/src/interfaces/avatar-interface.ts +6 -0
  23. package/projects/component-library/src/interfaces/button-interface.ts +12 -0
  24. package/projects/component-library/src/interfaces/chip-interface.ts +11 -0
  25. package/projects/component-library/src/interfaces/grid-interface.ts +24 -0
  26. package/projects/component-library/src/interfaces/select-interface.ts +19 -0
  27. package/projects/component-library/src/interfaces/tab-interface.ts +6 -0
  28. package/projects/component-library/src/lib/avatar/avatar.component.css +48 -0
  29. package/projects/component-library/src/lib/avatar/avatar.component.html +5 -0
  30. package/projects/component-library/src/lib/avatar/avatar.component.spec.ts +23 -0
  31. package/projects/component-library/src/lib/avatar/avatar.component.ts +50 -0
  32. package/projects/component-library/src/lib/button/button.component.css +145 -0
  33. package/projects/component-library/src/lib/button/button.component.html +11 -0
  34. package/projects/component-library/src/lib/button/button.component.spec.ts +23 -0
  35. package/projects/component-library/src/lib/button/button.component.ts +68 -0
  36. package/projects/component-library/src/lib/calendar-header/calendar-header.component.css +67 -0
  37. package/projects/component-library/src/lib/calendar-header/calendar-header.component.html +20 -0
  38. package/projects/component-library/src/lib/calendar-header/calendar-header.component.spec.ts +23 -0
  39. package/projects/component-library/src/lib/calendar-header/calendar-header.component.ts +196 -0
  40. package/projects/component-library/src/lib/chips/chips.component.css +129 -0
  41. package/projects/component-library/src/lib/chips/chips.component.html +17 -0
  42. package/projects/component-library/src/lib/chips/chips.component.spec.ts +23 -0
  43. package/projects/component-library/src/lib/chips/chips.component.ts +55 -0
  44. package/projects/component-library/src/lib/component-library.component.spec.ts +23 -0
  45. package/projects/component-library/src/lib/component-library.component.ts +16 -0
  46. package/projects/component-library/src/lib/component-library.service.spec.ts +16 -0
  47. package/projects/component-library/src/lib/component-library.service.ts +9 -0
  48. package/projects/component-library/src/lib/datepicker/datepicker.component.css +33 -0
  49. package/projects/component-library/src/lib/datepicker/datepicker.component.html +11 -0
  50. package/projects/component-library/src/lib/datepicker/datepicker.component.spec.ts +23 -0
  51. package/projects/component-library/src/lib/datepicker/datepicker.component.ts +37 -0
  52. package/projects/component-library/src/lib/form-select/form-select.component.css +156 -0
  53. package/projects/component-library/src/lib/form-select/form-select.component.html +38 -0
  54. package/projects/component-library/src/lib/form-select/form-select.component.spec.ts +23 -0
  55. package/projects/component-library/src/lib/form-select/form-select.component.ts +54 -0
  56. package/projects/component-library/src/lib/grid-cell/grid-cell.component.css +78 -0
  57. package/projects/component-library/src/lib/grid-cell/grid-cell.component.html +31 -0
  58. package/projects/component-library/src/lib/grid-cell/grid-cell.component.spec.ts +23 -0
  59. package/projects/component-library/src/lib/grid-cell/grid-cell.component.ts +89 -0
  60. package/projects/component-library/src/lib/header/header.component.css +62 -0
  61. package/projects/component-library/src/lib/header/header.component.html +23 -0
  62. package/projects/component-library/src/lib/header/header.component.spec.ts +23 -0
  63. package/projects/component-library/src/lib/header/header.component.ts +28 -0
  64. package/projects/component-library/src/lib/stepper/stepper.component.css +96 -0
  65. package/projects/component-library/src/lib/stepper/stepper.component.html +14 -0
  66. package/projects/component-library/src/lib/stepper/stepper.component.spec.ts +23 -0
  67. package/projects/component-library/src/lib/stepper/stepper.component.ts +61 -0
  68. package/projects/component-library/src/lib/tabs/tabs.component.css +100 -0
  69. package/projects/component-library/src/lib/tabs/tabs.component.html +16 -0
  70. package/projects/component-library/src/lib/tabs/tabs.component.spec.ts +23 -0
  71. package/projects/component-library/src/lib/tabs/tabs.component.ts +37 -0
  72. package/projects/component-library/src/lib/toast/toast.component.css +108 -0
  73. package/projects/component-library/src/lib/toast/toast.component.html +25 -0
  74. package/projects/component-library/src/lib/toast/toast.component.spec.ts +23 -0
  75. package/projects/component-library/src/lib/toast/toast.component.ts +37 -0
  76. package/projects/component-library/src/lib/tool-tip/tool-tip.component.css +139 -0
  77. package/projects/component-library/src/lib/tool-tip/tool-tip.component.html +31 -0
  78. package/projects/component-library/src/lib/tool-tip/tool-tip.component.spec.ts +23 -0
  79. package/projects/component-library/src/lib/tool-tip/tool-tip.component.ts +37 -0
  80. package/projects/component-library/src/public-api.ts +25 -0
  81. package/projects/component-library/tsconfig.lib.json +14 -0
  82. package/projects/component-library/tsconfig.lib.prod.json +10 -0
  83. package/projects/component-library/tsconfig.spec.json +14 -0
  84. package/src/Saras-logo.svg +15 -0
  85. package/src/app/app.component.css +13 -0
  86. package/src/app/app.component.html +77 -0
  87. package/src/app/app.component.spec.ts +29 -0
  88. package/src/app/app.component.ts +505 -0
  89. package/src/app/app.config.ts +27 -0
  90. package/src/app/app.routes.ts +3 -0
  91. package/src/app/data.ts +52 -0
  92. package/src/app/kitchen-sink/kitchen-sink.component.css +29 -0
  93. package/src/app/kitchen-sink/kitchen-sink.component.html +7 -0
  94. package/src/app/kitchen-sink/kitchen-sink.component.spec.ts +23 -0
  95. package/src/app/kitchen-sink/kitchen-sink.component.ts +92 -0
  96. package/src/assets/.gitkeep +0 -0
  97. package/src/assets/Chevron.svg +5 -0
  98. package/src/assets/Frame.svg +5 -0
  99. package/src/assets/Grid.svg +5 -0
  100. package/src/assets/Location.svg +5 -0
  101. package/src/assets/Mail.svg +5 -0
  102. package/src/assets/Person.svg +5 -0
  103. package/src/assets/Scan.svg +5 -0
  104. package/src/assets/Sources.svg +5 -0
  105. package/src/assets/arrow.svg +5 -0
  106. package/src/assets/avatar.svg +12 -0
  107. package/src/assets/checkmark.svg +5 -0
  108. package/src/assets/crossmark.svg +5 -0
  109. package/src/assets/dot.svg +5 -0
  110. package/src/assets/negativemark.svg +5 -0
  111. package/src/assets/pointer-polygon.svg +3 -0
  112. package/src/assets/tick-icon.svg +5 -0
  113. package/src/assets/tick.svg +8 -0
  114. package/src/assets/warningmark.svg +5 -0
  115. package/src/custom-theme.scss +37 -0
  116. package/src/favicon.ico +0 -0
  117. package/src/index.html +23 -0
  118. package/src/main.ts +6 -0
  119. package/src/stories/GettingStarted.mdx +233 -0
  120. package/src/stories/KitchenSink.stories.ts +86 -0
  121. package/src/stories/avatar.stories.ts +45 -0
  122. package/src/stories/chips.stories.ts +61 -0
  123. package/src/stories/custom-button.stories.ts +74 -0
  124. package/src/stories/datepicker.stories.ts +78 -0
  125. package/src/stories/gridCell.stories.ts +234 -0
  126. package/src/stories/header.stories.ts +61 -0
  127. package/src/stories/selectInput.stories.ts +158 -0
  128. package/src/stories/stepper.stories.ts +92 -0
  129. package/src/stories/tabs.stories.ts +97 -0
  130. package/src/stories/toast.stories.ts +54 -0
  131. package/src/stories/tool-tip.stories.ts +45 -0
  132. package/src/styles.css +204 -0
  133. package/src/svg.d.ts +1 -0
  134. package/tsconfig.app.json +14 -0
  135. package/tsconfig.json +42 -0
  136. package/tsconfig.spec.json +14 -0
@@ -0,0 +1,12 @@
1
+ export interface ButtonInterface {
2
+ id: string | number,
3
+ text: string,
4
+ type: string,
5
+ size: string,
6
+ state: string,
7
+ imagePath?: string,
8
+ iconPosition?: string,
9
+ href?: string,
10
+ hrefTarget?: string,
11
+ isSubmit?: boolean,
12
+ }
@@ -0,0 +1,11 @@
1
+ export interface ChipInterface {
2
+ id: string | number,
3
+ text: string,
4
+ type: string,
5
+ state: string,
6
+ filling: string,
7
+ iconPosition?: string,
8
+ iconPath?: string,
9
+ largeStateIcon?: string,
10
+ largeStateText?: string
11
+ }
@@ -0,0 +1,24 @@
1
+ import { ButtonInterface } from "./button-interface";
2
+ import { ChipInterface } from "./chip-interface";
3
+ import { AvatarInterface } from "./avatar-interface";
4
+ export interface GridInterface {
5
+ cellType: string,
6
+ viewText: boolean,
7
+ viewLeadingIcon: boolean,
8
+ viewTrailingIcon: boolean,
9
+ viewButton: boolean,
10
+ viewChip: boolean,
11
+ viewAvatar: boolean,
12
+ iconPath?: string,
13
+ chipConfig?: ChipInterface[],
14
+ buttonConfig?: ButtonInterface,
15
+ avatarConfig?: AvatarInterface,
16
+ text?: string | number,
17
+ subText?: string | number,
18
+ interactiveLink?: string,
19
+ interactiveLinkTarget?: string,
20
+ chipClicked?(evt: any): any,
21
+ linkClicked?(evt: any): any,
22
+ buttonClicked?(evt: any): any,
23
+ avatarClicked?(evt: any): any
24
+ }
@@ -0,0 +1,19 @@
1
+ import { FormlyFieldProps } from "@ngx-formly/core"
2
+ interface SelectSubInterface {
3
+ label: string,
4
+ supportText: string,
5
+ dropIcon: string,
6
+ dropIconPosition: string,
7
+ multiple: boolean,
8
+ iconPath: string,
9
+ type: string,
10
+ state: string,
11
+ filling: string,
12
+ iconPosition: string,
13
+ }
14
+
15
+ export interface SelectInterface extends FormlyFieldProps {
16
+ options: any,
17
+ disabled: boolean,
18
+ params: SelectSubInterface
19
+ }
@@ -0,0 +1,6 @@
1
+ export interface TabInterface {
2
+ tabName: string,
3
+ tabIcon?: string,
4
+ iconPosition?: string,
5
+ badgeContent?: string,
6
+ }
@@ -0,0 +1,48 @@
1
+ .extra-small {
2
+ --width: var(--medium-24px);
3
+ --height: var(--medium-24px);
4
+ }
5
+
6
+ .small {
7
+ --width: 28px;
8
+ --height: 28px;
9
+ }
10
+
11
+ .medium {
12
+ --width: 32px;
13
+ --height: 32px;
14
+ }
15
+
16
+ .large {
17
+ --width: 36px;
18
+ --height: 36px;
19
+ }
20
+
21
+ .extra-large {
22
+ --width: 40px;
23
+ --height: 40px;
24
+ }
25
+
26
+ .avatar {
27
+ display: flex;
28
+ }
29
+
30
+ .avatar-img {
31
+ background-color: var(--primary-50);
32
+ height: var(--height);
33
+ width: var(--width);
34
+ border-radius: var(--height);
35
+ object-fit: cover;
36
+
37
+ font-family: var(--font);
38
+ font-size: 11px;
39
+ font-weight: 500;
40
+ line-height: var(--height);
41
+ letter-spacing: 0.5px;
42
+ text-align: center;
43
+ overflow: none;
44
+ }
45
+
46
+ .avatar:hover {
47
+ cursor: pointer;
48
+ }
@@ -0,0 +1,5 @@
1
+ <div class="avatar {{size}}" (click)="avatarClicked($event)" (mouseenter)="mouseEnter($event)"
2
+ (mouseleave)="mouseLeave($event)">
3
+ <img *ngIf="imagePath" class="avatar-img" alt="{{altText}}" src="{{imagePath}}">
4
+ <p *ngIf="!imagePath" class="avatar-img">{{altText}}</p>
5
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { AvatarComponent } from './avatar.component';
4
+
5
+ describe('AvatarComponent', () => {
6
+ let component: AvatarComponent;
7
+ let fixture: ComponentFixture<AvatarComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [AvatarComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(AvatarComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,50 @@
1
+ import { Component, EventEmitter } from '@angular/core';
2
+ import { Input, Output } from '@angular/core';
3
+ import { NgIf } from '@angular/common';
4
+
5
+ @Component({
6
+ selector: 'sa-avatar',
7
+ standalone: true,
8
+ imports: [NgIf],
9
+ templateUrl: './avatar.component.html',
10
+ styleUrl: './avatar.component.css'
11
+ })
12
+ export class AvatarComponent {
13
+ @Input() id: string | number;
14
+ @Input() imagePath: string;
15
+ @Input() altText: string;
16
+ @Input() size: string;
17
+
18
+ @Output() onClickEvent = new EventEmitter
19
+ @Output() onMouseInEvent = new EventEmitter
20
+ @Output() onMouseOutEvent = new EventEmitter
21
+
22
+ eventEmitObject = {}
23
+
24
+ ngOnChanges(): void {
25
+ this.eventEmitObject = {
26
+ id: this.id
27
+ }
28
+ }
29
+
30
+ avatarClicked(evt: Event) {
31
+ this.onClickEvent.emit({
32
+ ...this.eventEmitObject,
33
+ evt
34
+ })
35
+ }
36
+
37
+ mouseEnter(evt: Event) {
38
+ this.onMouseInEvent.emit({
39
+ ...this.eventEmitObject,
40
+ evt
41
+ })
42
+ }
43
+
44
+ mouseLeave(evt: Event) {
45
+ this.onMouseOutEvent.emit({
46
+ ...this.eventEmitObject,
47
+ evt
48
+ })
49
+ }
50
+ }
@@ -0,0 +1,145 @@
1
+ .primary {
2
+ --default-bg: var(--primary-500);
3
+ --default-color: var(--text-white);
4
+ --default-border: transparent;
5
+ --hover-bg: var(--primary-700);
6
+ --hover-color: var(--text-white);
7
+ --hover-border: transparent;
8
+ --disabled-bg: var(--grey-100);
9
+ --disabled-color: var(--text-white);
10
+ --disabled-border: transparent;
11
+ --error-default-bg: var(--semantic-error-500);
12
+ --error-hover-bg: var(--semantic-error-600);
13
+ --error-default-color: var(--text-white);
14
+ --error-hover-color: var(--text-white);
15
+ --error-default-border: var(--semantic-error-500);
16
+ --error-hover-border: var(--semantic-error-500);
17
+ --svg-icon-color: var(--default-color);
18
+ }
19
+
20
+ .outline {
21
+ --default-bg: none;
22
+ --default-color: var(--primary-500);
23
+ --default-border: var(--primary-500);
24
+ --hover-bg: var(--primary-50);
25
+ --hover-color: var(--primary-700);
26
+ --hover-border: var(--primary-700);
27
+ --disabled-bg: none;
28
+ --disabled-color: var(--grey-100);
29
+ --disabled-border: var(--grey-100);
30
+ --error-default-bg: none;
31
+ --error-hover-bg: var(--semantic-error-50);
32
+ --error-default-color: var(--semantic-error-500);
33
+ --error-hover-color: var(--semantic-error-600);
34
+ --error-default-border: var(--semantic-error-500);
35
+ --error-hover-border: var(--semantic-error-600);
36
+ --svg-icon-color: var(--default-color);
37
+ }
38
+
39
+ .transparent {
40
+ --default-bg: none;
41
+ --default-color: var(--primary-500);
42
+ --default-border: transparent;
43
+ --hover-bg: var(--primary-50);
44
+ --hover-color: var(--primary-700);
45
+ --hover-border: transparent;
46
+ --disabled-bg: none;
47
+ --disabled-color: var(--grey-100);
48
+ --disabled-border: transparent;
49
+ --error-default-bg: none;
50
+ --error-hover-bg: var(--semantic-error-50);
51
+ --error-default-color: var(--semantic-error-500);
52
+ --error-hover-color: var(--semantic-error-600);
53
+ --error-default-border: transparent;
54
+ --error-hover-border: transparent;
55
+ --svg-icon-color: var(--default-color);
56
+ }
57
+
58
+ .large {
59
+ --sizing-1: var(--small-8px);
60
+ --sizing-2: var(--small-16px);
61
+ --sizing-3: var(--small-8px);
62
+ --height: var(--medium-36px);
63
+ --font-size: var(--small-14px);
64
+ }
65
+
66
+ .medium {
67
+ --sizing-1: var(--small-6px);
68
+ --sizing-2: var(--small-12px);
69
+ --sizing-3: var(--small-8px);
70
+ --height: var(--medium-32px);
71
+ --font-size: var(--small-14px);
72
+ }
73
+
74
+ .small {
75
+ --sizing-1: var(--small-4px);
76
+ --sizing-2: var(--small-8px);
77
+ --sizing-3: var(--small-8px);
78
+ --height: var(--medium-24px);
79
+ --font-size: var(--small-12px);
80
+ }
81
+
82
+ .disabled {
83
+ background-color: var(--disabled-bg) !important;
84
+ color: var(--disabled-color) !important;
85
+ border: 1px solid var(--disabled-border) !important;
86
+ cursor: default !important;
87
+ --svg-icon-color: var(--disabled-color) !important;
88
+ }
89
+
90
+ .error {
91
+ background-color: var(--error-default-bg) !important;
92
+ color: var(--error-default-color) !important;
93
+ border: 1px solid var(--error-default-border) !important;
94
+ --svg-icon-color: var(--error-default-color) !important;
95
+ }
96
+
97
+ .error:hover {
98
+ background-color: var(--error-hover-bg) !important;
99
+ color: var(--error-hover-color) !important;
100
+ --svg-icon-color: var(--error-hover-color) !important;
101
+ }
102
+
103
+ .sa-button {
104
+ display: flex;
105
+ width: max-content;
106
+ padding: var(--sizing-1) var(--sizing-2);
107
+ justify-content: center;
108
+ align-items: center;
109
+ gap: var(--sizing-3);
110
+ box-sizing: border-box;
111
+ height: var(--height);
112
+
113
+ border-radius: 4px;
114
+ font-family: var(--font);
115
+ font-size: var(--font-size);
116
+ cursor: pointer;
117
+
118
+ background-color: var(--default-bg);
119
+ border: 1px solid var(--default-border);
120
+ color: var(--default-color);
121
+
122
+ -webkit-user-select: none;
123
+ -khtml-user-select: none;
124
+ -moz-user-select: none;
125
+ -o-user-select: none;
126
+ user-select: none;
127
+ }
128
+
129
+ .sa-button:hover {
130
+ background-color: var(--hover-bg);
131
+ border: 1px solid var(--hover-border);
132
+ color: var(--hover-color);
133
+ --svg-icon-color: var(--hover-color);
134
+ }
135
+
136
+ .svg-icon {
137
+ mask-size: contain;
138
+ width: 16px;
139
+ height: 16px;
140
+ background-color: var(--svg-icon-color);
141
+ }
142
+
143
+ .btn-hide {
144
+ display: none;
145
+ }
@@ -0,0 +1,11 @@
1
+ <button (click)="buttonClicked($event)" id="sa-button-{{uuid}}" class="btn-hide"
2
+ [type]="isSubmit ? 'submit' : 'button'"></button>
3
+ <!-- (click)="buttonClicked()" on button instead of label breaks whole thing -->
4
+ <label for="sa-button-{{uuid}}" role="button" tabindex="0" (mouseenter)="mouseIn()" (mouseleave)="mouseOut()"
5
+ (keydown.enter)="buttonClicked($event)" for="sa-button" class="sa-button {{state}} {{type}} {{size}}">
6
+ <div class="svg-icon" [style]="svgStyle"
7
+ [style.display]="(iconPosition == 'left' || iconPosition == 'both') ? 'block' : 'none'"></div>
8
+ {{text}}
9
+ <div class="svg-icon" [style]="svgStyle"
10
+ [style.display]="(iconPosition == 'right' || iconPosition == 'both') ? 'block' : 'none'"></div>
11
+ </label>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ButtonComponent } from './button.component';
4
+
5
+ describe('ButtonComponent', () => {
6
+ let component: ButtonComponent;
7
+ let fixture: ComponentFixture<ButtonComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [ButtonComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ButtonComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,68 @@
1
+ import { Component, Output } from '@angular/core';
2
+ import { Input } from '@angular/core';
3
+ import { EventEmitter } from '@angular/core';
4
+ import { NgIf } from '@angular/common';
5
+ import { NgStyle } from '@angular/common';
6
+
7
+ let nextId = 0; // used to give unique ids to inputs used in html
8
+
9
+ @Component({
10
+ selector: 'sa-button',
11
+ standalone: true,
12
+ imports: [NgIf, NgStyle],
13
+ templateUrl: './button.component.html',
14
+ styleUrl: './button.component.css'
15
+ })
16
+
17
+ export class ButtonComponent {
18
+ @Input() id: string | number;
19
+ @Input() type: string;
20
+ @Input() state: string;
21
+ @Input() size: string;
22
+ @Input() text: string | number;
23
+ @Input() ImagePath: string;
24
+ @Input() iconPosition: string;
25
+ @Input() href: string;
26
+ @Input() hrefTarget: string;
27
+ @Input() isSubmit: boolean = false;
28
+
29
+ @Output() onClickEvent = new EventEmitter();
30
+ @Output() onMouseInEvent = new EventEmitter();
31
+ @Output() onMouseOutEvent = new EventEmitter();
32
+
33
+ svgStyle = {}
34
+ eventEmitObject = {}
35
+ uuid: number = nextId++;
36
+
37
+ ngOnChanges(): void {
38
+ this.svgStyle = {
39
+ '-webkit-mask-image': `url(${this.ImagePath})`,
40
+ 'mask-image': `url(${this.ImagePath})`,
41
+ }
42
+ this.eventEmitObject = {
43
+ id: this.id
44
+ }
45
+ }
46
+
47
+ buttonClicked(evt: Event) {
48
+ if (this.state == "disabled") return;
49
+ this.onClickEvent.emit({
50
+ ...this.eventEmitObject,
51
+ evt
52
+ });
53
+ if (this.href != "") {
54
+ if (this.hrefTarget == "blank") window.open(this.href);
55
+ else if (this.hrefTarget == "self") location.href = this.href;
56
+ }
57
+ }
58
+
59
+ mouseIn() {
60
+ if (this.state == "disabled") return;
61
+ this.onMouseInEvent.emit();
62
+ }
63
+
64
+ mouseOut() {
65
+ if (this.state == "disabled") return;
66
+ this.onMouseOutEvent.emit();
67
+ }
68
+ }
@@ -0,0 +1,67 @@
1
+ .header {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ border-bottom: 1px solid var(--grey-50);
6
+ margin-top: -4px;
7
+ margin-bottom: var(--small-8px, 8px);
8
+ }
9
+
10
+ .header-label {
11
+ font-family: Roboto;
12
+ font-size: 14px;
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ line-height: 20px;
16
+ letter-spacing: 0.25px;
17
+ }
18
+
19
+ .range-preset {
20
+ width: 180px;
21
+ position: absolute;
22
+
23
+ padding: var(--small-12px, 12px) 0 0 var(--medium-24px, 24px);
24
+ box-sizing: border-box;
25
+
26
+
27
+ margin-top: -9px;
28
+ margin-left: -180px;
29
+
30
+ height: 356px;
31
+ background-color: white;
32
+ border-top: 1px solid var(--grey-50);
33
+ border-left: 1px solid var(--grey-50);
34
+ border-bottom: 1px solid var(--grey-50);
35
+ border-bottom-left-radius: var(--small-8px, 8px);
36
+ border-top-left-radius: var(--small-8px, 8px);
37
+
38
+ gap: var(--small-8px, 8px);
39
+
40
+ display: flex;
41
+ flex-direction: column;
42
+ }
43
+
44
+ .preset {
45
+ padding: var(--small-8px, 8px);
46
+ display: flex;
47
+ gap: var(--small-4px, 4px);
48
+ font-size: 14px;
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ line-height: 20px;
52
+ letter-spacing: 0.25px;
53
+ color: var(--text-mediumemphasis);
54
+ margin-bottom: -5px;
55
+ }
56
+
57
+ .preset-radio {
58
+ cursor: pointer;
59
+ }
60
+
61
+ .preset-label {
62
+ cursor: pointer;
63
+ }
64
+
65
+ .preset-selected {
66
+ color: var(--primary-500);
67
+ }
@@ -0,0 +1,20 @@
1
+ <div class="range-preset">
2
+ <div class="preset" *ngFor="let preset of presets, let i = index">
3
+ <label class="preset-label {{preset == selectedPreset ? 'preset-selected' : ''}}"
4
+ for="preset-radio-{{i}}">{{preset}}</label>
5
+ <input class="preset-radio" (change)="presetChanged($event)" [checked]="preset == selectedPreset"
6
+ id="preset-radio-{{i}}" type="radio" name="preset-radios-{{uuid}}" value="{{preset}}">
7
+ </div>
8
+ </div>
9
+
10
+ <div class="header">
11
+ <button mat-icon-button (click)="previousClicked('month')">
12
+ <mat-icon>keyboard_arrow_left</mat-icon>
13
+ </button>
14
+
15
+ <button mat-button class="header-label" (click)="changeView()">{{ periodLabel }}</button>
16
+
17
+ <button mat-icon-button (click)="nextClicked('month')">
18
+ <mat-icon>keyboard_arrow_right</mat-icon>
19
+ </button>
20
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CalendarHeaderComponent } from './calendar-header.component';
4
+
5
+ describe('CalendarHeaderComponent', () => {
6
+ let component: CalendarHeaderComponent;
7
+ let fixture: ComponentFixture<CalendarHeaderComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [CalendarHeaderComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CalendarHeaderComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });