@sarasanalytics-com/design-system 0.0.3 → 0.0.5

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 (181) hide show
  1. package/README.md +9 -12
  2. package/esm2022/interfaces/avatar-interface.mjs +2 -0
  3. package/esm2022/interfaces/button-interface.mjs +2 -0
  4. package/esm2022/interfaces/chip-interface.mjs +2 -0
  5. package/esm2022/interfaces/grid-interface.mjs +2 -0
  6. package/esm2022/interfaces/select-interface.mjs +2 -0
  7. package/esm2022/interfaces/tab-interface.mjs +2 -0
  8. package/esm2022/lib/avatar/avatar.component.mjs +56 -0
  9. package/esm2022/lib/button/button.component.mjs +84 -0
  10. package/esm2022/lib/calendar-header/calendar-header.component.mjs +168 -0
  11. package/esm2022/lib/chips/chips.component.mjs +62 -0
  12. package/esm2022/lib/component-library.component.mjs +19 -0
  13. package/esm2022/lib/component-library.service.mjs +14 -0
  14. package/esm2022/lib/datepicker/datepicker.component.mjs +39 -0
  15. package/esm2022/lib/form-select/form-select.component.mjs +59 -0
  16. package/esm2022/lib/grid-cell/grid-cell.component.mjs +84 -0
  17. package/esm2022/lib/header/header.component.mjs +37 -0
  18. package/esm2022/lib/stepper/stepper.component.mjs +64 -0
  19. package/esm2022/lib/tabs/tabs.component.mjs +38 -0
  20. package/esm2022/lib/toast/toast.component.mjs +54 -0
  21. package/esm2022/lib/tool-tip/tool-tip.component.mjs +41 -0
  22. package/esm2022/public-api.mjs +23 -0
  23. package/esm2022/sarasanalytics-com-design-system.mjs +5 -0
  24. package/fesm2022/sarasanalytics-com-design-system.mjs +759 -0
  25. package/fesm2022/sarasanalytics-com-design-system.mjs.map +1 -0
  26. package/index.d.ts +5 -0
  27. package/interfaces/avatar-interface.d.ts +6 -0
  28. package/interfaces/button-interface.d.ts +12 -0
  29. package/interfaces/chip-interface.d.ts +11 -0
  30. package/interfaces/grid-interface.d.ts +24 -0
  31. package/interfaces/select-interface.d.ts +19 -0
  32. package/interfaces/tab-interface.d.ts +6 -0
  33. package/lib/avatar/avatar.component.d.ts +18 -0
  34. package/lib/button/button.component.d.ts +26 -0
  35. package/lib/calendar-header/calendar-header.component.d.ts +31 -0
  36. package/lib/chips/chips.component.d.ts +22 -0
  37. package/lib/component-library.component.d.ts +5 -0
  38. package/lib/component-library.service.d.ts +6 -0
  39. package/lib/datepicker/datepicker.component.d.ts +9 -0
  40. package/lib/form-select/form-select.component.d.ts +17 -0
  41. package/lib/grid-cell/grid-cell.component.d.ts +20 -0
  42. package/lib/header/header.component.d.ts +14 -0
  43. package/lib/stepper/stepper.component.d.ts +17 -0
  44. package/lib/tabs/tabs.component.d.ts +15 -0
  45. package/lib/toast/toast.component.d.ts +18 -0
  46. package/lib/tool-tip/tool-tip.component.d.ts +15 -0
  47. package/package.json +19 -68
  48. package/{projects/component-library/src/public-api.ts → public-api.d.ts} +1 -7
  49. package/.editorconfig +0 -16
  50. package/.eslintrc.json +0 -22
  51. package/.storybook/main.ts +0 -21
  52. package/.storybook/manager.ts +0 -17
  53. package/.storybook/preview-head.html +0 -5
  54. package/.storybook/preview.ts +0 -65
  55. package/.storybook/tsconfig.doc.json +0 -10
  56. package/.storybook/tsconfig.json +0 -11
  57. package/.storybook/typings.d.ts +0 -4
  58. package/.vscode/extensions.json +0 -7
  59. package/.vscode/launch.json +0 -20
  60. package/.vscode/settings.json +0 -13
  61. package/.vscode/tasks.json +0 -42
  62. package/angular.json +0 -189
  63. package/build-storybook.log +0 -39
  64. package/documentation.json +0 -0
  65. package/projects/component-library/README.md +0 -24
  66. package/projects/component-library/ng-package.json +0 -8
  67. package/projects/component-library/package.json +0 -12
  68. package/projects/component-library/src/interfaces/avatar-interface.ts +0 -6
  69. package/projects/component-library/src/interfaces/button-interface.ts +0 -12
  70. package/projects/component-library/src/interfaces/chip-interface.ts +0 -11
  71. package/projects/component-library/src/interfaces/grid-interface.ts +0 -24
  72. package/projects/component-library/src/interfaces/select-interface.ts +0 -19
  73. package/projects/component-library/src/interfaces/tab-interface.ts +0 -6
  74. package/projects/component-library/src/lib/avatar/avatar.component.css +0 -48
  75. package/projects/component-library/src/lib/avatar/avatar.component.html +0 -5
  76. package/projects/component-library/src/lib/avatar/avatar.component.spec.ts +0 -23
  77. package/projects/component-library/src/lib/avatar/avatar.component.ts +0 -50
  78. package/projects/component-library/src/lib/button/button.component.css +0 -145
  79. package/projects/component-library/src/lib/button/button.component.html +0 -11
  80. package/projects/component-library/src/lib/button/button.component.spec.ts +0 -23
  81. package/projects/component-library/src/lib/button/button.component.ts +0 -68
  82. package/projects/component-library/src/lib/calendar-header/calendar-header.component.css +0 -67
  83. package/projects/component-library/src/lib/calendar-header/calendar-header.component.html +0 -20
  84. package/projects/component-library/src/lib/calendar-header/calendar-header.component.spec.ts +0 -23
  85. package/projects/component-library/src/lib/calendar-header/calendar-header.component.ts +0 -196
  86. package/projects/component-library/src/lib/chips/chips.component.css +0 -129
  87. package/projects/component-library/src/lib/chips/chips.component.html +0 -17
  88. package/projects/component-library/src/lib/chips/chips.component.spec.ts +0 -23
  89. package/projects/component-library/src/lib/chips/chips.component.ts +0 -55
  90. package/projects/component-library/src/lib/component-library.component.spec.ts +0 -23
  91. package/projects/component-library/src/lib/component-library.component.ts +0 -16
  92. package/projects/component-library/src/lib/component-library.service.spec.ts +0 -16
  93. package/projects/component-library/src/lib/component-library.service.ts +0 -9
  94. package/projects/component-library/src/lib/datepicker/datepicker.component.css +0 -33
  95. package/projects/component-library/src/lib/datepicker/datepicker.component.html +0 -11
  96. package/projects/component-library/src/lib/datepicker/datepicker.component.spec.ts +0 -23
  97. package/projects/component-library/src/lib/datepicker/datepicker.component.ts +0 -37
  98. package/projects/component-library/src/lib/form-select/form-select.component.css +0 -156
  99. package/projects/component-library/src/lib/form-select/form-select.component.html +0 -38
  100. package/projects/component-library/src/lib/form-select/form-select.component.spec.ts +0 -23
  101. package/projects/component-library/src/lib/form-select/form-select.component.ts +0 -54
  102. package/projects/component-library/src/lib/grid-cell/grid-cell.component.css +0 -78
  103. package/projects/component-library/src/lib/grid-cell/grid-cell.component.html +0 -31
  104. package/projects/component-library/src/lib/grid-cell/grid-cell.component.spec.ts +0 -23
  105. package/projects/component-library/src/lib/grid-cell/grid-cell.component.ts +0 -89
  106. package/projects/component-library/src/lib/header/header.component.css +0 -62
  107. package/projects/component-library/src/lib/header/header.component.html +0 -23
  108. package/projects/component-library/src/lib/header/header.component.spec.ts +0 -23
  109. package/projects/component-library/src/lib/header/header.component.ts +0 -28
  110. package/projects/component-library/src/lib/stepper/stepper.component.css +0 -96
  111. package/projects/component-library/src/lib/stepper/stepper.component.html +0 -14
  112. package/projects/component-library/src/lib/stepper/stepper.component.spec.ts +0 -23
  113. package/projects/component-library/src/lib/stepper/stepper.component.ts +0 -61
  114. package/projects/component-library/src/lib/tabs/tabs.component.css +0 -100
  115. package/projects/component-library/src/lib/tabs/tabs.component.html +0 -16
  116. package/projects/component-library/src/lib/tabs/tabs.component.spec.ts +0 -23
  117. package/projects/component-library/src/lib/tabs/tabs.component.ts +0 -37
  118. package/projects/component-library/src/lib/toast/toast.component.css +0 -108
  119. package/projects/component-library/src/lib/toast/toast.component.html +0 -25
  120. package/projects/component-library/src/lib/toast/toast.component.spec.ts +0 -23
  121. package/projects/component-library/src/lib/toast/toast.component.ts +0 -37
  122. package/projects/component-library/src/lib/tool-tip/tool-tip.component.css +0 -139
  123. package/projects/component-library/src/lib/tool-tip/tool-tip.component.html +0 -31
  124. package/projects/component-library/src/lib/tool-tip/tool-tip.component.spec.ts +0 -23
  125. package/projects/component-library/src/lib/tool-tip/tool-tip.component.ts +0 -37
  126. package/projects/component-library/tsconfig.lib.json +0 -14
  127. package/projects/component-library/tsconfig.lib.prod.json +0 -10
  128. package/projects/component-library/tsconfig.spec.json +0 -14
  129. package/src/Saras-logo.svg +0 -15
  130. package/src/app/app.component.css +0 -13
  131. package/src/app/app.component.html +0 -77
  132. package/src/app/app.component.spec.ts +0 -29
  133. package/src/app/app.component.ts +0 -505
  134. package/src/app/app.config.ts +0 -27
  135. package/src/app/app.routes.ts +0 -3
  136. package/src/app/data.ts +0 -52
  137. package/src/app/kitchen-sink/kitchen-sink.component.css +0 -29
  138. package/src/app/kitchen-sink/kitchen-sink.component.html +0 -7
  139. package/src/app/kitchen-sink/kitchen-sink.component.spec.ts +0 -23
  140. package/src/app/kitchen-sink/kitchen-sink.component.ts +0 -92
  141. package/src/assets/.gitkeep +0 -0
  142. package/src/assets/Chevron.svg +0 -5
  143. package/src/assets/Frame.svg +0 -5
  144. package/src/assets/Grid.svg +0 -5
  145. package/src/assets/Location.svg +0 -5
  146. package/src/assets/Mail.svg +0 -5
  147. package/src/assets/Person.svg +0 -5
  148. package/src/assets/Scan.svg +0 -5
  149. package/src/assets/Sources.svg +0 -5
  150. package/src/assets/arrow.svg +0 -5
  151. package/src/assets/avatar.svg +0 -12
  152. package/src/assets/checkmark.svg +0 -5
  153. package/src/assets/crossmark.svg +0 -5
  154. package/src/assets/dot.svg +0 -5
  155. package/src/assets/negativemark.svg +0 -5
  156. package/src/assets/pointer-polygon.svg +0 -3
  157. package/src/assets/tick-icon.svg +0 -5
  158. package/src/assets/tick.svg +0 -8
  159. package/src/assets/warningmark.svg +0 -5
  160. package/src/custom-theme.scss +0 -37
  161. package/src/favicon.ico +0 -0
  162. package/src/index.html +0 -23
  163. package/src/main.ts +0 -6
  164. package/src/stories/GettingStarted.mdx +0 -233
  165. package/src/stories/KitchenSink.stories.ts +0 -86
  166. package/src/stories/avatar.stories.ts +0 -45
  167. package/src/stories/chips.stories.ts +0 -61
  168. package/src/stories/custom-button.stories.ts +0 -74
  169. package/src/stories/datepicker.stories.ts +0 -78
  170. package/src/stories/gridCell.stories.ts +0 -234
  171. package/src/stories/header.stories.ts +0 -61
  172. package/src/stories/selectInput.stories.ts +0 -158
  173. package/src/stories/stepper.stories.ts +0 -92
  174. package/src/stories/tabs.stories.ts +0 -97
  175. package/src/stories/toast.stories.ts +0 -54
  176. package/src/stories/tool-tip.stories.ts +0 -45
  177. package/src/styles.css +0 -204
  178. package/src/svg.d.ts +0 -1
  179. package/tsconfig.app.json +0 -14
  180. package/tsconfig.json +0 -42
  181. package/tsconfig.spec.json +0 -14
