@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,44 +0,0 @@
1
- @if (!isClosed) {
2
- <div
3
- class="frg-card"
4
- [ngClass]="{
5
- 'frg-card__primary': styleType === 'primary',
6
- 'frg-card__secondary': styleType === 'secondary',
7
- 'frg-card__tertiary': styleType === 'tertiary',
8
- 'frg-card__dark': styleType === 'dark',
9
- 'frg-card__light': styleType === 'light',
10
- 'frg-card__success': styleType === 'success',
11
- 'frg-card__warning': styleType === 'warning',
12
- 'frg-card__danger': styleType === 'danger',
13
- 'frg-card__outline-primary': styleType === 'outline-primary',
14
- 'frg-card__outline-secondary': styleType === 'outline-secondary',
15
- 'frg-card__outline-tertiary': styleType === 'outline-tertiary',
16
- 'frg-card__outline-dark': styleType === 'outline-dark',
17
- 'frg-card__outline-light': styleType === 'outline-light',
18
- 'frg-card__outline-success': styleType === 'outline-success',
19
- 'frg-card__outline-warning': styleType === 'outline-warning',
20
- 'frg-card__outline-danger': styleType === 'outline-danger'
21
- }"
22
- >
23
- @if(hasCloseCard) {
24
- <button
25
- type="button"
26
- class="frg-card__close-btn"
27
- (click)="onCloseCard()"
28
- aria-label="Close"
29
- >
30
- &times;
31
- </button>
32
- }
33
-
34
- <div class="frg-card__head">
35
- <ng-content select="[frg-card-head]"></ng-content>
36
- </div>
37
- <div class="frg-card__body">
38
- <ng-content select="[frg-card-body]"></ng-content>
39
- </div>
40
- <div class="frg-card__footer">
41
- <ng-content select="[frg-card-footer]"></ng-content>
42
- </div>
43
- </div>
44
- }
@@ -1,114 +0,0 @@
1
- @use '../../../../assets/styles/scss/variables' as *;
2
-
3
- :host {
4
- .frg-card {
5
- position: relative;
6
- margin-top: 0;
7
- border-radius: 0.25rem;
8
- padding: 20px 1.5rem;
9
- box-shadow:
10
- 0 1px 3px 0 rgba(0, 0, 0, 0.1),
11
- 0 1px 2px -1px rgba(0, 0, 0, 0.1);
12
- transition: all 0.15s ease-in-out;
13
- color: $color-dark;
14
- background-color: $color-light;
15
- font-family: $base-font;
16
-
17
- &__primary {
18
- color: $color-light;
19
- background-color: $color-primary;
20
- }
21
-
22
- &__secondary {
23
- color: $color-light;
24
- background-color: $color-secondary;
25
- }
26
-
27
- &__tertiary {
28
- color: $color-light;
29
- background-color: $color-tertiary;
30
- }
31
-
32
- &__danger {
33
- color: $color-light;
34
- background-color: $color-danger;
35
- }
36
-
37
- &__warning {
38
- color: $color-light;
39
- background-color: $color-warning;
40
- }
41
-
42
- &__success {
43
- color: $color-light;
44
- background-color: $color-success;
45
- }
46
-
47
- // Outline variants
48
- &__outline-primary {
49
- color: $color-dark;
50
- background-color: $color-light;
51
- border: 2px solid $color-primary;
52
- }
53
-
54
- &__outline-secondary {
55
- color: $color-dark;
56
- background-color: $color-light;
57
- border: 2px solid $color-secondary;
58
- }
59
-
60
- &__outline-tertiary {
61
- color: $color-dark;
62
- background-color: $color-light;
63
- border: 2px solid $color-tertiary;
64
- }
65
-
66
- &__outline-danger {
67
- color: $color-dark;
68
- background-color: $color-light;
69
- border: 2px solid $color-danger;
70
- }
71
-
72
- &__outline-warning {
73
- color: $color-dark;
74
- background-color: $color-light;
75
- border: 2px solid $color-warning;
76
- }
77
-
78
- &__outline-success {
79
- color: $color-dark;
80
- background-color: $color-light;
81
- border: 2px solid $color-success;
82
- }
83
-
84
- &__head {
85
- display: flex;
86
- justify-content: space-between;
87
- align-items: center;
88
- }
89
-
90
- &__close-btn {
91
- position: absolute;
92
- top: .5rem;
93
- right: .5rem;
94
- background: transparent;
95
- border: none;
96
- color: $color-dark-soft;
97
- font-size: 1.5rem;
98
- line-height: 1;
99
- cursor: pointer;
100
- padding: 0.25rem 0.5rem;
101
- border-radius: 50%;
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- z-index: 2;
106
-
107
- &:hover,
108
- &:focus {
109
- color: $color-dark;
110
- outline: none;
111
- }
112
- }
113
- }
114
- }
@@ -1,65 +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 { CardComponent } from './card.component';
5
-
6
- @Component({
7
- standalone: true,
8
- imports: [CardComponent],
9
- template: `
10
- <frg-card [styleType]="styleType" [hasCloseCard]="hasCloseCard" (closeCard)="closed = true">
11
- <div frg-card-head>Head</div>
12
- <div frg-card-body>Body</div>
13
- <div frg-card-footer>Footer</div>
14
- </frg-card>
15
- `
16
- })
17
- class TestHostComponent {
18
- styleType: any = 'default';
19
- hasCloseCard = false;
20
- closed = false;
21
- }
22
-
23
- describe('CardComponent', () => {
24
- let fixture: ComponentFixture<TestHostComponent>;
25
-
26
- beforeEach(async () => {
27
- await TestBed.configureTestingModule({
28
- imports: [TestHostComponent]
29
- }).compileComponents();
30
-
31
- fixture = TestBed.createComponent(TestHostComponent);
32
- });
33
-
34
- it('renders projected head, body, and footer content', () => {
35
- fixture.detectChanges();
36
-
37
- expect(fixture.debugElement.query(By.css('.frg-card__head'))?.nativeElement.textContent).toContain('Head');
38
- expect(fixture.debugElement.query(By.css('.frg-card__body'))?.nativeElement.textContent).toContain('Body');
39
- expect(fixture.debugElement.query(By.css('.frg-card__footer'))?.nativeElement.textContent).toContain('Footer');
40
- });
41
-
42
- it('applies style classes based on styleType', () => {
43
- fixture.componentInstance.styleType = 'primary';
44
-
45
- fixture.detectChanges();
46
-
47
- const card = fixture.debugElement.query(By.css('.frg-card'));
48
- expect(card.nativeElement.classList).toContain('frg-card__primary');
49
- });
50
-
51
- it('shows and triggers close behavior when enabled', () => {
52
- fixture.componentInstance.hasCloseCard = true;
53
-
54
- fixture.detectChanges();
55
-
56
- const closeBtn = fixture.debugElement.query(By.css('.frg-card__close-btn'));
57
- expect(closeBtn).toBeTruthy();
58
-
59
- closeBtn.nativeElement.click();
60
- fixture.detectChanges();
61
-
62
- expect(fixture.componentInstance.closed).toBeTrue();
63
- expect(fixture.debugElement.query(By.css('.frg-card'))).toBeNull();
64
- });
65
- });
@@ -1,21 +0,0 @@
1
- import { NgClass } from '@angular/common';
2
- import { Component, EventEmitter, Input, Output } from '@angular/core';
3
- import { TCardStyle } from './card.type';
4
-
5
- @Component({
6
- selector: 'frg-card',
7
- imports: [NgClass],
8
- templateUrl: './card.component.html',
9
- styleUrl: './card.component.scss'
10
- })
11
- export class CardComponent {
12
- @Input() styleType: TCardStyle = 'default';
13
- @Input() hasCloseCard: boolean = false;
14
- @Output() closeCard = new EventEmitter<void>();
15
- isClosed = false;
16
-
17
- onCloseCard() {
18
- this.closeCard.emit();
19
- this.isClosed = true;
20
- }
21
- }
@@ -1,3 +0,0 @@
1
- import { TBaseStyle } from '../../types/base.types';
2
-
3
- export type TCardStyle = TBaseStyle;
@@ -1,55 +0,0 @@
1
- @if (config) {
2
- <div #container class="code-block">
3
- @if (header) {
4
- <div class="code-block__header">
5
- <span class="code-block__header__title">{{ title }}</span>
6
- @if (showCopyButton) {
7
- <button
8
- type="button"
9
- class="code-block__header__action"
10
- (click)="copyToClipboard()"
11
- [attr.aria-label]="copied ? copiedLabel : copyLabel"
12
- >
13
- <span class="code-block__header__action-content" [class.is-copied]="copied">
14
- @if (copied) {
15
- <span class="code-block__header__action-label">{{ copiedLabel }}</span>
16
- } @else {
17
- <span class="fa-regular fa-copy" aria-hidden="true"></span>
18
- }
19
- </span>
20
- </button>
21
- }
22
- </div>
23
- }
24
-
25
- @if (body) {
26
- <div class="code-block__body">
27
- @switch (type) {
28
- @case ('text') {
29
- <pre
30
- #codeElement
31
- class="language-{{ language || 'typescript' }}"
32
- [attr.data-line]="highlightLines"
33
- >
34
- <code [textContent]="content"></code>
35
- </pre>
36
- }
37
- @case ('component') {
38
- @if (component) {
39
- <ng-template
40
- addComponent
41
- [component]="component"
42
- [inputComponent]="inputs"
43
- ></ng-template>
44
- }
45
- }
46
- }
47
- </div>
48
- }
49
- @if (config.footer?.text) {
50
- <div class="code-block__footer">
51
- {{ config.footer?.text }}
52
- </div>
53
- }
54
- </div>
55
- }
@@ -1,122 +0,0 @@
1
- @use './../../../../assets/styles/scss/variables' as *;
2
-
3
- :host {
4
- display: block;
5
-
6
- .code-block {
7
- display: inline-block;
8
- position: relative;
9
- background: $color-dark;
10
- box-shadow: $box-shadow-sm;
11
- border-radius: .25rem;
12
- min-width: 0; // Prevent overflow
13
- max-width: 100%;
14
-
15
- &__header {
16
- display: flex;
17
- justify-content: space-between;
18
- align-items: center;
19
- border-radius: .25rem .25rem 0 0;
20
- gap: 0.25rem;
21
- width: 100%;
22
- height: 1.5rem;
23
- background: $color-dark-neutral;
24
- box-shadow: $box-shadow-sm;
25
-
26
- &__title {
27
- font-size: 0.7rem;
28
- padding: 0 0.5rem;
29
- font-weight: 300;
30
- color: $color-light;
31
- }
32
-
33
- &__action {
34
- border: 0;
35
- background: transparent;
36
- color: $color-light;
37
- font-size: 0.7rem;
38
- font-weight: 400;
39
- cursor: pointer;
40
- display: inline-flex;
41
- align-items: center;
42
- gap: 0.25rem;
43
- }
44
-
45
- &__action:hover,
46
- &__action:focus-visible {
47
- color: $color-light-soft;
48
- }
49
-
50
- &__action-content {
51
- display: inline-flex;
52
- align-items: center;
53
- justify-content: center;
54
- min-width: 1.25rem;
55
- transition: transform 0.2s ease, opacity 0.2s ease;
56
- }
57
-
58
- &__action-content.is-copied {
59
- animation: code-block-copy-pop 0.35s ease;
60
- }
61
-
62
- &__action-label {
63
- letter-spacing: 0.02em;
64
- }
65
- }
66
-
67
- &__body {
68
- color: $color-light;
69
- text-align: left;
70
- font-size: 0.75rem;
71
- padding: 0.5rem 1rem;
72
- white-space: pre;
73
- }
74
-
75
- &__footer {
76
- padding: 0.5rem 1rem;
77
- font-size: 0.6rem;
78
- color: $color-light-soft;
79
- background: $color-dark-neutral;
80
- border-radius: 0 0 .25rem .25rem;
81
- }
82
-
83
- pre[class*='language-'] {
84
- padding: 0;
85
- margin: 0;
86
- background: none;
87
- box-shadow: none;
88
- }
89
- }
90
-
91
- @keyframes code-block-copy-pop {
92
- 0% {
93
- transform: scale(0.85);
94
- opacity: 0.6;
95
- }
96
- 60% {
97
- transform: scale(1.08);
98
- opacity: 1;
99
- }
100
- 100% {
101
- transform: scale(1);
102
- opacity: 1;
103
- }
104
- }
105
- }
106
- pre.hljs {
107
- scrollbar-width: thin;
108
- scrollbar-color: $color-light-soft transparent;
109
- }
110
-
111
- pre.hljs::-webkit-scrollbar-track {
112
- background: transparent;
113
- }
114
-
115
- pre.hljs::-webkit-scrollbar-thumb {
116
- background-color: $color-light-soft;
117
- border-radius: 6px;
118
- }
119
-
120
- pre.hljs::-webkit-scrollbar-button {
121
- display: none;
122
- }
@@ -1,81 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { By } from '@angular/platform-browser';
3
- import hljs from 'highlight.js';
4
- import { CodeBlockComponent } from './code-block.component';
5
- import { CodeBlockConfig } from './code-block.interface';
6
-
7
- describe('CodeBlockComponent', () => {
8
- let fixture: ComponentFixture<CodeBlockComponent>;
9
- let component: CodeBlockComponent;
10
-
11
- beforeEach(async () => {
12
- await TestBed.configureTestingModule({
13
- imports: [CodeBlockComponent]
14
- }).compileComponents();
15
-
16
- fixture = TestBed.createComponent(CodeBlockComponent);
17
- component = fixture.componentInstance;
18
- });
19
-
20
- it('renders the header title when provided', () => {
21
- component.config = {
22
- header: { title: 'Example' },
23
- body: { type: 'text', content: 'const a = 1;' }
24
- } as CodeBlockConfig;
25
-
26
- fixture.detectChanges();
27
-
28
- const title = fixture.debugElement.query(By.css('.code-block__header__title'));
29
- expect(title.nativeElement.textContent).toContain('Example');
30
- });
31
-
32
- it('renders the footer text when provided', () => {
33
- component.config = {
34
- header: { title: 'Example' },
35
- body: { type: 'text', content: 'const a = 1;' },
36
- footer: { text: 'Footer text' }
37
- } as CodeBlockConfig;
38
-
39
- fixture.detectChanges();
40
-
41
- const footer = fixture.debugElement.query(By.css('.code-block__footer'));
42
- expect(footer.nativeElement.textContent).toContain('Footer text');
43
- });
44
-
45
- it('highlights code after view init for text body', () => {
46
- const highlightSpy = spyOn(hljs, 'highlightElement').and.callThrough();
47
-
48
- component.config = {
49
- header: { title: 'Example' },
50
- body: { type: 'text', content: 'const a = 1;', language: 'typescript' }
51
- } as CodeBlockConfig;
52
-
53
- fixture.detectChanges();
54
-
55
- expect(highlightSpy).toHaveBeenCalled();
56
- });
57
-
58
- it('adds line numbers when configured', () => {
59
- const highlightSpy = spyOn(hljs, 'highlightElement').and.callThrough();
60
-
61
- component.config = {
62
- header: { title: 'Example' },
63
- body: { type: 'text', content: 'first\nsecond', hasNumberLine: true }
64
- } as CodeBlockConfig;
65
-
66
- fixture.detectChanges();
67
-
68
- const pre = fixture.debugElement.query(By.css('pre')).nativeElement as HTMLElement;
69
- expect(pre.textContent).toContain('1 | first');
70
- expect(pre.textContent).toContain('2 | second');
71
- expect(highlightSpy).toHaveBeenCalled();
72
- });
73
-
74
- it('does not render when config is undefined', () => {
75
- component.config = undefined;
76
-
77
- fixture.detectChanges();
78
-
79
- expect(fixture.debugElement.query(By.css('.code-block'))).toBeNull();
80
- });
81
- });