@tacdaed/fragments 1.0.0-beta.0 → 1.0.0-beta.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.
Files changed (248) hide show
  1. package/README.md +1 -1
  2. package/ng-package.json +25 -0
  3. package/package.json +22 -29
  4. package/src/lib/components/accordion/accordion.component.html +103 -0
  5. package/src/lib/components/accordion/accordion.component.scss +382 -0
  6. package/src/lib/components/accordion/accordion.component.spec.ts +147 -0
  7. package/src/lib/components/accordion/accordion.component.ts +211 -0
  8. package/src/lib/components/accordion/accordion.type.ts +82 -0
  9. package/src/lib/components/breadcrumb/breadcrumb.component.html +43 -0
  10. package/src/lib/components/breadcrumb/breadcrumb.component.scss +112 -0
  11. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +33 -0
  12. package/src/lib/components/breadcrumb/breadcrumb.component.ts +103 -0
  13. package/src/lib/components/breadcrumb/breadcrumb.interface.ts +7 -0
  14. package/src/lib/components/button/button.component.html +57 -0
  15. package/src/lib/components/button/button.component.scss +445 -0
  16. package/src/lib/components/button/button.component.spec.ts +99 -0
  17. package/src/lib/components/button/button.component.ts +143 -0
  18. package/src/lib/components/button/button.type.ts +7 -0
  19. package/src/lib/components/card/card.component.html +44 -0
  20. package/src/lib/components/card/card.component.scss +114 -0
  21. package/src/lib/components/card/card.component.spec.ts +65 -0
  22. package/src/lib/components/card/card.component.ts +21 -0
  23. package/src/lib/components/card/card.type.ts +3 -0
  24. package/src/lib/components/code-block/code-block.component.html +55 -0
  25. package/src/lib/components/code-block/code-block.component.scss +122 -0
  26. package/src/lib/components/code-block/code-block.component.spec.ts +81 -0
  27. package/src/lib/components/code-block/code-block.component.ts +302 -0
  28. package/src/lib/components/code-block/code-block.interface.ts +28 -0
  29. package/src/lib/components/code-block/code-block.type.ts +73 -0
  30. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.html +14 -0
  31. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.scss +20 -0
  32. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.spec.ts +38 -0
  33. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.ts +181 -0
  34. package/src/lib/components/input/input-base.ts +187 -0
  35. package/src/lib/components/input/input-calendar/input-calendar.component.html +76 -0
  36. package/src/lib/components/input/input-calendar/input-calendar.component.scss +179 -0
  37. package/src/lib/components/input/input-calendar/input-calendar.component.spec.ts +44 -0
  38. package/src/lib/components/input/input-calendar/input-calendar.component.ts +299 -0
  39. package/src/lib/components/input/input-checkbox/input-checkbox.component.html +37 -0
  40. package/src/lib/components/input/input-checkbox/input-checkbox.component.scss +128 -0
  41. package/src/lib/components/input/input-checkbox/input-checkbox.component.spec.ts +43 -0
  42. package/src/lib/components/input/input-checkbox/input-checkbox.component.ts +112 -0
  43. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.html +43 -0
  44. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.scss +140 -0
  45. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.spec.ts +62 -0
  46. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.ts +136 -0
  47. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.html +81 -0
  48. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.scss +228 -0
  49. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.spec.ts +62 -0
  50. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.ts +178 -0
  51. package/src/lib/components/input/input-consts.ts +132 -0
  52. package/src/lib/components/input/input-date/input-date-validators.ts +41 -0
  53. package/src/lib/components/input/input-date/input-date.component.html +41 -0
  54. package/src/lib/components/input/input-date/input-date.component.scss +95 -0
  55. package/src/lib/components/input/input-date/input-date.component.spec.ts +43 -0
  56. package/src/lib/components/input/input-date/input-date.component.ts +359 -0
  57. package/src/lib/components/input/input-date-time/input-date-time.component.html +70 -0
  58. package/src/lib/components/input/input-date-time/input-date-time.component.scss +133 -0
  59. package/src/lib/components/input/input-date-time/input-date-time.component.spec.ts +36 -0
  60. package/src/lib/components/input/input-date-time/input-date-time.component.ts +387 -0
  61. package/src/lib/components/input/input-file-upload/input-file-upload.component.html +89 -0
  62. package/src/lib/components/input/input-file-upload/input-file-upload.component.scss +171 -0
  63. package/src/lib/components/input/input-file-upload/input-file-upload.component.spec.ts +43 -0
  64. package/src/lib/components/input/input-file-upload/input-file-upload.component.ts +351 -0
  65. package/src/lib/components/input/input-interface.ts +8 -0
  66. package/src/lib/components/input/input-number/input-number-validators.ts +0 -0
  67. package/src/lib/components/input/input-number/input-number.component.html +51 -0
  68. package/src/lib/components/input/input-number/input-number.component.scss +140 -0
  69. package/src/lib/components/input/input-number/input-number.component.spec.ts +44 -0
  70. package/src/lib/components/input/input-number/input-number.component.ts +343 -0
  71. package/src/lib/components/input/input-radio-group/input-radio-group.component.html +44 -0
  72. package/src/lib/components/input/input-radio-group/input-radio-group.component.scss +139 -0
  73. package/src/lib/components/input/input-radio-group/input-radio-group.component.spec.ts +58 -0
  74. package/src/lib/components/input/input-radio-group/input-radio-group.component.ts +132 -0
  75. package/src/lib/components/input/input-slider/input-slider.component.html +111 -0
  76. package/src/lib/components/input/input-slider/input-slider.component.scss +203 -0
  77. package/src/lib/components/input/input-slider/input-slider.component.spec.ts +46 -0
  78. package/src/lib/components/input/input-slider/input-slider.component.ts +410 -0
  79. package/src/lib/components/input/input-text/input-text-validators.ts +67 -0
  80. package/src/lib/components/input/input-text/input-text.component.html +71 -0
  81. package/src/lib/components/input/input-text/input-text.component.scss +118 -0
  82. package/src/lib/components/input/input-text/input-text.component.spec.ts +55 -0
  83. package/src/lib/components/input/input-text/input-text.component.ts +215 -0
  84. package/src/lib/components/input/input-time/input-time-validators.ts +42 -0
  85. package/src/lib/components/input/input-time/input-time.component.html +92 -0
  86. package/src/lib/components/input/input-time/input-time.component.scss +191 -0
  87. package/src/lib/components/input/input-time/input-time.component.spec.ts +39 -0
  88. package/src/lib/components/input/input-time/input-time.component.ts +691 -0
  89. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.html +36 -0
  90. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.scss +121 -0
  91. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.spec.ts +54 -0
  92. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.ts +117 -0
  93. package/src/lib/components/input/input-type.ts +18 -0
  94. package/src/lib/components/input/input-validation/input-validation.component.html +19 -0
  95. package/src/lib/components/input/input-validation/input-validation.component.scss +39 -0
  96. package/src/lib/components/input/input-validation/input-validation.component.spec.ts +45 -0
  97. package/src/lib/components/input/input-validation/input-validation.component.ts +13 -0
  98. package/src/lib/components/input/input.pipe.ts +14 -0
  99. package/src/lib/components/layout/container/container.component.html +1 -0
  100. package/src/lib/components/layout/container/container.component.scss +33 -0
  101. package/src/lib/components/layout/container/container.component.ts +32 -0
  102. package/src/lib/components/layout/container/container.type.ts +1 -0
  103. package/src/lib/components/layout/divider/divider.component.html +1 -0
  104. package/src/lib/components/layout/divider/divider.component.scss +60 -0
  105. package/src/lib/components/layout/divider/divider.component.ts +38 -0
  106. package/src/lib/components/layout/divider/divider.type.ts +2 -0
  107. package/src/lib/components/layout/section/section.component.html +21 -0
  108. package/src/lib/components/layout/section/section.component.scss +43 -0
  109. package/src/lib/components/layout/section/section.component.ts +33 -0
  110. package/src/lib/components/layout/section/section.type.ts +2 -0
  111. package/src/lib/components/layout/separator/separator.component.html +9 -0
  112. package/src/lib/components/layout/separator/separator.component.scss +52 -0
  113. package/src/lib/components/layout/separator/separator.component.ts +25 -0
  114. package/src/lib/components/layout/separator/separator.type.ts +1 -0
  115. package/src/lib/components/loader/content-blur/content-blur.component.html +13 -0
  116. package/src/lib/components/loader/content-blur/content-blur.component.scss +43 -0
  117. package/src/lib/components/loader/content-blur/content-blur.component.spec.ts +42 -0
  118. package/src/lib/components/loader/content-blur/content-blur.component.ts +34 -0
  119. package/src/lib/components/loader/loader.type.ts +2 -0
  120. package/src/lib/components/loader/progress-bar/progress-bar.component.html +26 -0
  121. package/src/lib/components/loader/progress-bar/progress-bar.component.scss +151 -0
  122. package/src/lib/components/loader/progress-bar/progress-bar.component.spec.ts +47 -0
  123. package/src/lib/components/loader/progress-bar/progress-bar.component.ts +28 -0
  124. package/src/lib/components/loader/progress-bar/progress-bar.type.ts +8 -0
  125. package/src/lib/components/loader/pulse-loader/pulse-loader.component.html +12 -0
  126. package/src/lib/components/loader/pulse-loader/pulse-loader.component.scss +202 -0
  127. package/src/lib/components/loader/pulse-loader/pulse-loader.component.spec.ts +55 -0
  128. package/src/lib/components/loader/pulse-loader/pulse-loader.component.ts +73 -0
  129. package/src/lib/components/loader/pulse-loader/pulse-loader.type.ts +6 -0
  130. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.html +13 -0
  131. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.scss +113 -0
  132. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.spec.ts +37 -0
  133. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.ts +51 -0
  134. package/src/lib/components/loader/skeleton-loader/skeleton-loader.type.ts +6 -0
  135. package/src/lib/components/loader/spinner/spinner.component.html +20 -0
  136. package/src/lib/components/loader/spinner/spinner.component.scss +137 -0
  137. package/src/lib/components/loader/spinner/spinner.component.spec.ts +43 -0
  138. package/src/lib/components/loader/spinner/spinner.component.ts +32 -0
  139. package/src/lib/components/loader/spinner/spinner.type.ts +6 -0
  140. package/src/lib/components/modal/modal.component.html +47 -0
  141. package/src/lib/components/modal/modal.component.scss +139 -0
  142. package/src/lib/components/modal/modal.component.spec.ts +60 -0
  143. package/src/lib/components/modal/modal.component.ts +83 -0
  144. package/src/lib/components/modal/modal.type.ts +9 -0
  145. package/src/lib/components/morph/blob-moph/blob-moprh.component.spec.ts +79 -0
  146. package/src/lib/components/morph/blob-moph/blob-moprh.component.ts +96 -0
  147. package/src/lib/components/morph/blob-moph/blob-morph.component.html +34 -0
  148. package/src/lib/components/morph/blob-moph/blob-morph.component.scss +7 -0
  149. package/src/lib/components/morph/morph.abstract.ts +13 -0
  150. package/src/lib/components/pagination/pagination.interface.ts +4 -0
  151. package/src/lib/components/pagination/small-pagination/small-pagination.component.html +61 -0
  152. package/src/lib/components/pagination/small-pagination/small-pagination.component.scss +187 -0
  153. package/src/lib/components/pagination/small-pagination/small-pagination.component.spec.ts +88 -0
  154. package/src/lib/components/pagination/small-pagination/small-pagination.component.ts +177 -0
  155. package/src/lib/components/selection-lists/multi-select/multi-select.component.html +170 -0
  156. package/src/lib/components/selection-lists/multi-select/multi-select.component.scss +312 -0
  157. package/src/lib/components/selection-lists/multi-select/multi-select.component.spec.ts +61 -0
  158. package/src/lib/components/selection-lists/multi-select/multi-select.component.ts +372 -0
  159. package/src/lib/components/selection-lists/selection-list/selection-list.component.html +125 -0
  160. package/src/lib/components/selection-lists/selection-list/selection-list.component.scss +267 -0
  161. package/src/lib/components/selection-lists/selection-list/selection-list.component.spec.ts +66 -0
  162. package/src/lib/components/selection-lists/selection-list/selection-list.component.ts +315 -0
  163. package/src/lib/components/selection-lists/selection-lists-base.ts +35 -0
  164. package/src/lib/components/selection-lists/selection-lists-const.ts +17 -0
  165. package/src/lib/components/selection-lists/selection-lists-interface.ts +7 -0
  166. package/src/lib/components/selection-lists/selection-lists.type.ts +1 -0
  167. package/src/lib/components/side-nav/side-nav.component.html +101 -0
  168. package/src/lib/components/side-nav/side-nav.component.scss +295 -0
  169. package/src/lib/components/side-nav/side-nav.component.spec.ts +0 -0
  170. package/src/lib/components/side-nav/side-nav.component.ts +18 -0
  171. package/src/lib/components/side-nav/side-nav.type.ts +28 -0
  172. package/src/lib/components/snackbar/snackbar.component.html +33 -0
  173. package/src/lib/components/snackbar/snackbar.component.scss +195 -0
  174. package/src/lib/components/snackbar/snackbar.component.ts +112 -0
  175. package/src/lib/components/snackbar/snackbar.type.ts +27 -0
  176. package/src/lib/components/status/chip/chip.component.html +51 -0
  177. package/src/lib/components/status/chip/chip.component.scss +149 -0
  178. package/src/lib/components/status/chip/chip.component.spec.ts +62 -0
  179. package/src/lib/components/status/chip/chip.component.ts +83 -0
  180. package/src/lib/components/status/chip/chip.type.ts +42 -0
  181. package/src/lib/components/status/directives/badge/badge.directive.spec.ts +60 -0
  182. package/src/lib/components/status/directives/badge/badge.directive.ts +190 -0
  183. package/src/lib/components/status/directives/badge/badge.interface.ts +19 -0
  184. package/src/lib/components/status/pill/pill.component.html +40 -0
  185. package/src/lib/components/status/pill/pill.component.scss +113 -0
  186. package/src/lib/components/status/pill/pill.component.spec.ts +47 -0
  187. package/src/lib/components/status/pill/pill.component.ts +83 -0
  188. package/src/lib/components/status/pill/pill.type.ts +42 -0
  189. package/src/lib/components/status/status.interface.ts +57 -0
  190. package/src/lib/components/status/status.type.ts +62 -0
  191. package/src/lib/components/status/tag/tag.component.html +39 -0
  192. package/src/lib/components/status/tag/tag.component.scss +140 -0
  193. package/src/lib/components/status/tag/tag.component.spec.ts +47 -0
  194. package/src/lib/components/status/tag/tag.component.ts +83 -0
  195. package/src/lib/components/status/tag/tag.type.ts +42 -0
  196. package/src/lib/components/stepper/stepper.component.html +83 -0
  197. package/src/lib/components/stepper/stepper.component.scss +196 -0
  198. package/src/lib/components/stepper/stepper.component.ts +482 -0
  199. package/src/lib/components/stepper/stepper.type.ts +60 -0
  200. package/src/lib/components/table/table.component.html +438 -0
  201. package/src/lib/components/table/table.component.scss +259 -0
  202. package/src/lib/components/table/table.component.spec.ts +117 -0
  203. package/src/lib/components/table/table.component.ts +215 -0
  204. package/src/lib/components/table/table.enum.ts +4 -0
  205. package/src/lib/components/table/table.function.ts +47 -0
  206. package/src/lib/components/table/table.interface.ts +143 -0
  207. package/src/lib/components/table/table.pipe.ts +62 -0
  208. package/src/lib/components/table/table.type.ts +15 -0
  209. package/src/lib/components/tabs/tabs.component.html +88 -0
  210. package/src/lib/components/tabs/tabs.component.scss +305 -0
  211. package/src/lib/components/tabs/tabs.component.spec.ts +94 -0
  212. package/src/lib/components/tabs/tabs.component.ts +282 -0
  213. package/src/lib/components/tabs/tabs.type.ts +81 -0
  214. package/src/lib/components/title-bar/title-bar.component.html +21 -0
  215. package/src/lib/components/title-bar/title-bar.component.scss +139 -0
  216. package/src/lib/components/title-bar/title-bar.component.spec.ts +44 -0
  217. package/src/lib/components/title-bar/title-bar.component.ts +13 -0
  218. package/src/lib/components/toast/toast.component.html +36 -0
  219. package/src/lib/components/toast/toast.component.scss +241 -0
  220. package/src/lib/components/toast/toast.component.ts +165 -0
  221. package/src/lib/components/toast/toast.type.ts +37 -0
  222. package/src/lib/components/toast-stack/toast-stack.component.html +30 -0
  223. package/src/lib/components/toast-stack/toast-stack.component.scss +35 -0
  224. package/src/lib/components/toast-stack/toast-stack.component.ts +51 -0
  225. package/src/lib/consts/country-prefix.ts +244 -0
  226. package/src/lib/directives/tooltip/popover.directive.ts +274 -0
  227. package/src/lib/directives/tooltip/tooltip.directive.spec.ts +86 -0
  228. package/src/lib/directives/tooltip/tooltip.directive.ts +234 -0
  229. package/src/lib/directives/tooltip/tooltip.interface.ts +29 -0
  230. package/src/lib/directives/tooltip/tooltip.type.ts +9 -0
  231. package/src/lib/interfaces/common.interfaces.ts +4 -0
  232. package/src/lib/pipes/chunk.pipe.ts +16 -0
  233. package/src/lib/pipes/safe-html.pipe.ts +14 -0
  234. package/src/lib/pipes/sanitize-html.pipe.ts +23 -0
  235. package/src/lib/types/base.types.ts +23 -0
  236. package/src/lib/types/common.types.ts +98 -0
  237. package/src/lib/types/form.types.ts +5 -0
  238. package/src/lib/utils/common.utils.ts +53 -0
  239. package/src/lib/utils/date.utils.ts +474 -0
  240. package/src/lib/utils/number.utils.ts +16 -0
  241. package/src/lib/utils/uuid.utils.ts +39 -0
  242. package/src/public-api.ts +114 -0
  243. package/tsconfig.lib.json +17 -0
  244. package/tsconfig.lib.prod.json +10 -0
  245. package/tsconfig.spec.json +9 -0
  246. package/fesm2022/fragments.mjs +0 -8928
  247. package/fesm2022/fragments.mjs.map +0 -1
  248. package/index.d.ts +0 -3929
