@tacdaed/fragments 1.0.0-beta.2 → 1.0.0-beta.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 (248) hide show
  1. package/README.md +3 -3
  2. package/fesm2022/tacdaed-fragments.mjs +8928 -0
  3. package/fesm2022/tacdaed-fragments.mjs.map +1 -0
  4. package/index.d.ts +3929 -0
  5. package/package.json +29 -22
  6. package/ng-package.json +0 -25
  7. package/src/lib/components/accordion/accordion.component.html +0 -103
  8. package/src/lib/components/accordion/accordion.component.scss +0 -382
  9. package/src/lib/components/accordion/accordion.component.spec.ts +0 -147
  10. package/src/lib/components/accordion/accordion.component.ts +0 -211
  11. package/src/lib/components/accordion/accordion.type.ts +0 -82
  12. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -43
  13. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -112
  14. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -33
  15. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -103
  16. package/src/lib/components/breadcrumb/breadcrumb.interface.ts +0 -7
  17. package/src/lib/components/button/button.component.html +0 -57
  18. package/src/lib/components/button/button.component.scss +0 -445
  19. package/src/lib/components/button/button.component.spec.ts +0 -99
  20. package/src/lib/components/button/button.component.ts +0 -143
  21. package/src/lib/components/button/button.type.ts +0 -7
  22. package/src/lib/components/card/card.component.html +0 -44
  23. package/src/lib/components/card/card.component.scss +0 -114
  24. package/src/lib/components/card/card.component.spec.ts +0 -65
  25. package/src/lib/components/card/card.component.ts +0 -21
  26. package/src/lib/components/card/card.type.ts +0 -3
  27. package/src/lib/components/code-block/code-block.component.html +0 -55
  28. package/src/lib/components/code-block/code-block.component.scss +0 -122
  29. package/src/lib/components/code-block/code-block.component.spec.ts +0 -81
  30. package/src/lib/components/code-block/code-block.component.ts +0 -302
  31. package/src/lib/components/code-block/code-block.interface.ts +0 -28
  32. package/src/lib/components/code-block/code-block.type.ts +0 -73
  33. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.html +0 -14
  34. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.scss +0 -20
  35. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.spec.ts +0 -38
  36. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.ts +0 -181
  37. package/src/lib/components/input/input-base.ts +0 -187
  38. package/src/lib/components/input/input-calendar/input-calendar.component.html +0 -76
  39. package/src/lib/components/input/input-calendar/input-calendar.component.scss +0 -179
  40. package/src/lib/components/input/input-calendar/input-calendar.component.spec.ts +0 -44
  41. package/src/lib/components/input/input-calendar/input-calendar.component.ts +0 -299
  42. package/src/lib/components/input/input-checkbox/input-checkbox.component.html +0 -37
  43. package/src/lib/components/input/input-checkbox/input-checkbox.component.scss +0 -128
  44. package/src/lib/components/input/input-checkbox/input-checkbox.component.spec.ts +0 -43
  45. package/src/lib/components/input/input-checkbox/input-checkbox.component.ts +0 -112
  46. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.html +0 -43
  47. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.scss +0 -140
  48. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.spec.ts +0 -62
  49. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.ts +0 -136
  50. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.html +0 -81
  51. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.scss +0 -228
  52. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.spec.ts +0 -62
  53. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.ts +0 -178
  54. package/src/lib/components/input/input-consts.ts +0 -132
  55. package/src/lib/components/input/input-date/input-date-validators.ts +0 -41
  56. package/src/lib/components/input/input-date/input-date.component.html +0 -41
  57. package/src/lib/components/input/input-date/input-date.component.scss +0 -95
  58. package/src/lib/components/input/input-date/input-date.component.spec.ts +0 -43
  59. package/src/lib/components/input/input-date/input-date.component.ts +0 -359
  60. package/src/lib/components/input/input-date-time/input-date-time.component.html +0 -70
  61. package/src/lib/components/input/input-date-time/input-date-time.component.scss +0 -133
  62. package/src/lib/components/input/input-date-time/input-date-time.component.spec.ts +0 -36
  63. package/src/lib/components/input/input-date-time/input-date-time.component.ts +0 -387
  64. package/src/lib/components/input/input-file-upload/input-file-upload.component.html +0 -89
  65. package/src/lib/components/input/input-file-upload/input-file-upload.component.scss +0 -171
  66. package/src/lib/components/input/input-file-upload/input-file-upload.component.spec.ts +0 -43
  67. package/src/lib/components/input/input-file-upload/input-file-upload.component.ts +0 -351
  68. package/src/lib/components/input/input-interface.ts +0 -8
  69. package/src/lib/components/input/input-number/input-number-validators.ts +0 -0
  70. package/src/lib/components/input/input-number/input-number.component.html +0 -51
  71. package/src/lib/components/input/input-number/input-number.component.scss +0 -140
  72. package/src/lib/components/input/input-number/input-number.component.spec.ts +0 -44
  73. package/src/lib/components/input/input-number/input-number.component.ts +0 -343
  74. package/src/lib/components/input/input-radio-group/input-radio-group.component.html +0 -44
  75. package/src/lib/components/input/input-radio-group/input-radio-group.component.scss +0 -139
  76. package/src/lib/components/input/input-radio-group/input-radio-group.component.spec.ts +0 -58
  77. package/src/lib/components/input/input-radio-group/input-radio-group.component.ts +0 -132
  78. package/src/lib/components/input/input-slider/input-slider.component.html +0 -111
  79. package/src/lib/components/input/input-slider/input-slider.component.scss +0 -203
  80. package/src/lib/components/input/input-slider/input-slider.component.spec.ts +0 -46
  81. package/src/lib/components/input/input-slider/input-slider.component.ts +0 -410
  82. package/src/lib/components/input/input-text/input-text-validators.ts +0 -67
  83. package/src/lib/components/input/input-text/input-text.component.html +0 -71
  84. package/src/lib/components/input/input-text/input-text.component.scss +0 -118
  85. package/src/lib/components/input/input-text/input-text.component.spec.ts +0 -55
  86. package/src/lib/components/input/input-text/input-text.component.ts +0 -215
  87. package/src/lib/components/input/input-time/input-time-validators.ts +0 -42
  88. package/src/lib/components/input/input-time/input-time.component.html +0 -92
  89. package/src/lib/components/input/input-time/input-time.component.scss +0 -191
  90. package/src/lib/components/input/input-time/input-time.component.spec.ts +0 -39
  91. package/src/lib/components/input/input-time/input-time.component.ts +0 -691
  92. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.html +0 -36
  93. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.scss +0 -121
  94. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.spec.ts +0 -54
  95. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.ts +0 -117
  96. package/src/lib/components/input/input-type.ts +0 -18
  97. package/src/lib/components/input/input-validation/input-validation.component.html +0 -19
  98. package/src/lib/components/input/input-validation/input-validation.component.scss +0 -39
  99. package/src/lib/components/input/input-validation/input-validation.component.spec.ts +0 -45
  100. package/src/lib/components/input/input-validation/input-validation.component.ts +0 -13
  101. package/src/lib/components/input/input.pipe.ts +0 -14
  102. package/src/lib/components/layout/container/container.component.html +0 -1
  103. package/src/lib/components/layout/container/container.component.scss +0 -33
  104. package/src/lib/components/layout/container/container.component.ts +0 -32
  105. package/src/lib/components/layout/container/container.type.ts +0 -1
  106. package/src/lib/components/layout/divider/divider.component.html +0 -1
  107. package/src/lib/components/layout/divider/divider.component.scss +0 -60
  108. package/src/lib/components/layout/divider/divider.component.ts +0 -38
  109. package/src/lib/components/layout/divider/divider.type.ts +0 -2
  110. package/src/lib/components/layout/section/section.component.html +0 -21
  111. package/src/lib/components/layout/section/section.component.scss +0 -43
  112. package/src/lib/components/layout/section/section.component.ts +0 -33
  113. package/src/lib/components/layout/section/section.type.ts +0 -2
  114. package/src/lib/components/layout/separator/separator.component.html +0 -9
  115. package/src/lib/components/layout/separator/separator.component.scss +0 -52
  116. package/src/lib/components/layout/separator/separator.component.ts +0 -25
  117. package/src/lib/components/layout/separator/separator.type.ts +0 -1
  118. package/src/lib/components/loader/content-blur/content-blur.component.html +0 -13
  119. package/src/lib/components/loader/content-blur/content-blur.component.scss +0 -43
  120. package/src/lib/components/loader/content-blur/content-blur.component.spec.ts +0 -42
  121. package/src/lib/components/loader/content-blur/content-blur.component.ts +0 -34
  122. package/src/lib/components/loader/loader.type.ts +0 -2
  123. package/src/lib/components/loader/progress-bar/progress-bar.component.html +0 -26
  124. package/src/lib/components/loader/progress-bar/progress-bar.component.scss +0 -151
  125. package/src/lib/components/loader/progress-bar/progress-bar.component.spec.ts +0 -47
  126. package/src/lib/components/loader/progress-bar/progress-bar.component.ts +0 -28
  127. package/src/lib/components/loader/progress-bar/progress-bar.type.ts +0 -8
  128. package/src/lib/components/loader/pulse-loader/pulse-loader.component.html +0 -12
  129. package/src/lib/components/loader/pulse-loader/pulse-loader.component.scss +0 -202
  130. package/src/lib/components/loader/pulse-loader/pulse-loader.component.spec.ts +0 -55
  131. package/src/lib/components/loader/pulse-loader/pulse-loader.component.ts +0 -73
  132. package/src/lib/components/loader/pulse-loader/pulse-loader.type.ts +0 -6
  133. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.html +0 -13
  134. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.scss +0 -113
  135. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.spec.ts +0 -37
  136. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.ts +0 -51
  137. package/src/lib/components/loader/skeleton-loader/skeleton-loader.type.ts +0 -6
  138. package/src/lib/components/loader/spinner/spinner.component.html +0 -20
  139. package/src/lib/components/loader/spinner/spinner.component.scss +0 -137
  140. package/src/lib/components/loader/spinner/spinner.component.spec.ts +0 -43
  141. package/src/lib/components/loader/spinner/spinner.component.ts +0 -32
  142. package/src/lib/components/loader/spinner/spinner.type.ts +0 -6
  143. package/src/lib/components/modal/modal.component.html +0 -47
  144. package/src/lib/components/modal/modal.component.scss +0 -139
  145. package/src/lib/components/modal/modal.component.spec.ts +0 -60
  146. package/src/lib/components/modal/modal.component.ts +0 -83
  147. package/src/lib/components/modal/modal.type.ts +0 -9
  148. package/src/lib/components/morph/blob-moph/blob-moprh.component.spec.ts +0 -79
  149. package/src/lib/components/morph/blob-moph/blob-moprh.component.ts +0 -96
  150. package/src/lib/components/morph/blob-moph/blob-morph.component.html +0 -34
  151. package/src/lib/components/morph/blob-moph/blob-morph.component.scss +0 -7
  152. package/src/lib/components/morph/morph.abstract.ts +0 -13
  153. package/src/lib/components/pagination/pagination.interface.ts +0 -4
  154. package/src/lib/components/pagination/small-pagination/small-pagination.component.html +0 -61
  155. package/src/lib/components/pagination/small-pagination/small-pagination.component.scss +0 -187
  156. package/src/lib/components/pagination/small-pagination/small-pagination.component.spec.ts +0 -88
  157. package/src/lib/components/pagination/small-pagination/small-pagination.component.ts +0 -177
  158. package/src/lib/components/selection-lists/multi-select/multi-select.component.html +0 -170
  159. package/src/lib/components/selection-lists/multi-select/multi-select.component.scss +0 -312
  160. package/src/lib/components/selection-lists/multi-select/multi-select.component.spec.ts +0 -61
  161. package/src/lib/components/selection-lists/multi-select/multi-select.component.ts +0 -372
  162. package/src/lib/components/selection-lists/selection-list/selection-list.component.html +0 -125
  163. package/src/lib/components/selection-lists/selection-list/selection-list.component.scss +0 -267
  164. package/src/lib/components/selection-lists/selection-list/selection-list.component.spec.ts +0 -66
  165. package/src/lib/components/selection-lists/selection-list/selection-list.component.ts +0 -315
  166. package/src/lib/components/selection-lists/selection-lists-base.ts +0 -35
  167. package/src/lib/components/selection-lists/selection-lists-const.ts +0 -17
  168. package/src/lib/components/selection-lists/selection-lists-interface.ts +0 -7
  169. package/src/lib/components/selection-lists/selection-lists.type.ts +0 -1
  170. package/src/lib/components/side-nav/side-nav.component.html +0 -101
  171. package/src/lib/components/side-nav/side-nav.component.scss +0 -295
  172. package/src/lib/components/side-nav/side-nav.component.spec.ts +0 -0
  173. package/src/lib/components/side-nav/side-nav.component.ts +0 -18
  174. package/src/lib/components/side-nav/side-nav.type.ts +0 -28
  175. package/src/lib/components/snackbar/snackbar.component.html +0 -33
  176. package/src/lib/components/snackbar/snackbar.component.scss +0 -195
  177. package/src/lib/components/snackbar/snackbar.component.ts +0 -112
  178. package/src/lib/components/snackbar/snackbar.type.ts +0 -27
  179. package/src/lib/components/status/chip/chip.component.html +0 -51
  180. package/src/lib/components/status/chip/chip.component.scss +0 -149
  181. package/src/lib/components/status/chip/chip.component.spec.ts +0 -62
  182. package/src/lib/components/status/chip/chip.component.ts +0 -83
  183. package/src/lib/components/status/chip/chip.type.ts +0 -42
  184. package/src/lib/components/status/directives/badge/badge.directive.spec.ts +0 -60
  185. package/src/lib/components/status/directives/badge/badge.directive.ts +0 -190
  186. package/src/lib/components/status/directives/badge/badge.interface.ts +0 -19
  187. package/src/lib/components/status/pill/pill.component.html +0 -40
  188. package/src/lib/components/status/pill/pill.component.scss +0 -113
  189. package/src/lib/components/status/pill/pill.component.spec.ts +0 -47
  190. package/src/lib/components/status/pill/pill.component.ts +0 -83
  191. package/src/lib/components/status/pill/pill.type.ts +0 -42
  192. package/src/lib/components/status/status.interface.ts +0 -57
  193. package/src/lib/components/status/status.type.ts +0 -62
  194. package/src/lib/components/status/tag/tag.component.html +0 -39
  195. package/src/lib/components/status/tag/tag.component.scss +0 -140
  196. package/src/lib/components/status/tag/tag.component.spec.ts +0 -47
  197. package/src/lib/components/status/tag/tag.component.ts +0 -83
  198. package/src/lib/components/status/tag/tag.type.ts +0 -42
  199. package/src/lib/components/stepper/stepper.component.html +0 -83
  200. package/src/lib/components/stepper/stepper.component.scss +0 -196
  201. package/src/lib/components/stepper/stepper.component.ts +0 -482
  202. package/src/lib/components/stepper/stepper.type.ts +0 -60
  203. package/src/lib/components/table/table.component.html +0 -438
  204. package/src/lib/components/table/table.component.scss +0 -259
  205. package/src/lib/components/table/table.component.spec.ts +0 -117
  206. package/src/lib/components/table/table.component.ts +0 -215
  207. package/src/lib/components/table/table.enum.ts +0 -4
  208. package/src/lib/components/table/table.function.ts +0 -47
  209. package/src/lib/components/table/table.interface.ts +0 -143
  210. package/src/lib/components/table/table.pipe.ts +0 -62
  211. package/src/lib/components/table/table.type.ts +0 -15
  212. package/src/lib/components/tabs/tabs.component.html +0 -88
  213. package/src/lib/components/tabs/tabs.component.scss +0 -305
  214. package/src/lib/components/tabs/tabs.component.spec.ts +0 -94
  215. package/src/lib/components/tabs/tabs.component.ts +0 -282
  216. package/src/lib/components/tabs/tabs.type.ts +0 -81
  217. package/src/lib/components/title-bar/title-bar.component.html +0 -21
  218. package/src/lib/components/title-bar/title-bar.component.scss +0 -139
  219. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -44
  220. package/src/lib/components/title-bar/title-bar.component.ts +0 -13
  221. package/src/lib/components/toast/toast.component.html +0 -36
  222. package/src/lib/components/toast/toast.component.scss +0 -241
  223. package/src/lib/components/toast/toast.component.ts +0 -165
  224. package/src/lib/components/toast/toast.type.ts +0 -37
  225. package/src/lib/components/toast-stack/toast-stack.component.html +0 -30
  226. package/src/lib/components/toast-stack/toast-stack.component.scss +0 -35
  227. package/src/lib/components/toast-stack/toast-stack.component.ts +0 -51
  228. package/src/lib/consts/country-prefix.ts +0 -244
  229. package/src/lib/directives/tooltip/popover.directive.ts +0 -274
  230. package/src/lib/directives/tooltip/tooltip.directive.spec.ts +0 -86
  231. package/src/lib/directives/tooltip/tooltip.directive.ts +0 -234
  232. package/src/lib/directives/tooltip/tooltip.interface.ts +0 -29
  233. package/src/lib/directives/tooltip/tooltip.type.ts +0 -9
  234. package/src/lib/interfaces/common.interfaces.ts +0 -4
  235. package/src/lib/pipes/chunk.pipe.ts +0 -16
  236. package/src/lib/pipes/safe-html.pipe.ts +0 -14
  237. package/src/lib/pipes/sanitize-html.pipe.ts +0 -23
  238. package/src/lib/types/base.types.ts +0 -23
  239. package/src/lib/types/common.types.ts +0 -98
  240. package/src/lib/types/form.types.ts +0 -5
  241. package/src/lib/utils/common.utils.ts +0 -53
  242. package/src/lib/utils/date.utils.ts +0 -474
  243. package/src/lib/utils/number.utils.ts +0 -16
  244. package/src/lib/utils/uuid.utils.ts +0 -39
  245. package/src/public-api.ts +0 -114
  246. package/tsconfig.lib.json +0 -17
  247. package/tsconfig.lib.prod.json +0 -10
  248. package/tsconfig.spec.json +0 -9