@@ -1,96 +0,0 @@
1
- .stepper {
2
- display: flex;
3
- width: max-content;
4
- justify-content: center;
5
- align-items: center;
6
- font-family: var(--font);
7
- }
8
-
9
- .active {
10
- --main-bg: var(--primary-500);
11
- --main-line: var(--primary-500);
12
- }
13
-
14
- .disabled {
15
- --main-bg: var(--grey-100);
16
- --main-line: var(--grey-50);
17
- }
18
-
19
- .done {
20
- --bg-line: var(--main-line);
21
- --bg: var(--main-bg);
22
- --border: none;
23
- }
24
-
25
- .default {
26
- --bg-line: var(--grey-50);
27
- --bg: var(--grey-100);
28
- --border: 4px solid white;
29
- }
30
-
31
- .latest {
32
- --bg: white;
33
- --border: 4px solid var(--main-bg);
34
- }
35
-
36
- .steps {
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- position: relative;
41
- }
42
-
43
- .line {
44
- width: 140px;
45
- height: 2px;
46
- background-color: var(--bg-line);
47
- transition: 0.25s;
48
- }
49
-
50
- .label-wrapper {
51
- width: 16px;
52
- height: 16px;
53
- height: fit-content;
54
- border-radius: 16px;
55
- background-color: var(--bg);
56
- display: flex;
57
- justify-content: center;
58
- }
59
-
60
- .step-label-icon {
61
- display: flex;
62
- justify-content: center;
63
- width: 16px;
64
- height: 16px;
65
- border-radius: 16px;
66
-
67
- mask-size: contain;
68
- mask-position: center;
69
-
70
- background-position: center;
71
- background-color: white;
72
- border: var(--border);
73
- box-sizing: border-box;
74
-
75
- font-size: 14px;
76
- font-style: normal;
77
- font-weight: 400;
78
- line-height: 20px;
79
- letter-spacing: 0.25px;
80
- cursor: pointer;
81
- }
82
-
83
- .undone {
84
- background-color: var(--grey-100);
85
- }
86
-
87
- .step-label-text {
88
- color: var(--text-mediumemphasis, #697079);
89
- position: absolute;
90
- top: 20px;
91
- cursor: pointer;
92
- }
93
-
94
- .step-hide {
95
- display: none;
96
- }
@@ -1,14 +0,0 @@
1
- <div class="stepper {{isDisabled ? 'disabled' : 'active'}}">
2
- <div class="steps" *ngFor="let label of stepLabels; let i = index">
3
- <input id="stepper-{{uuid}}-{{i}}" (change)="update(i)" name="stepper-radio-{{uuid}}"
4
- [checked]="i == latestStep ? true: false" class="step-hide" type="radio">
5
- <div
6
- class="label-wrapper {{i < latestStep ? 'done' : ''}} {{i > latestStep ? 'default' : ''}} {{i == latestStep ? 'latest' : ''}}">
7
- <label [style]="i < latestStep ? tickIcon : ''" for="stepper-{{uuid}}-{{i}}"
8
- class="step-label-icon {{i > latestStep ? 'undone' : ''}}">
9
- </label>
10
- <label for="stepper-{{uuid}}-{{i}}" class="step-label-text">{{label.name}}</label>
11
- </div>
12
- <div *ngIf=" i !=stepLabels.length-1" class="line {{i < latestStep ? 'done' : 'default'}}"></div>
13
- </div>
14
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { StepperComponent } from './stepper.component';
4
-
5
- describe('StepperComponent', () => {
6
- let component: StepperComponent;
7
- let fixture: ComponentFixture<StepperComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [StepperComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(StepperComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,61 +0,0 @@
1
- import { Component, EventEmitter, Input } from '@angular/core';
2
- import { FieldType, FieldTypeConfig } from '@ngx-formly/core';
3
- import { NgFor, NgIf } from '@angular/common';
4
- import { Output } from '@angular/core';
5
-
6
- let nextId = 0; // used to give unique ids to inputs used in html
7
-
8
- @Component({
9
- selector: 'sa-stepper',
10
- standalone: true,
11
- imports: [NgFor, NgIf],
12
- templateUrl: './stepper.component.html',
13
- styleUrl: './stepper.component.css'
14
- })
15
- export class StepperComponent extends FieldType<FieldTypeConfig> {
16
- @Input() latestStep: number = -1;
17
- @Input() editable: boolean = true;
18
- @Input() stepLabels: any;
19
- @Input() doneIcon: string;
20
-
21
- @Output() stepped = new EventEmitter;
22
-
23
- uuid: number = nextId++;
24
-
25
- isDisabled: boolean = false;
26
-
27
- tickIcon = {};
28
-
29
- // {
30
- // '-webkit-mask-image': `url(${this.ImagePath})`,
31
- // 'mask-image': `url(${this.ImagePath})`,
32
- // }
33
-
34
- ngOnInit() {
35
- if (this.field.props) {
36
- this.stepLabels = this.field.props.options;
37
- this.editable = this.field.props['params'].editable;
38
- this.latestStep = this.model[`${this.key}`] ? this.model[`${this.key}`].id : -1;
39
- this.doneIcon = this.field.props['params'].doneIcon;
40
-
41
- this.isDisabled = this.field.props.disabled!;
42
- }
43
- console.log(this.doneIcon);
44
- this.tickIcon = {
45
- '-webkit-mask-image': `url(${this.doneIcon})`,
46
- 'mask-image': `url(${this.doneIcon})`
47
- };
48
- }
49
-
50
- update(chosen: number) {
51
- if (!this.editable || this.field.props?.disabled) return;
52
- this.latestStep = chosen;
53
- if (!this.formControl) {
54
- this.stepped.emit(this.latestStep);
55
- return;
56
- }
57
- this.formControl.setValue({
58
- id: this.latestStep
59
- });
60
- }
61
- }
@@ -1,100 +0,0 @@
1
- .box {
2
- --bg: var(--grey-50);
3
- --tab-bg: white;
4
- --border: none;
5
- --tab-border: none;
6
- --tab-border-radius: 2px;
7
- --icon-color: var(--text-mediumemphasis);
8
- }
9
-
10
- .inline {
11
- --bg: white;
12
- --tab-bg: white;
13
- --border: 1px solid var(--grey-50, #E9EAEB);
14
- --tab-border: var(--primary-500, #1B77E4);
15
- --tab-border-radius: none;
16
- --icon-color: var(--text-mediumemphasis);
17
- }
18
-
19
- .tab-wrapper {
20
- width: max-content;
21
- padding: var(--small-8px, 8px);
22
- background-color: var(--bg);
23
- border-radius: var(--Small-4px, 4px);
24
- }
25
-
26
- .tabs {
27
- display: flex;
28
- height: 42px;
29
- gap: var(--small-8px, 8px);
30
- font-family: var(--font);
31
- border-bottom: var(--border);
32
- }
33
-
34
- .tab-item {
35
- display: flex;
36
- justify-content: center;
37
- align-items: center;
38
- gap: var(--small-8px, 8px);
39
- }
40
-
41
- .tab-label {
42
- display: flex;
43
- justify-content: center;
44
- align-items: center;
45
- gap: var(--small-4px, 4px);
46
- padding: var(--small-8px, 8px) var(--small-12px, 12px);
47
- border-bottom: none;
48
- transition: 0.1s;
49
-
50
- font-size: 14px;
51
- font-style: normal;
52
- font-weight: 500;
53
- line-height: 20px;
54
- letter-spacing: 0.1px;
55
- color: var(--text-mediumemphasis);
56
- cursor: pointer;
57
- }
58
-
59
- .tab-checks {
60
- display: none;
61
- }
62
-
63
- .tab-checks:checked+label {
64
- background-color: var(--tab-bg);
65
- border-bottom: 2px solid var(--tab-border);
66
- border-radius: var(--tab-border-radius);
67
- color: var(--primary-500);
68
- --icon-color: var(--primary-500)
69
- }
70
-
71
- .tab-checks:checked+label .badge {
72
- width: auto;
73
- height: auto;
74
- padding: var(--Small-4px, 4px) var(--Small-12px, 12px);
75
- border-radius: 16px;
76
- font-size: 12px;
77
- font-style: normal;
78
- font-weight: 500;
79
- line-height: 16px;
80
- letter-spacing: 0.5px;
81
- }
82
-
83
- .badge {
84
- width: var(--small-8px);
85
- height: var(--small-8px);
86
- border-radius: var(--small-8px);
87
- background-color: var(--secondary-500, #FE8235);
88
- color: white;
89
- margin-left: var(--small-4px);
90
- overflow: hidden;
91
- transition: 0.25s;
92
- font-size: 0;
93
- }
94
-
95
- .svg-icon {
96
- height: 16px;
97
- width: 16px;
98
- mask-size: contain;
99
- background-color: var(--icon-color);
100
- }
@@ -1,16 +0,0 @@
1
- <div class="tab-wrapper {{type}}">
2
- <div class="tabs">
3
- <div *ngFor="let item of tabs, let i = index" class="tab-item">
4
- <input [checked]="(defaultTab == i) ? true : false" [value]="i" (change)="tabChange($event)"
5
- id="tab-check-{{i}}-{{uuid}}" class="tab-checks" type="radio" name="tab-checkbox-{{uuid}}">
6
- <label for="tab-check-{{i}}-{{uuid}}" class="tab-label">
7
- <div *ngIf="item.iconPosition == 'left' || item.iconPosition == 'both'" class="svg-icon" [style]="svgStyle[i]">
8
- </div>
9
- {{item.tabName}}
10
- <div *ngIf="item.iconPosition == 'right' || item.iconPosition == 'both'" class="svg-icon" [style]="svgStyle[i]">
11
- </div>
12
- <div class="badge" *ngIf="item.badgeContent">{{item.badgeContent}}</div>
13
- </label>
14
- </div>
15
- </div>
16
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { TabsComponent } from './tabs.component';
4
-
5
- describe('TabsComponent', () => {
6
- let component: TabsComponent;
7
- let fixture: ComponentFixture<TabsComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [TabsComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(TabsComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,37 +0,0 @@
1
- import { Component, EventEmitter, Input, Output } from '@angular/core';
2
- import { TabInterface } from '../../interfaces/tab-interface';
3
- import { NgFor } from '@angular/common';
4
- import { NgIf } from '@angular/common';
5
-
6
-
7
- let nextId = 0; // used to give unique ids to inputs used in html
8
- @Component({
9
- selector: 'sa-tabs',
10
- standalone: true,
11
- imports: [NgFor, NgIf],
12
- templateUrl: './tabs.component.html',
13
- styleUrl: './tabs.component.css'
14
- })
15
- export class TabsComponent {
16
- @Input() tabs: TabInterface[];
17
- @Input() type: string;
18
- @Input() defaultTab: number;
19
-
20
- @Output() tabChanged = new EventEmitter();
21
-
22
-
23
- uuid: number = nextId++;
24
- svgStyle: any = [];
25
-
26
- ngOnChanges(): void {
27
- this.svgStyle = this.tabs.map((item) => {
28
- return {
29
- '-webkit-mask-image': `url(${item.tabIcon})`,
30
- 'mask-image': `url(${item.tabIcon})`,
31
- }
32
- })
33
- }
34
- tabChange(evt: any) {
35
- this.tabChanged.emit(evt.target.value)
36
- }
37
- }
@@ -1,108 +0,0 @@
1
- .toast {
2
- display: flex;
3
- width: max-content;
4
- flex-direction: column;
5
- justify-content: center;
6
- align-items: center;
7
- padding: var(--small-16px, 16px);
8
- gap: var(--small-16px, 16px);
9
- border-radius: var(--small-8px, 8px);
10
- border: 1px solid var(--grey-50, #E9EAEB);
11
- background: var(--structural-white, #FFF);
12
- box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.05);
13
- font-family: var(--font);
14
- }
15
-
16
- .cross {
17
- cursor: pointer;
18
- }
19
-
20
- .heading {
21
- width: 359px;
22
- font-size: 16px;
23
- font-style: normal;
24
- font-weight: 600;
25
- line-height: 24px;
26
- letter-spacing: 0.15px;
27
- color: var(--text-highemphasis, #1B1D20);
28
- }
29
-
30
- .toast-icon {
31
- display: flex;
32
- justify-content: center;
33
- border-radius: 50%;
34
- }
35
-
36
- .positive {
37
- box-shadow: 0 0 0 var(--small-4px, 4px) var(--semantic-success-50);
38
- background-color: var(--semantic-success-50);
39
- }
40
-
41
- .negative {
42
- box-shadow: 0 0 0 var(--small-4px, 4px) var(--semantic-error-50);
43
- background-color: var(--semantic-error-50);
44
- }
45
-
46
- .tentative {
47
- box-shadow: 0 0 0 var(--small-4px, 4px) var(--semantic-yellow-50);
48
- background-color: var(--semantic-yellow-50);
49
- }
50
-
51
- .toast-icon img {
52
- width: 24px;
53
- height: 24px;
54
- }
55
-
56
- .subheading {
57
- font-size: 16px;
58
- font-style: normal;
59
- font-weight: 400;
60
- line-height: 24px;
61
- letter-spacing: 0.5px;
62
- color: var(--text-mediumemphasis, #697079);
63
- }
64
-
65
- .heading,
66
- .subheading {
67
- margin: 0;
68
- }
69
-
70
- .content {
71
- display: flex;
72
- justify-content: center;
73
- align-items: flex-start;
74
- gap: var(--small-12px, 12px);
75
- }
76
-
77
- .head-subhead {
78
- justify-content: space-between;
79
- display: flex;
80
- flex-direction: column;
81
- gap: var(--small-4px, 4px);
82
- }
83
-
84
- .controls {
85
- width: 100%;
86
- display: flex;
87
- justify-content: flex-end;
88
- align-items: center;
89
- gap: var(--small-12px, 12px);
90
- }
91
-
92
- .progress-bar {
93
- display: flex;
94
- width: 100%;
95
- }
96
-
97
- .progress-done {
98
- height: 3px;
99
- background-color: var(--primary-500);
100
- border-radius: 2px;
101
- }
102
-
103
- .progress-left {
104
- height: 3px;
105
- background-color: #C5C5C5;
106
- border-top-right-radius: 2px;
107
- border-bottom-right-radius: 2px;
108
- }
@@ -1,25 +0,0 @@
1
- <div class="toast">
2
- <div class="content">
3
- <div class="toast-icon {{status}}">
4
- <img [src]="statusIcon" alt="">
5
- </div>
6
- <div class="head-subhead">
7
- <p class="heading">{{heading}}</p>
8
- <p class="subheading">{{subHeading}}</p>
9
- </div>
10
- <!-- <img class="cross" (click)="clicked(2)" [src]="crossmark" alt=""> -->
11
- <mat-icon class="cross" (click)="clicked(2)">close</mat-icon>
12
- </div>
13
- <div class="controls">
14
- <sa-button *ngIf="firstButtonName" (onClickEvent)="clicked(0)" [text]="firstButtonName" type="transparent"
15
- size="medium" state="default">
16
- </sa-button>
17
- <sa-button *ngIf="secondButtonName" (onClickEvent)="clicked(1)" [text]="secondButtonName" type="outline"
18
- size="medium" state="default">
19
- </sa-button>
20
- </div>
21
- <div *ngIf="finishPercentage >= 0" class="progress-bar">
22
- <div class="progress-done" [style.width]="finishPercentage+'%'"></div>
23
- <div class="progress-left" [style.width]="100-finishPercentage+'%'"></div>
24
- </div>
25
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { ToastComponent } from './toast.component';
4
-
5
- describe('ToastComponent', () => {
6
- let component: ToastComponent;
7
- let fixture: ComponentFixture<ToastComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [ToastComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(ToastComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,37 +0,0 @@
1
- import { Component, EventEmitter, OnChanges } from '@angular/core';
2
- import { ButtonComponent } from '../button/button.component';
3
- import { Input } from '@angular/core';
4
- import { Output } from '@angular/core';
5
- import { MatIcon } from '@angular/material/icon';
6
- import { NgIf } from '@angular/common';
7
-
8
- @Component({
9
- selector: 'sa-toast',
10
- standalone: true,
11
- imports: [ButtonComponent, MatIcon, NgIf],
12
- templateUrl: './toast.component.html',
13
- styleUrl: './toast.component.css'
14
- })
15
- export class ToastComponent implements OnChanges {
16
- @Input() finishPercentage: number = -1;
17
- @Input() heading: string;
18
- @Input() subHeading: string;
19
- @Input() statusIcon: string;
20
- @Input() status: string;
21
- @Input() firstButtonName: string;
22
- @Input() secondButtonName: string;
23
-
24
- @Output() firstButton = new EventEmitter();
25
- @Output() secondButton = new EventEmitter();
26
- @Output() closed = new EventEmitter();
27
-
28
- ngOnChanges() {
29
- if (this.finishPercentage > 100) this.finishPercentage = 100;
30
- }
31
-
32
- clicked(num: number) {
33
- if (num == 0) this.firstButton.emit();
34
- else if (num == 1) this.secondButton.emit();
35
- else if (num == 2) this.closed.emit();
36
- }
37
- }