@@ -0,0 +1,137 @@
1
+ @use './../../../../../assets/styles/scss/variables' as *;
2
+
3
+ @keyframes frg-spin {
4
+ to {
5
+ transform: rotate(360deg);
6
+ }
7
+ }
8
+
9
+ :host {
10
+ display: block;
11
+
12
+ .frg-spinner {
13
+ display: inline-block;
14
+ line-height: 0;
15
+ vertical-align: middle;
16
+
17
+ &--center {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ }
22
+
23
+ &__circle {
24
+ box-sizing: border-box;
25
+ display: inline-block;
26
+ border-radius: 50%;
27
+ border-style: solid;
28
+ animation: frg-spin 0.8s linear infinite;
29
+ width: $frg-loader-size-md;
30
+ height: $frg-loader-size-md;
31
+ border-width: $frg-loader-border-width;
32
+ }
33
+
34
+ // Varianti dimensione
35
+ &--xs .frg-spinner__circle {
36
+ width: $frg-loader-size-xs;
37
+ height: $frg-loader-size-xs;
38
+ border-width: 0.125rem;
39
+ }
40
+
41
+ &--sm .frg-spinner__circle {
42
+ width: $frg-loader-size-sm;
43
+ height: $frg-loader-size-sm;
44
+ }
45
+
46
+ &--md .frg-spinner__circle {
47
+ width: $frg-loader-size-md;
48
+ height: $frg-loader-size-md;
49
+ }
50
+
51
+ &--lg .frg-spinner__circle {
52
+ width: $frg-loader-size-lg;
53
+ height: $frg-loader-size-lg;
54
+ }
55
+
56
+ &--xl .frg-spinner__circle {
57
+ width: $frg-loader-size-xl;
58
+ height: $frg-loader-size-xl;
59
+ border-width: 0.25rem;
60
+ }
61
+
62
+ // Colore
63
+ &--primary .frg-spinner__circle {
64
+ border-color: $frg-loader-color-primary;
65
+ border-left-color: transparent;
66
+ border-right-color: transparent;
67
+ }
68
+
69
+ &--secondary .frg-spinner__circle {
70
+ border-color: $frg-loader-color-secondary;
71
+ border-left-color: transparent;
72
+ border-right-color: transparent;
73
+ }
74
+
75
+ &--tertiary .frg-spinner__circle {
76
+ border-color: $frg-loader-color-tertiary;
77
+ border-left-color: transparent;
78
+ border-right-color: transparent;
79
+ }
80
+
81
+ &--dark .frg-spinner__circle {
82
+ border-color: $frg-loader-color-dark;
83
+ border-left-color: transparent;
84
+ border-right-color: transparent;
85
+ }
86
+
87
+ &--light .frg-spinner__circle {
88
+ border-color: $frg-loader-color-light;
89
+ border-left-color: transparent;
90
+ border-right-color: transparent;
91
+ }
92
+
93
+ @media (prefers-reduced-motion: reduce) {
94
+ &__circle {
95
+ animation: none;
96
+ transform: rotate(0);
97
+ }
98
+ }
99
+
100
+ &--overlay {
101
+ position: fixed;
102
+ top: 0;
103
+ left: 0;
104
+ width: 100vw;
105
+ height: 100vh;
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ background: rgba($color-light-neutral, .6);
110
+ z-index: 9999;
111
+ backdrop-filter: blur(.2rem);
112
+ }
113
+
114
+ &--overlay-item {
115
+ position: absolute;
116
+ inset: 0;
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ z-index: 1;
121
+ }
122
+ }
123
+
124
+ /* Accessibilità */
125
+ .sr-only {
126
+ position: absolute !important;
127
+ width: 1px !important;
128
+ height: 1px !important;
129
+ padding: 0 !important;
130
+ margin: -1px !important;
131
+ overflow: hidden !important;
132
+ clip: rect(0, 0, 0, 0) !important;
133
+ white-space: nowrap !important;
134
+ border: 0 !important;
135
+ }
136
+
137
+ }
@@ -0,0 +1,43 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { SimpleChange } from '@angular/core';
3
+ import { By } from '@angular/platform-browser';
4
+ import { SpinnerComponent } from './spinner.component';
5
+
6
+ describe('SpinnerComponent', () => {
7
+ let fixture: ComponentFixture<SpinnerComponent>;
8
+ let component: SpinnerComponent;
9
+
10
+ beforeEach(async () => {
11
+ await TestBed.configureTestingModule({
12
+ imports: [SpinnerComponent]
13
+ }).compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SpinnerComponent);
16
+ component = fixture.componentInstance;
17
+ });
18
+
19
+ afterEach(() => {
20
+ document.body.style.overflow = '';
21
+ });
22
+
23
+ it('applies overlay class when enabled', () => {
24
+ component.isOverlay = true;
25
+
26
+ fixture.detectChanges();
27
+
28
+ const spinner = fixture.debugElement.query(By.css('.frg-spinner'));
29
+ expect(spinner.nativeElement.classList).toContain('frg-spinner--overlay');
30
+ });
31
+
32
+ it('toggles body scroll when overlay changes', () => {
33
+ component.isOverlay = true;
34
+ component.ngOnChanges({
35
+ isOverlay: new SimpleChange(false, true, false)
36
+ });
37
+
38
+ expect(document.body.style.overflow).toBe('hidden');
39
+
40
+ component.ngOnDestroy();
41
+ expect(document.body.style.overflow).toBe('');
42
+ });
43
+ });
@@ -0,0 +1,32 @@
1
+ import { NgClass } from '@angular/common';
2
+ import { Component, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
3
+ import { TSpinnerSize, TSpinnerType } from './spinner.type';
4
+
5
+ @Component({
6
+ selector: 'frg-spinner',
7
+ templateUrl: './spinner.component.html',
8
+ styleUrls: ['./spinner.component.scss'],
9
+ imports: [NgClass]
10
+ })
11
+ export class SpinnerComponent implements OnChanges, OnDestroy {
12
+ @Input() size: TSpinnerSize = 'medium';
13
+ @Input() isCentered: boolean = false;
14
+ @Input() isOverlay = false;
15
+ @Input() isOverlayItem = false;
16
+ @Input() label = 'Loading...';
17
+ @Input() styleType: TSpinnerType = 'primary';
18
+
19
+ ngOnChanges(changes: SimpleChanges): void {
20
+ if (changes['isOverlay']) {
21
+ this.toggleBodyScroll(this.isOverlay);
22
+ }
23
+ }
24
+
25
+ ngOnDestroy(): void {
26
+ this.toggleBodyScroll(false);
27
+ }
28
+
29
+ private toggleBodyScroll(disable: boolean): void {
30
+ document.body.style.overflow = disable ? 'hidden' : '';
31
+ }
32
+ }
@@ -0,0 +1,6 @@
1
+ import { TBaseSize } from "../../../types/base.types";
2
+ import { TBaseLoaderStyle } from "../loader.type";
3
+
4
+ export type TSpinnerSize = TBaseSize | 'extra-small' | 'extra-large';
5
+
6
+ export type TSpinnerType = TBaseLoaderStyle;
@@ -0,0 +1,47 @@
1
+ @if (open) {
2
+ <div class="frg-modal__backdrop">
3
+ <button
4
+ type="button"
5
+ class="frg-modal__backdrop-btn"
6
+ aria-label="Close dialog"
7
+ (click)="onBackdropClick()"
8
+ ></button>
9
+ <dialog
10
+ class="frg-modal"
11
+ [ngClass]="modalClassMap"
12
+ aria-modal="true"
13
+ [attr.aria-labelledby]="ariaLabelledBy || null"
14
+ [attr.aria-describedby]="ariaDescribedBy || null"
15
+ [attr.aria-label]="ariaLabelledBy ? null : ariaLabel"
16
+ open
17
+ >
18
+ @if (showHeader) {
19
+ <div class="frg-modal__header">
20
+ <div class="frg-modal__header-content">
21
+ <ng-content select="[frg-modal-head]"></ng-content>
22
+ </div>
23
+ @if (hasCloseButton) {
24
+ <button
25
+ type="button"
26
+ class="frg-modal__close-btn"
27
+ (click)="onCloseClick()"
28
+ aria-label="Close dialog"
29
+ >
30
+ &times;
31
+ </button>
32
+ }
33
+ </div>
34
+ }
35
+
36
+ <div class="frg-modal__body" [ngClass]="{ 'frg-modal__body--with-footer': hasFooter }">
37
+ <ng-content select="[frg-modal-body]"></ng-content>
38
+ </div>
39
+
40
+ @if (hasFooter) {
41
+ <div class="frg-modal__footer">
42
+ <ng-content select="[frg-modal-footer]"></ng-content>
43
+ </div>
44
+ }
45
+ </dialog>
46
+ </div>
47
+ }
@@ -0,0 +1,139 @@
1
+ @use '../../../../assets/styles/scss/variables' as *;
2
+
3
+ :host {
4
+ dialog {
5
+ padding: 0.25rem;
6
+ }
7
+
8
+ .frg-modal__backdrop {
9
+ position: fixed;
10
+ inset: 0;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ padding: 1.5rem;
15
+ background: rgba($color-dark, 0.45);
16
+ backdrop-filter: blur(6px);
17
+ z-index: 1050;
18
+ }
19
+
20
+ .frg-modal__backdrop-btn {
21
+ position: absolute;
22
+ inset: 0;
23
+ border: 0;
24
+ padding: 0;
25
+ margin: 0;
26
+ background: transparent;
27
+ cursor: pointer;
28
+ z-index: 0;
29
+ }
30
+
31
+ .frg-modal {
32
+ width: 100%;
33
+ gap: 1rem;
34
+ max-width: 5rem;
35
+ max-height: calc(100vh - 3rem);
36
+ background: $color-light;
37
+ color: $color-dark;
38
+ border-radius: 0.6rem;
39
+ border: 1px solid rgba($color-dark, 0.08);
40
+ box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
41
+ overflow: hidden;
42
+ font-family: $base-font;
43
+ display: flex;
44
+ flex-direction: column;
45
+ animation: frg-modal-enter 0.2s ease-out;
46
+ z-index: 1;
47
+ position: relative;
48
+
49
+ &__size-small {
50
+ max-width: 28rem;
51
+ }
52
+
53
+ &__size-medium {
54
+ max-width: 40rem;
55
+ }
56
+
57
+ &__size-large {
58
+ max-width: 56rem;
59
+ }
60
+ }
61
+
62
+ .frg-modal__header {
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: space-between;
66
+ gap: 1rem;
67
+ padding: 0.75rem 1.5rem 0.75rem;
68
+ }
69
+
70
+ .frg-modal__header-content {
71
+ min-width: 0;
72
+ flex: 1;
73
+ font-size: 0.95rem;
74
+
75
+ h1,
76
+ h2,
77
+ h3,
78
+ h4,
79
+ h5,
80
+ h6 {
81
+ font-size: 1.1rem;
82
+ margin-bottom: 0.25rem;
83
+ }
84
+
85
+ p {
86
+ font-size: 0.9rem;
87
+ margin-bottom: 0;
88
+ }
89
+ }
90
+
91
+ .frg-modal__body {
92
+ padding: 0.75rem 1.5rem 0.75rem;
93
+ overflow-y: auto;
94
+ font-size: 0.95rem;
95
+ }
96
+
97
+ .frg-modal__body--with-footer {
98
+ border-bottom: 0;
99
+ }
100
+
101
+ .frg-modal__footer {
102
+ padding: 0 1.5rem 0.75rem;
103
+ display: flex;
104
+ justify-content: flex-end;
105
+ gap: 0.75rem;
106
+ flex-wrap: wrap;
107
+ }
108
+
109
+ .frg-modal__close-btn {
110
+ background: transparent;
111
+ border: none;
112
+ color: $color-dark-soft;
113
+ font-size: 1.5rem;
114
+ line-height: 1;
115
+ padding: 0.15rem 0.4rem;
116
+ border-radius: 50%;
117
+ cursor: pointer;
118
+ position: absolute;
119
+ top: 0.65rem;
120
+ right: 0.75rem;
121
+
122
+ &:hover,
123
+ &:focus {
124
+ color: $color-dark;
125
+ outline: none;
126
+ }
127
+ }
128
+
129
+ @keyframes frg-modal-enter {
130
+ from {
131
+ opacity: 0;
132
+ transform: translateY(6px);
133
+ }
134
+ to {
135
+ opacity: 1;
136
+ transform: translateY(0);
137
+ }
138
+ }
139
+ }
@@ -0,0 +1,60 @@
1
+ import { Component } from '@angular/core';
2
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
3
+ import { By } from '@angular/platform-browser';
4
+ import { ModalCloseEvent } from './modal.type';
5
+ import { ModalComponent } from './modal.component';
6
+
7
+ @Component({
8
+ standalone: true,
9
+ imports: [ModalComponent],
10
+ template: `
11
+ <frg-modal [(open)]="open" (closed)="onClosed($event)">
12
+ <div frg-modal-head>
13
+ <h5 id="modal-title">Title</h5>
14
+ </div>
15
+ <div frg-modal-body>Body</div>
16
+ <div frg-modal-footer>Footer</div>
17
+ </frg-modal>
18
+ `
19
+ })
20
+ class TestHostComponent {
21
+ open = true;
22
+ closedEvent: ModalCloseEvent | null = null;
23
+
24
+ onClosed(event: ModalCloseEvent): void {
25
+ this.open = false;
26
+ this.closedEvent = event;
27
+ }
28
+ }
29
+
30
+ describe('ModalComponent', () => {
31
+ let fixture: ComponentFixture<TestHostComponent>;
32
+
33
+ beforeEach(async () => {
34
+ await TestBed.configureTestingModule({
35
+ imports: [TestHostComponent]
36
+ }).compileComponents();
37
+
38
+ fixture = TestBed.createComponent(TestHostComponent);
39
+ });
40
+
41
+ it('renders header, body, and footer slots when open', () => {
42
+ fixture.detectChanges();
43
+
44
+ expect(fixture.debugElement.query(By.css('.frg-modal__header'))).toBeTruthy();
45
+ expect(fixture.debugElement.query(By.css('.frg-modal__body'))?.nativeElement.textContent).toContain('Body');
46
+ expect(fixture.debugElement.query(By.css('.frg-modal__footer'))?.nativeElement.textContent).toContain('Footer');
47
+ });
48
+
49
+ it('closes on close button click and emits reason', () => {
50
+ fixture.detectChanges();
51
+
52
+ const closeBtn = fixture.debugElement.query(By.css('.frg-modal__close-btn'));
53
+ closeBtn.nativeElement.click();
54
+ fixture.detectChanges();
55
+
56
+ expect(fixture.componentInstance.open).toBeFalse();
57
+ expect(fixture.componentInstance.closedEvent?.reason).toBe('close-button');
58
+ expect(fixture.debugElement.query(By.css('.frg-modal'))).toBeNull();
59
+ });
60
+ });
@@ -0,0 +1,83 @@
1
+ import { NgClass } from '@angular/common';
2
+ import { Component, EventEmitter, HostListener, Input, OnChanges, OnDestroy, Output, SimpleChanges } from '@angular/core';
3
+
4
+ import { ModalCloseEvent, TModalCloseReason, TModalSize } from './modal.type';
5
+
6
+ @Component({
7
+ selector: 'frg-modal',
8
+ imports: [NgClass],
9
+ templateUrl: './modal.component.html',
10
+ styleUrl: './modal.component.scss'
11
+ })
12
+ export class ModalComponent implements OnChanges, OnDestroy {
13
+ @Input() open: boolean = false;
14
+ @Input() size: TModalSize = 'medium';
15
+ @Input() closeOnBackdrop: boolean = true;
16
+ @Input() closeOnEscape: boolean = true;
17
+ @Input() hasCloseButton: boolean = true;
18
+ @Input() hasHeader: boolean = true;
19
+ @Input() hasFooter: boolean = true;
20
+ @Input() lockBodyScroll: boolean = true;
21
+ @Input() ariaLabel: string = 'Dialog';
22
+ @Input() ariaLabelledBy: string | null = null;
23
+ @Input() ariaDescribedBy: string | null = null;
24
+
25
+ @Output() closed = new EventEmitter<ModalCloseEvent>();
26
+
27
+ get modalClassMap() {
28
+ return {
29
+ 'frg-modal__size-small': this.size === 'small',
30
+ 'frg-modal__size-medium': this.size === 'medium',
31
+ 'frg-modal__size-large': this.size === 'large',
32
+ };
33
+ }
34
+
35
+ get showHeader(): boolean {
36
+ return this.hasHeader || this.hasCloseButton;
37
+ }
38
+
39
+ public ngOnChanges(changes: SimpleChanges): void {
40
+ if (changes['open'] || changes['lockBodyScroll']) {
41
+ this.toggleBodyScroll(this.open && this.lockBodyScroll);
42
+ }
43
+ }
44
+
45
+ public ngOnDestroy(): void {
46
+ this.toggleBodyScroll(false);
47
+ }
48
+
49
+ protected onBackdropClick(): void {
50
+ if (!this.closeOnBackdrop) {
51
+ return;
52
+ }
53
+ this.requestClose('backdrop');
54
+ }
55
+
56
+ protected onCloseClick(): void {
57
+ this.requestClose('close-button');
58
+ }
59
+
60
+ @HostListener('document:keydown', ['$event'])
61
+ onKeydown(event: KeyboardEvent): void {
62
+ if (!this.open || !this.closeOnEscape) {
63
+ return;
64
+ }
65
+
66
+ if (event.key === 'Escape') {
67
+ event.preventDefault();
68
+ this.requestClose('escape');
69
+ }
70
+ }
71
+
72
+ private requestClose(reason: TModalCloseReason): void {
73
+ if (!this.open) {
74
+ return;
75
+ }
76
+
77
+ this.closed.emit({ reason });
78
+ }
79
+
80
+ private toggleBodyScroll(disable: boolean): void {
81
+ document.body.style.overflow = disable ? 'hidden' : '';
82
+ }
83
+ }
@@ -0,0 +1,9 @@
1
+ import { TBaseSize } from '../../types/base.types';
2
+
3
+ export type TModalSize = TBaseSize;
4
+
5
+ export type TModalCloseReason = 'backdrop' | 'close-button' | 'escape';
6
+
7
+ export interface ModalCloseEvent {
8
+ reason: TModalCloseReason;
9
+ }
@@ -0,0 +1,79 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { By } from '@angular/platform-browser';
3
+ import { BlobMorphComponent } from './blob-moprh.component';
4
+ import { SpinnerComponent } from '../../loader/spinner/spinner.component';
5
+
6
+ describe('BlobMorphComponent', () => {
7
+ let fixture: ComponentFixture<BlobMorphComponent>;
8
+ let component: BlobMorphComponent;
9
+
10
+ beforeEach(async () => {
11
+ await TestBed.configureTestingModule({
12
+ imports: [BlobMorphComponent, SpinnerComponent]
13
+ }).compileComponents();
14
+
15
+ fixture = TestBed.createComponent(BlobMorphComponent);
16
+ component = fixture.componentInstance;
17
+ });
18
+
19
+ it('renders an image when imageUrl is provided', () => {
20
+ component.imageUrl = 'https://example.com/image.jpg';
21
+
22
+ fixture.detectChanges();
23
+
24
+ const imageEl = fixture.debugElement.query(By.css('image'));
25
+ const rectEl = fixture.debugElement.query(By.css('rect'));
26
+
27
+ expect(imageEl).toBeTruthy();
28
+ expect(rectEl).toBeNull();
29
+ });
30
+
31
+ it('renders a fallback rect when no imageUrl is provided', () => {
32
+ component.imageUrl = null;
33
+ component.fillColor = '#123456';
34
+
35
+ fixture.detectChanges();
36
+
37
+ const rectEl = fixture.debugElement.query(By.css('rect'));
38
+ expect(rectEl).toBeTruthy();
39
+ expect(rectEl.attributes['fill']).toBe('#123456');
40
+ });
41
+
42
+ it('shows a spinner until load completes', () => {
43
+ component.imageUrl = 'https://example.com/image.jpg';
44
+
45
+ fixture.detectChanges();
46
+
47
+ expect(fixture.debugElement.query(By.css('frg-spinner'))).toBeTruthy();
48
+
49
+ component.onLoadEvent();
50
+ fixture.detectChanges();
51
+
52
+ expect((component as any).isLoaded).toBeTrue();
53
+ expect(fixture.debugElement.query(By.css('frg-spinner'))).toBeNull();
54
+ });
55
+
56
+ it('emits loadEvent on image load', () => {
57
+ const emitSpy = spyOn(component.loadEvent, 'emit');
58
+
59
+ component.onLoadEvent();
60
+
61
+ expect(emitSpy).toHaveBeenCalled();
62
+ });
63
+
64
+ it('does not log an error when morph paths exist', () => {
65
+ const errorSpy = spyOn(console, 'error');
66
+ component.duration = 1234;
67
+ component.clipId = 'test-clip';
68
+
69
+ fixture.detectChanges();
70
+
71
+ expect(errorSpy).not.toHaveBeenCalled();
72
+ });
73
+
74
+ it('generates a valid SVG path string', () => {
75
+ const path = (component as any).generateRandomPath(6, 40, 10) as string;
76
+ expect(path.startsWith('M')).toBeTrue();
77
+ expect(path.trim().endsWith('Z')).toBeTrue();
78
+ });
79
+ });