@@ -1,112 +0,0 @@
1
- import { NgClass } from '@angular/common';
2
- import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges } from '@angular/core';
3
- import { SnackbarCloseEvent, TSnackbarCloseReason, TSnackbarPosition, TSnackbarSize, TSnackbarStyle } from './snackbar.type';
4
-
5
- @Component({
6
- selector: 'frg-snackbar',
7
- imports: [NgClass],
8
- templateUrl: './snackbar.component.html',
9
- styleUrl: './snackbar.component.scss'
10
- })
11
- export class SnackbarComponent implements OnChanges, OnDestroy {
12
- @Input() open: boolean = false;
13
- @Input() message: string = '';
14
- @Input() actionLabel: string = '';
15
- @Input() styleType: TSnackbarStyle = 'default';
16
- @Input() position: TSnackbarPosition = 'bottom-center';
17
- @Input() size: TSnackbarSize = 'medium';
18
- @Input() autoClose: boolean = true;
19
- @Input() duration: number = 4000;
20
- @Input() hasCloseButton: boolean = false;
21
- @Input() ariaLabel: string = 'Notification';
22
-
23
- @Output() closed = new EventEmitter<SnackbarCloseEvent>();
24
- @Output() action = new EventEmitter<void>();
25
-
26
- private closeTimerId: ReturnType<typeof setTimeout> | null = null;
27
-
28
- get statusIconClass(): string | null {
29
- switch (this.styleType) {
30
- case 'info':
31
- return 'fas fa-info-circle';
32
- case 'success':
33
- return 'fas fa-check-circle';
34
- case 'warning':
35
- return 'fas fa-exclamation-triangle';
36
- case 'danger':
37
- return 'fas fa-times-circle';
38
- default:
39
- return null;
40
- }
41
- }
42
-
43
- get snackbarClassMap() {
44
- return {
45
- 'frg-snackbar--top-left': this.position === 'top-left',
46
- 'frg-snackbar--top-center': this.position === 'top-center',
47
- 'frg-snackbar--top-right': this.position === 'top-right',
48
- 'frg-snackbar--bottom-left': this.position === 'bottom-left',
49
- 'frg-snackbar--bottom-center': this.position === 'bottom-center',
50
- 'frg-snackbar--bottom-right': this.position === 'bottom-right',
51
- 'frg-snackbar--size-small': this.size === 'small',
52
- 'frg-snackbar--size-medium': this.size === 'medium',
53
- 'frg-snackbar--size-large': this.size === 'large',
54
- 'frg-snackbar--primary': this.styleType === 'primary',
55
- 'frg-snackbar--secondary': this.styleType === 'secondary',
56
- 'frg-snackbar--tertiary': this.styleType === 'tertiary',
57
- 'frg-snackbar--dark': this.styleType === 'dark',
58
- 'frg-snackbar--light': this.styleType === 'light',
59
- 'frg-snackbar--info': this.styleType === 'info',
60
- 'frg-snackbar--success': this.styleType === 'success',
61
- 'frg-snackbar--warning': this.styleType === 'warning',
62
- 'frg-snackbar--danger': this.styleType === 'danger',
63
- 'frg-snackbar--default': this.styleType === 'default'
64
- };
65
- }
66
-
67
- ngOnChanges(changes: SimpleChanges): void {
68
- if (changes['open'] || changes['autoClose'] || changes['duration']) {
69
- this.syncAutoClose();
70
- }
71
- }
72
-
73
- ngOnDestroy(): void {
74
- this.clearCloseTimer();
75
- }
76
-
77
- onCloseClick(): void {
78
- this.requestClose('close-button');
79
- }
80
-
81
- onActionClick(): void {
82
- this.action.emit();
83
- this.requestClose('action');
84
- }
85
-
86
- private syncAutoClose(): void {
87
- this.clearCloseTimer();
88
-
89
- if (!this.open || !this.autoClose || this.duration <= 0) {
90
- return;
91
- }
92
-
93
- this.closeTimerId = setTimeout(() => {
94
- this.requestClose('timeout');
95
- }, this.duration);
96
- }
97
-
98
- private requestClose(reason: TSnackbarCloseReason): void {
99
- if (!this.open) {
100
- return;
101
- }
102
- this.clearCloseTimer();
103
- this.closed.emit({ reason });
104
- }
105
-
106
- private clearCloseTimer(): void {
107
- if (this.closeTimerId) {
108
- clearTimeout(this.closeTimerId);
109
- this.closeTimerId = null;
110
- }
111
- }
112
- }
@@ -1,27 +0,0 @@
1
- import { TBaseSize, TBaseStyle } from '../../types/base.types';
2
-
3
- export type TSnackbarStyle = Exclude<
4
- TBaseStyle,
5
- | 'outline-primary'
6
- | 'outline-secondary'
7
- | 'outline-tertiary'
8
- | 'outline-dark'
9
- | 'outline-light'
10
- | 'outline-info'
11
- | 'outline-success'
12
- | 'outline-warning'
13
- | 'outline-danger'
14
- >;
15
- export type TSnackbarSize = TBaseSize;
16
- export type TSnackbarPosition =
17
- | 'top-left'
18
- | 'top-center'
19
- | 'top-right'
20
- | 'bottom-left'
21
- | 'bottom-center'
22
- | 'bottom-right';
23
- export type TSnackbarCloseReason = 'close-button' | 'timeout' | 'programmatic' | 'action';
24
-
25
- export interface SnackbarCloseEvent {
26
- reason: TSnackbarCloseReason;
27
- }
@@ -1,51 +0,0 @@
1
- <span
2
- class="frg-chip"
3
- [ngClass]="[
4
- 'frg-chip--' + style,
5
- 'frg-chip--' + size,
6
- disabled ? 'frg-chip--disabled' : '',
7
- iconPosition === 'end' ? 'frg-chip--icon-end' : ''
8
- ]"
9
- >
10
- @if(icon && iconPosition === 'start') {
11
- <span class="frg-chip__icon">
12
- <span class="frg-chip__icon-inner">
13
- <i [class]="icon"></i>
14
- </span>
15
- </span>
16
- }
17
-
18
- @if(label) {
19
- <span class="frg-chip__label">{{ label }}</span>
20
- }
21
-
22
- @if(icon && iconPosition === 'end') {
23
- <span class="frg-chip__icon">
24
- <span class="frg-chip__icon-inner">
25
- <i [class]="icon"></i>
26
- </span>
27
- </span>
28
- }
29
-
30
- @if(removable) {
31
- <button
32
- type="button"
33
- class="frg-chip__remove"
34
- (click)="onRemove()"
35
- [attr.aria-label]="'Remove ' + label"
36
- >
37
- <svg
38
- class="frg-chip__remove-icon"
39
- width="10"
40
- height="10"
41
- viewBox="0 0 14 14"
42
- fill="none"
43
- xmlns="http://www.w3.org/2000/svg"
44
- >
45
- <circle cx="7" cy="7" r="6" stroke="currentColor" stroke-width="1.2"/>
46
- <path d="M5 5L9 9M9 5L5 9" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"></path>
47
-
48
- </svg>
49
- </button>
50
- }
51
- </span>
@@ -1,149 +0,0 @@
1
- @use './../../../../../assets/styles/scss/variables' as *;
2
- @use 'sass:color';
3
-
4
- $chip-background: $color-light;
5
- $chip-box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 1px 0px, rgba(0, 0, 0, 0.06) 0px 1px 1px 0px;
6
-
7
- :host {
8
- display: inline-block;
9
-
10
- .frg-chip {
11
- display: inline-flex;
12
- align-items: center;
13
- gap: 0.35rem;
14
- border-radius: 999px;
15
- white-space: nowrap;
16
- font-weight: 400;
17
- cursor: default;
18
- box-shadow: $chip-box-shadow;
19
- transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
20
-
21
- background-color: $chip-background;
22
- color: $color-dark-soft;
23
-
24
- &--sm {
25
- font-size: 0.75rem;
26
- padding: 0.12rem 0.55rem;
27
- }
28
-
29
- &--md {
30
- font-size: 0.9rem;
31
- padding: 0.2rem 0.8rem;
32
- }
33
-
34
- &--lg {
35
- font-size: 1.1rem;
36
- padding: 0.25rem 1.1rem;
37
- }
38
-
39
- &--primary {
40
- color: $color-primary-dark;
41
- }
42
-
43
- &--secondary {
44
- color: $color-secondary-dark;
45
- }
46
-
47
- &--tertiary {
48
- color: $color-tertiary-dark;
49
- }
50
-
51
- &--info {
52
- color: $color-info-dark;
53
- }
54
-
55
- &--warning {
56
- color: $color-warning-dark;
57
- }
58
-
59
- &--danger {
60
- color: $color-danger-dark;
61
- }
62
-
63
- &--success {
64
- color: $color-success-dark;
65
- }
66
-
67
- &--dark {
68
- color: $color-light;
69
- background: $color-dark;
70
- }
71
-
72
- &--light {
73
- color: $color-dark;
74
- }
75
-
76
- &__icon {
77
- display: inline-flex;
78
- align-items: center;
79
- justify-content: center;
80
- font-size: 0.9rem;
81
- }
82
-
83
- &__icon-inner {
84
- display: inline-flex;
85
- align-items: center;
86
- justify-content: center;
87
- vertical-align: middle;
88
- }
89
-
90
- &--icon-end {
91
- .frg-chip__icon {
92
- margin-left: 0.2rem;
93
- margin-right: 0;
94
- }
95
- }
96
-
97
- &__label {
98
- display: inline-flex;
99
- align-items: center;
100
- }
101
-
102
- &__remove {
103
- display: inline-flex;
104
- align-items: center;
105
- justify-content: center;
106
- width: 1rem;
107
- height: 1rem;
108
- padding: 0;
109
- background: transparent;
110
- border: none;
111
- cursor: pointer;
112
- color: inherit;
113
- transition: filter 0.3s ease-in-out;
114
-
115
- &:hover {
116
- filter: brightness(0.6);
117
- }
118
-
119
- &:focus-visible {
120
- outline: 2px solid rgba($color-primary, 0.45);
121
- outline-offset: 2px;
122
- }
123
-
124
- svg {
125
- width: 0.875rem;
126
- height: 0.875rem;
127
- display: block;
128
- fill: transparent;
129
- pointer-events: none;
130
- }
131
- }
132
-
133
-
134
- &--disabled {
135
- opacity: 0.6;
136
- cursor: not-allowed;
137
-
138
- .frg-chip__remove {
139
- cursor: not-allowed;
140
- pointer-events: none;
141
- color: inherit;
142
- }
143
-
144
- .frg-chip__icon {
145
- opacity: 0.6;
146
- }
147
- }
148
- }
149
- }
@@ -1,62 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import { ChipComponent } from './chip.component';
4
-
5
- describe('ChipComponent', () => {
6
- let fixture: ComponentFixture<ChipComponent>;
7
- let component: ChipComponent;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [ChipComponent]
12
- }).compileComponents();
13
-
14
- fixture = TestBed.createComponent(ChipComponent);
15
- component = fixture.componentInstance;
16
- });
17
-
18
- it('renders the label', () => {
19
- component.label = 'Active';
20
-
21
- fixture.detectChanges();
22
-
23
- const label = fixture.debugElement.query(By.css('.frg-chip__label'));
24
- expect(label.nativeElement.textContent).toContain('Active');
25
- });
26
-
27
- it('renders icon on the start when configured', () => {
28
- component.icon = 'fa fa-star';
29
- component.iconPosition = 'start';
30
-
31
- fixture.detectChanges();
32
-
33
- const icon = fixture.debugElement.query(By.css('.frg-chip__icon i'));
34
- expect(icon).toBeTruthy();
35
- });
36
-
37
- it('emits removed when removable and not disabled', () => {
38
- const emitSpy = spyOn(component.removed, 'emit');
39
- component.removable = true;
40
- component.disabled = false;
41
-
42
- fixture.detectChanges();
43
-
44
- const removeButton = fixture.debugElement.query(By.css('.frg-chip__remove'));
45
- removeButton.nativeElement.click();
46
-
47
- expect(emitSpy).toHaveBeenCalledWith(component.id);
48
- });
49
-
50
- it('does not emit removed when disabled', () => {
51
- const emitSpy = spyOn(component.removed, 'emit');
52
- component.removable = true;
53
- component.disabled = true;
54
-
55
- fixture.detectChanges();
56
-
57
- const removeButton = fixture.debugElement.query(By.css('.frg-chip__remove'));
58
- removeButton.nativeElement.click();
59
-
60
- expect(emitSpy).not.toHaveBeenCalled();
61
- });
62
- });
@@ -1,83 +0,0 @@
1
- import { NgClass } from '@angular/common';
2
- import { Component, EventEmitter, Input, Output } from '@angular/core';
3
- import { generateUUID } from '../../../utils/uuid.utils';
4
- import { Chip, TChipIconPosition, TChipSize, TChipType } from './chip.type';
5
-
6
- /**
7
- * TagComponent
8
- *
9
- * A small UI element used to display labeled statuses, metadata, or categories.
10
- * Supports icons, removable behavior, disabled state, and standardized design-
11
- * system styles and sizes. Implements the shared `Tag` interface to ensure
12
- * consistency across all status-driven UI components (Tag, Badge, Chip, etc.).
13
- */
14
- @Component({
15
- selector: 'frg-chip',
16
- templateUrl: './chip.component.html',
17
- styleUrls: ['./chip.component.scss'],
18
- imports: [NgClass]
19
- })
20
- export class ChipComponent implements Chip {
21
-
22
- /**
23
- * Unique identifier for the chip.
24
- * Automatically generated if not provided by the parent.
25
- * Used primarily for tracking and removal events.
26
- */
27
- @Input() id: string = generateUUID();
28
-
29
- /**
30
- * Text content displayed inside the chip.
31
- */
32
- @Input() label?: string = '';
33
-
34
- /**
35
- * Visual style of the chip.
36
- * Corresponds to design-system status color tokens.
37
- * Example: 'primary', 'secondary', 'success', 'warning', etc.
38
- */
39
- @Input() style: TChipType = 'primary';
40
-
41
- /**
42
- * Size variant of the chip.
43
- * Options follow the standardized sizing tokens: 'sm', 'md', or 'lg'.
44
- */
45
- @Input() size: TChipSize = 'md';
46
-
47
- /**
48
- * Optional icon class displayed before the label.
49
- * Example: 'frg-icon-info', 'frg-icon-alert'.
50
- */
51
- @Input() icon: string | undefined = undefined;
52
-
53
- /**
54
- * Position of the icon
55
- */
56
- @Input() iconPosition: TChipIconPosition = 'end';
57
-
58
- /**
59
- * Whether the chip is disabled.
60
- * Disables interactions and applies the disabled visual style.
61
- */
62
- @Input() disabled = false;
63
-
64
- /**
65
- * If true, displays a remove button allowing the chip to be dismissed.
66
- */
67
- @Input() removable = false;
68
-
69
- /**
70
- * Emits the ID of the chip when it is removed.
71
- */
72
- @Output() removed = new EventEmitter<string>();
73
-
74
- /**
75
- * Emits the `removed` event when the remove button is clicked,
76
- * provided the chip is not disabled and removal is allowed.
77
- */
78
- onRemove(): void {
79
- if (!this.disabled && this.removable) {
80
- this.removed.emit(this.id);
81
- }
82
- }
83
- }
@@ -1,42 +0,0 @@
1
- import { StatusIndicator } from "../status.interface";
2
- import { TBaseStatusIconPosition, TBaseStatusSize, TBaseStatusStyle } from "../status.type";
3
-
4
- /**
5
- * ChipType
6
- *
7
- * Alias for `TBaseStatusStyle`.
8
- * Represents the visual style of a chip according to the design system.
9
- * Example: 'primary', 'secondary', 'success', etc.
10
- */
11
- export type TChipType = TBaseStatusStyle;
12
-
13
- /**
14
- * ChipSize
15
- *
16
- * Alias for `TBaseStatusSize`.
17
- * Defines the size of the chip. Options: 'sm', 'md', 'lg'.
18
- */
19
- export type TChipSize = TBaseStatusSize;
20
-
21
- /**
22
- * ChipIconPosition
23
- *
24
- * Alias for `TBaseStatusIconPosition`.
25
- * Defines the icon position of the icon in the chip. Options: 'start' or 'end'.
26
- */
27
- export type TChipIconPosition = TBaseStatusIconPosition;
28
- /**
29
- * chip
30
- *
31
- * A UI element that extends the shared `StatusIndicator` interface.
32
- * Represents a labeled status, optionally removable.
33
- *
34
- * @extends StatusIndicator
35
- */
36
- export interface Chip extends StatusIndicator {
37
- /**
38
- * If true, the tag can be removed by the user.
39
- * Triggers the `removed` event in the component.
40
- */
41
- removable?: boolean;
42
- }
@@ -1,60 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ComponentFixture, TestBed } from '@angular/core/testing';
3
- import { By } from '@angular/platform-browser';
4
- import { FrgBadgeDirective } from './badge.directive';
5
- import { Badge } from './badge.interface';
6
-
7
- @Component({
8
- standalone: true,
9
- imports: [FrgBadgeDirective],
10
- template: `<button frgBadge [badge]="badge">Inbox</button>`
11
- })
12
- class TestHostComponent {
13
- badge: Badge = { value: 3, style: 'primary', size: 'sm' };
14
- }
15
-
16
- describe('FrgBadgeDirective', () => {
17
- let fixture: ComponentFixture<TestHostComponent>;
18
- let component: TestHostComponent;
19
-
20
- beforeEach(async () => {
21
- await TestBed.configureTestingModule({
22
- imports: [TestHostComponent]
23
- }).compileComponents();
24
-
25
- fixture = TestBed.createComponent(TestHostComponent);
26
- component = fixture.componentInstance;
27
- fixture.detectChanges();
28
- });
29
-
30
- it('adds the badge element with value', () => {
31
- const badgeEl = fixture.debugElement.query(By.css('.frg-badge'));
32
- expect(badgeEl).toBeTruthy();
33
- expect(badgeEl.nativeElement.textContent).toContain('3');
34
- });
35
-
36
- it('hides the badge when value is null and dot is false', () => {
37
- component.badge = { value: null, dot: false };
38
- fixture.detectChanges();
39
-
40
- expect(fixture.debugElement.query(By.css('.frg-badge'))).toBeNull();
41
- });
42
-
43
- it('renders dot badge when dot is true', () => {
44
- component.badge = { dot: true };
45
- fixture.detectChanges();
46
-
47
- const badgeEl = fixture.debugElement.query(By.css('.frg-badge'));
48
- expect(badgeEl).toBeTruthy();
49
- expect(badgeEl.nativeElement.classList).toContain('frg-badge--dot');
50
- });
51
-
52
- it('renders icon before value when iconPosition is start', () => {
53
- component.badge = { value: 5, icon: 'fas fa-star', iconPosition: 'start' };
54
- fixture.detectChanges();
55
-
56
- const badgeEl = fixture.debugElement.query(By.css('.frg-badge'));
57
- const firstChild = badgeEl.nativeElement.firstElementChild;
58
- expect(firstChild?.tagName.toLowerCase()).toBe('i');
59
- });
60
- });