@tacdaed/fragments 1.0.0-beta.4 → 1.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +16 -11
  2. package/assets/styles/scss/_all.scss +0 -1
  3. package/fesm2022/tacdaed-fragments.mjs +8928 -0
  4. package/index.d.ts +3929 -0
  5. package/package.json +34 -22
  6. package/assets/resources/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth_wght.ttf +0 -0
  7. package/assets/resources/fonts/OpenSans/OpenSans-VariableFont_wdth_wght.ttf +0 -0
  8. package/assets/resources/fonts/Roboto/Roboto-Black.ttf +0 -0
  9. package/assets/resources/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  10. package/assets/resources/fonts/Roboto/Roboto-Bold.ttf +0 -0
  11. package/assets/resources/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  12. package/assets/resources/fonts/Roboto/Roboto-Italic.ttf +0 -0
  13. package/assets/resources/fonts/Roboto/Roboto-Light.ttf +0 -0
  14. package/assets/resources/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  15. package/assets/resources/fonts/Roboto/Roboto-Medium.ttf +0 -0
  16. package/assets/resources/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  17. package/assets/resources/fonts/Roboto/Roboto-Regular.ttf +0 -0
  18. package/assets/resources/fonts/Roboto/Roboto-Thin.ttf +0 -0
  19. package/assets/resources/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  20. package/assets/styles/scss/_fonts.scss +0 -122
  21. package/ng-package.json +0 -20
  22. package/src/lib/components/accordion/accordion.component.html +0 -103
  23. package/src/lib/components/accordion/accordion.component.scss +0 -382
  24. package/src/lib/components/accordion/accordion.component.spec.ts +0 -147
  25. package/src/lib/components/accordion/accordion.component.ts +0 -211
  26. package/src/lib/components/accordion/accordion.type.ts +0 -82
  27. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -43
  28. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -112
  29. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -33
  30. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -103
  31. package/src/lib/components/breadcrumb/breadcrumb.interface.ts +0 -7
  32. package/src/lib/components/button/button.component.html +0 -57
  33. package/src/lib/components/button/button.component.scss +0 -445
  34. package/src/lib/components/button/button.component.spec.ts +0 -99
  35. package/src/lib/components/button/button.component.ts +0 -143
  36. package/src/lib/components/button/button.type.ts +0 -7
  37. package/src/lib/components/card/card.component.html +0 -44
  38. package/src/lib/components/card/card.component.scss +0 -114
  39. package/src/lib/components/card/card.component.spec.ts +0 -65
  40. package/src/lib/components/card/card.component.ts +0 -21
  41. package/src/lib/components/card/card.type.ts +0 -3
  42. package/src/lib/components/code-block/code-block.component.html +0 -55
  43. package/src/lib/components/code-block/code-block.component.scss +0 -122
  44. package/src/lib/components/code-block/code-block.component.spec.ts +0 -81
  45. package/src/lib/components/code-block/code-block.component.ts +0 -302
  46. package/src/lib/components/code-block/code-block.interface.ts +0 -28
  47. package/src/lib/components/code-block/code-block.type.ts +0 -73
  48. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.html +0 -14
  49. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.scss +0 -20
  50. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.spec.ts +0 -38
  51. package/src/lib/components/decorative/sparkle-field/sparkle-field.component.ts +0 -181
  52. package/src/lib/components/input/input-base.ts +0 -187
  53. package/src/lib/components/input/input-calendar/input-calendar.component.html +0 -76
  54. package/src/lib/components/input/input-calendar/input-calendar.component.scss +0 -179
  55. package/src/lib/components/input/input-calendar/input-calendar.component.spec.ts +0 -44
  56. package/src/lib/components/input/input-calendar/input-calendar.component.ts +0 -299
  57. package/src/lib/components/input/input-checkbox/input-checkbox.component.html +0 -37
  58. package/src/lib/components/input/input-checkbox/input-checkbox.component.scss +0 -128
  59. package/src/lib/components/input/input-checkbox/input-checkbox.component.spec.ts +0 -43
  60. package/src/lib/components/input/input-checkbox/input-checkbox.component.ts +0 -112
  61. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.html +0 -43
  62. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.scss +0 -140
  63. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.spec.ts +0 -62
  64. package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.ts +0 -136
  65. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.html +0 -81
  66. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.scss +0 -228
  67. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.spec.ts +0 -62
  68. package/src/lib/components/input/input-clock-picker/input-clock-picker.component.ts +0 -178
  69. package/src/lib/components/input/input-consts.ts +0 -132
  70. package/src/lib/components/input/input-date/input-date-validators.ts +0 -41
  71. package/src/lib/components/input/input-date/input-date.component.html +0 -41
  72. package/src/lib/components/input/input-date/input-date.component.scss +0 -95
  73. package/src/lib/components/input/input-date/input-date.component.spec.ts +0 -43
  74. package/src/lib/components/input/input-date/input-date.component.ts +0 -359
  75. package/src/lib/components/input/input-date-time/input-date-time.component.html +0 -70
  76. package/src/lib/components/input/input-date-time/input-date-time.component.scss +0 -133
  77. package/src/lib/components/input/input-date-time/input-date-time.component.spec.ts +0 -36
  78. package/src/lib/components/input/input-date-time/input-date-time.component.ts +0 -387
  79. package/src/lib/components/input/input-file-upload/input-file-upload.component.html +0 -89
  80. package/src/lib/components/input/input-file-upload/input-file-upload.component.scss +0 -171
  81. package/src/lib/components/input/input-file-upload/input-file-upload.component.spec.ts +0 -43
  82. package/src/lib/components/input/input-file-upload/input-file-upload.component.ts +0 -351
  83. package/src/lib/components/input/input-interface.ts +0 -8
  84. package/src/lib/components/input/input-number/input-number-validators.ts +0 -0
  85. package/src/lib/components/input/input-number/input-number.component.html +0 -51
  86. package/src/lib/components/input/input-number/input-number.component.scss +0 -140
  87. package/src/lib/components/input/input-number/input-number.component.spec.ts +0 -44
  88. package/src/lib/components/input/input-number/input-number.component.ts +0 -343
  89. package/src/lib/components/input/input-radio-group/input-radio-group.component.html +0 -44
  90. package/src/lib/components/input/input-radio-group/input-radio-group.component.scss +0 -139
  91. package/src/lib/components/input/input-radio-group/input-radio-group.component.spec.ts +0 -58
  92. package/src/lib/components/input/input-radio-group/input-radio-group.component.ts +0 -132
  93. package/src/lib/components/input/input-slider/input-slider.component.html +0 -111
  94. package/src/lib/components/input/input-slider/input-slider.component.scss +0 -203
  95. package/src/lib/components/input/input-slider/input-slider.component.spec.ts +0 -46
  96. package/src/lib/components/input/input-slider/input-slider.component.ts +0 -410
  97. package/src/lib/components/input/input-text/input-text-validators.ts +0 -67
  98. package/src/lib/components/input/input-text/input-text.component.html +0 -71
  99. package/src/lib/components/input/input-text/input-text.component.scss +0 -118
  100. package/src/lib/components/input/input-text/input-text.component.spec.ts +0 -55
  101. package/src/lib/components/input/input-text/input-text.component.ts +0 -215
  102. package/src/lib/components/input/input-time/input-time-validators.ts +0 -42
  103. package/src/lib/components/input/input-time/input-time.component.html +0 -92
  104. package/src/lib/components/input/input-time/input-time.component.scss +0 -191
  105. package/src/lib/components/input/input-time/input-time.component.spec.ts +0 -39
  106. package/src/lib/components/input/input-time/input-time.component.ts +0 -691
  107. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.html +0 -36
  108. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.scss +0 -121
  109. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.spec.ts +0 -54
  110. package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.ts +0 -117
  111. package/src/lib/components/input/input-type.ts +0 -18
  112. package/src/lib/components/input/input-validation/input-validation.component.html +0 -19
  113. package/src/lib/components/input/input-validation/input-validation.component.scss +0 -39
  114. package/src/lib/components/input/input-validation/input-validation.component.spec.ts +0 -45
  115. package/src/lib/components/input/input-validation/input-validation.component.ts +0 -13
  116. package/src/lib/components/input/input.pipe.ts +0 -14
  117. package/src/lib/components/layout/container/container.component.html +0 -1
  118. package/src/lib/components/layout/container/container.component.scss +0 -33
  119. package/src/lib/components/layout/container/container.component.ts +0 -32
  120. package/src/lib/components/layout/container/container.type.ts +0 -1
  121. package/src/lib/components/layout/divider/divider.component.html +0 -1
  122. package/src/lib/components/layout/divider/divider.component.scss +0 -60
  123. package/src/lib/components/layout/divider/divider.component.ts +0 -38
  124. package/src/lib/components/layout/divider/divider.type.ts +0 -2
  125. package/src/lib/components/layout/section/section.component.html +0 -21
  126. package/src/lib/components/layout/section/section.component.scss +0 -43
  127. package/src/lib/components/layout/section/section.component.ts +0 -33
  128. package/src/lib/components/layout/section/section.type.ts +0 -2
  129. package/src/lib/components/layout/separator/separator.component.html +0 -9
  130. package/src/lib/components/layout/separator/separator.component.scss +0 -52
  131. package/src/lib/components/layout/separator/separator.component.ts +0 -25
  132. package/src/lib/components/layout/separator/separator.type.ts +0 -1
  133. package/src/lib/components/loader/content-blur/content-blur.component.html +0 -13
  134. package/src/lib/components/loader/content-blur/content-blur.component.scss +0 -43
  135. package/src/lib/components/loader/content-blur/content-blur.component.spec.ts +0 -42
  136. package/src/lib/components/loader/content-blur/content-blur.component.ts +0 -34
  137. package/src/lib/components/loader/loader.type.ts +0 -2
  138. package/src/lib/components/loader/progress-bar/progress-bar.component.html +0 -26
  139. package/src/lib/components/loader/progress-bar/progress-bar.component.scss +0 -151
  140. package/src/lib/components/loader/progress-bar/progress-bar.component.spec.ts +0 -47
  141. package/src/lib/components/loader/progress-bar/progress-bar.component.ts +0 -28
  142. package/src/lib/components/loader/progress-bar/progress-bar.type.ts +0 -8
  143. package/src/lib/components/loader/pulse-loader/pulse-loader.component.html +0 -12
  144. package/src/lib/components/loader/pulse-loader/pulse-loader.component.scss +0 -202
  145. package/src/lib/components/loader/pulse-loader/pulse-loader.component.spec.ts +0 -55
  146. package/src/lib/components/loader/pulse-loader/pulse-loader.component.ts +0 -73
  147. package/src/lib/components/loader/pulse-loader/pulse-loader.type.ts +0 -6
  148. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.html +0 -13
  149. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.scss +0 -113
  150. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.spec.ts +0 -37
  151. package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.ts +0 -51
  152. package/src/lib/components/loader/skeleton-loader/skeleton-loader.type.ts +0 -6
  153. package/src/lib/components/loader/spinner/spinner.component.html +0 -20
  154. package/src/lib/components/loader/spinner/spinner.component.scss +0 -137
  155. package/src/lib/components/loader/spinner/spinner.component.spec.ts +0 -43
  156. package/src/lib/components/loader/spinner/spinner.component.ts +0 -32
  157. package/src/lib/components/loader/spinner/spinner.type.ts +0 -6
  158. package/src/lib/components/modal/modal.component.html +0 -47
  159. package/src/lib/components/modal/modal.component.scss +0 -139
  160. package/src/lib/components/modal/modal.component.spec.ts +0 -60
  161. package/src/lib/components/modal/modal.component.ts +0 -83
  162. package/src/lib/components/modal/modal.type.ts +0 -9
  163. package/src/lib/components/morph/blob-moph/blob-moprh.component.spec.ts +0 -79
  164. package/src/lib/components/morph/blob-moph/blob-moprh.component.ts +0 -96
  165. package/src/lib/components/morph/blob-moph/blob-morph.component.html +0 -34
  166. package/src/lib/components/morph/blob-moph/blob-morph.component.scss +0 -7
  167. package/src/lib/components/morph/morph.abstract.ts +0 -13
  168. package/src/lib/components/pagination/pagination.interface.ts +0 -4
  169. package/src/lib/components/pagination/small-pagination/small-pagination.component.html +0 -61
  170. package/src/lib/components/pagination/small-pagination/small-pagination.component.scss +0 -187
  171. package/src/lib/components/pagination/small-pagination/small-pagination.component.spec.ts +0 -88
  172. package/src/lib/components/pagination/small-pagination/small-pagination.component.ts +0 -177
  173. package/src/lib/components/selection-lists/multi-select/multi-select.component.html +0 -170
  174. package/src/lib/components/selection-lists/multi-select/multi-select.component.scss +0 -312
  175. package/src/lib/components/selection-lists/multi-select/multi-select.component.spec.ts +0 -61
  176. package/src/lib/components/selection-lists/multi-select/multi-select.component.ts +0 -372
  177. package/src/lib/components/selection-lists/selection-list/selection-list.component.html +0 -125
  178. package/src/lib/components/selection-lists/selection-list/selection-list.component.scss +0 -267
  179. package/src/lib/components/selection-lists/selection-list/selection-list.component.spec.ts +0 -66
  180. package/src/lib/components/selection-lists/selection-list/selection-list.component.ts +0 -315
  181. package/src/lib/components/selection-lists/selection-lists-base.ts +0 -35
  182. package/src/lib/components/selection-lists/selection-lists-const.ts +0 -17
  183. package/src/lib/components/selection-lists/selection-lists-interface.ts +0 -7
  184. package/src/lib/components/selection-lists/selection-lists.type.ts +0 -1
  185. package/src/lib/components/side-nav/side-nav.component.html +0 -101
  186. package/src/lib/components/side-nav/side-nav.component.scss +0 -295
  187. package/src/lib/components/side-nav/side-nav.component.spec.ts +0 -0
  188. package/src/lib/components/side-nav/side-nav.component.ts +0 -18
  189. package/src/lib/components/side-nav/side-nav.type.ts +0 -28
  190. package/src/lib/components/snackbar/snackbar.component.html +0 -33
  191. package/src/lib/components/snackbar/snackbar.component.scss +0 -195
  192. package/src/lib/components/snackbar/snackbar.component.ts +0 -112
  193. package/src/lib/components/snackbar/snackbar.type.ts +0 -27
  194. package/src/lib/components/status/chip/chip.component.html +0 -51
  195. package/src/lib/components/status/chip/chip.component.scss +0 -149
  196. package/src/lib/components/status/chip/chip.component.spec.ts +0 -62
  197. package/src/lib/components/status/chip/chip.component.ts +0 -83
  198. package/src/lib/components/status/chip/chip.type.ts +0 -42
  199. package/src/lib/components/status/directives/badge/badge.directive.spec.ts +0 -60
  200. package/src/lib/components/status/directives/badge/badge.directive.ts +0 -190
  201. package/src/lib/components/status/directives/badge/badge.interface.ts +0 -19
  202. package/src/lib/components/status/pill/pill.component.html +0 -40
  203. package/src/lib/components/status/pill/pill.component.scss +0 -113
  204. package/src/lib/components/status/pill/pill.component.spec.ts +0 -47
  205. package/src/lib/components/status/pill/pill.component.ts +0 -83
  206. package/src/lib/components/status/pill/pill.type.ts +0 -42
  207. package/src/lib/components/status/status.interface.ts +0 -57
  208. package/src/lib/components/status/status.type.ts +0 -62
  209. package/src/lib/components/status/tag/tag.component.html +0 -39
  210. package/src/lib/components/status/tag/tag.component.scss +0 -140
  211. package/src/lib/components/status/tag/tag.component.spec.ts +0 -47
  212. package/src/lib/components/status/tag/tag.component.ts +0 -83
  213. package/src/lib/components/status/tag/tag.type.ts +0 -42
  214. package/src/lib/components/stepper/stepper.component.html +0 -83
  215. package/src/lib/components/stepper/stepper.component.scss +0 -196
  216. package/src/lib/components/stepper/stepper.component.ts +0 -482
  217. package/src/lib/components/stepper/stepper.type.ts +0 -60
  218. package/src/lib/components/table/table.component.html +0 -438
  219. package/src/lib/components/table/table.component.scss +0 -259
  220. package/src/lib/components/table/table.component.spec.ts +0 -117
  221. package/src/lib/components/table/table.component.ts +0 -215
  222. package/src/lib/components/table/table.enum.ts +0 -4
  223. package/src/lib/components/table/table.function.ts +0 -47
  224. package/src/lib/components/table/table.interface.ts +0 -143
  225. package/src/lib/components/table/table.pipe.ts +0 -62
  226. package/src/lib/components/table/table.type.ts +0 -15
  227. package/src/lib/components/tabs/tabs.component.html +0 -88
  228. package/src/lib/components/tabs/tabs.component.scss +0 -305
  229. package/src/lib/components/tabs/tabs.component.spec.ts +0 -94
  230. package/src/lib/components/tabs/tabs.component.ts +0 -282
  231. package/src/lib/components/tabs/tabs.type.ts +0 -81
  232. package/src/lib/components/title-bar/title-bar.component.html +0 -21
  233. package/src/lib/components/title-bar/title-bar.component.scss +0 -139
  234. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -44
  235. package/src/lib/components/title-bar/title-bar.component.ts +0 -13
  236. package/src/lib/components/toast/toast.component.html +0 -36
  237. package/src/lib/components/toast/toast.component.scss +0 -241
  238. package/src/lib/components/toast/toast.component.ts +0 -165
  239. package/src/lib/components/toast/toast.type.ts +0 -37
  240. package/src/lib/components/toast-stack/toast-stack.component.html +0 -30
  241. package/src/lib/components/toast-stack/toast-stack.component.scss +0 -35
  242. package/src/lib/components/toast-stack/toast-stack.component.ts +0 -51
  243. package/src/lib/consts/country-prefix.ts +0 -244
  244. package/src/lib/directives/tooltip/popover.directive.ts +0 -274
  245. package/src/lib/directives/tooltip/tooltip.directive.spec.ts +0 -86
  246. package/src/lib/directives/tooltip/tooltip.directive.ts +0 -234
  247. package/src/lib/directives/tooltip/tooltip.interface.ts +0 -29
  248. package/src/lib/directives/tooltip/tooltip.type.ts +0 -9
  249. package/src/lib/interfaces/common.interfaces.ts +0 -4
  250. package/src/lib/pipes/chunk.pipe.ts +0 -16
  251. package/src/lib/pipes/safe-html.pipe.ts +0 -14
  252. package/src/lib/pipes/sanitize-html.pipe.ts +0 -23
  253. package/src/lib/types/base.types.ts +0 -23
  254. package/src/lib/types/common.types.ts +0 -98
  255. package/src/lib/types/form.types.ts +0 -5
  256. package/src/lib/utils/common.utils.ts +0 -53
  257. package/src/lib/utils/date.utils.ts +0 -474
  258. package/src/lib/utils/number.utils.ts +0 -16
  259. package/src/lib/utils/uuid.utils.ts +0 -39
  260. package/src/public-api.ts +0 -114
  261. package/tsconfig.lib.json +0 -17
  262. package/tsconfig.lib.prod.json +0 -10
  263. package/tsconfig.spec.json +0 -9
@@ -1,305 +0,0 @@
1
- @use "sass:color";
2
- @use "sass:list";
3
- @use './../../../../assets/styles/scss/variables' as *;
4
-
5
- :host {
6
- display: block;
7
- font-family: $base-font;
8
- }
9
-
10
- .frg-tabs {
11
- display: flex;
12
- flex-direction: column;
13
-
14
- &[data-align='center'] .frg-tabs__list {
15
- justify-content: center;
16
- }
17
-
18
- &[data-align='end'] .frg-tabs__list {
19
- justify-content: flex-end;
20
- }
21
-
22
- &[data-align='stretch'] .frg-tabs__list {
23
- justify-content: stretch;
24
-
25
- .frg-tabs__tab {
26
- flex: 1 1 auto;
27
- text-align: center;
28
- }
29
- }
30
- }
31
-
32
- .frg-tabs__list {
33
- display: flex;
34
- align-items: flex-end;
35
- border-bottom: 1px solid $color-light-soft;
36
- flex-wrap: wrap;
37
- overflow: visible;
38
- }
39
-
40
- .frg-tabs__tab {
41
- position: relative;
42
- display: inline-flex;
43
- align-items: center;
44
- border: none;
45
- background: transparent;
46
- color: $color-dark-soft;
47
- padding: 0.65rem 0.9rem;
48
- border-radius: 0.2rem 0.2rem 0 0;
49
- cursor: pointer;
50
- overflow: hidden;
51
- transition:
52
- color 0.16s ease,
53
- background-color 0.22s ease,
54
- box-shadow 0.22s ease,
55
- transform 0.18s ease;
56
-
57
- &.is-disabled {
58
- opacity: 0.6;
59
- cursor: not-allowed;
60
- }
61
-
62
- &:hover:not(.is-disabled) {
63
- color: $color-dark-neutral;
64
- }
65
-
66
- &:focus-visible {
67
- outline: none;
68
- box-shadow: 0 0 0 2px color.scale($color-primary, $lightness: 35%);
69
- }
70
-
71
- &.is-active {
72
- color: $color-dark;
73
- }
74
-
75
- .frg-tabs__tab-inner {
76
- display: inline-flex;
77
- align-items: center;
78
- }
79
-
80
- .frg-tabs__icon {
81
- min-width: 1.75rem;
82
- height: 1.75rem;
83
- border-radius: 0.35rem;
84
- display: inline-flex;
85
- align-items: center;
86
- justify-content: center;
87
- background-color: color.scale($color-light, $lightness: -3%);
88
- color: $color-dark;
89
- flex-shrink: 0;
90
- margin: 0 0.5rem;
91
- font-weight: 600;
92
- font-size: $font-size-xs;
93
- }
94
-
95
- .frg-tabs__icon-shape {
96
- font-size: $font-size-sm;
97
- line-height: 1;
98
- }
99
-
100
- .frg-tabs__label {
101
- display: flex;
102
- flex-direction: column;
103
- gap: 0.05rem;
104
- text-align: left;
105
- }
106
-
107
- .frg-tabs__label-text {
108
- font-size: $font-size-sm;
109
- font-weight: 600;
110
- line-height: 1.35;
111
- }
112
-
113
- .frg-tabs__label-desc {
114
- color: $color-dark-soft;
115
- font-size: $font-size-2xs;
116
- line-height: 1.3;
117
- }
118
-
119
- .frg-tabs__underline {
120
- position: absolute;
121
- left: 0;
122
- right: 0;
123
- bottom: -1px;
124
- height: 2px;
125
- border-radius: 2px;
126
- background-color: $color-primary;
127
- opacity: 0;
128
- transform: scaleX(0);
129
- transform-origin: left center;
130
- transition:
131
- transform 0.250s cubic-bezier(0.25, 0.8, 0.4, 1),
132
- opacity 0.18s ease;
133
- }
134
-
135
- &::after {
136
- content: '';
137
- position: absolute;
138
- inset: 0;
139
- border-radius: inherit;
140
- background-color: transparent;
141
- z-index: -1;
142
- display: none;
143
- }
144
- }
145
-
146
- .frg-tabs__tab[data-style^='outline-'] {
147
- border-bottom: 2px solid transparent;
148
- margin-bottom: -1px;
149
- }
150
-
151
- .frg-tabs__tab[data-style^='outline-'] .frg-tabs__underline {
152
- display: none;
153
- }
154
-
155
- .frg-tabs.is-animated {
156
- .frg-tabs__panel {
157
- transition: opacity 0.18s ease, transform 0.18s ease;
158
- }
159
- }
160
-
161
- .frg-tabs__panels {
162
- position: relative;
163
- padding-top: 0.85rem;
164
- }
165
-
166
- .frg-tabs__panel {
167
- padding: 0.75rem 0;
168
- color: $color-dark-neutral;
169
- outline: none;
170
- line-height: 1.5;
171
- opacity: 0;
172
- transform: translateY(2px);
173
-
174
- &.is-active {
175
- opacity: 1;
176
- transform: translateY(0);
177
- }
178
-
179
- &:focus-visible {
180
- outline: 2px solid $color-primary;
181
- outline-offset: 2px;
182
- }
183
- }
184
-
185
- .frg-tabs__tab[data-size='small'] {
186
- padding: 0.5rem 0.7rem;
187
-
188
- .frg-tabs__icon {
189
- min-width: 1.5rem;
190
- height: 1.5rem;
191
- border-radius: 0.3rem;
192
- }
193
-
194
- .frg-tabs__label-text {
195
- font-size: $font-size-xs;
196
- }
197
-
198
- .frg-tabs__label-desc {
199
- font-size: $font-size-2xs;
200
- }
201
- }
202
-
203
- .frg-tabs__tab[data-size='large'] {
204
- padding: 0.85rem 1.05rem;
205
-
206
- .frg-tabs__icon {
207
- min-width: 2rem;
208
- height: 2rem;
209
- }
210
-
211
- .frg-tabs__label-text {
212
- font-size: $font-size-md;
213
- }
214
- }
215
-
216
- $tab-colors: (
217
- 'primary': $color-primary,
218
- 'secondary': $color-secondary,
219
- 'tertiary': $color-tertiary,
220
- 'info': $color-info,
221
- 'success': $color-success,
222
- 'warning': $color-warning,
223
- 'danger': $color-danger,
224
- 'dark': $color-dark,
225
- 'light': $color-light,
226
- 'outline-primary': $color-primary,
227
- 'outline-secondary': $color-secondary,
228
- 'outline-tertiary': $color-tertiary,
229
- 'outline-info': $color-info,
230
- 'outline-success': $color-success,
231
- 'outline-warning': $color-warning,
232
- 'outline-danger': $color-danger,
233
- 'outline-dark': $color-dark,
234
- 'outline-light': $color-light-soft,
235
- 'default': $color-dark-neutral
236
- );
237
-
238
- $solid-variants: ('primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'danger', 'dark', 'light', 'default');
239
- $outline-variants: (
240
- 'outline-primary',
241
- 'outline-secondary',
242
- 'outline-tertiary',
243
- 'outline-info',
244
- 'outline-success',
245
- 'outline-warning',
246
- 'outline-danger',
247
- 'outline-dark',
248
- 'outline-light'
249
- );
250
-
251
- @each $variant, $tone in $tab-colors {
252
- .frg-tabs__tab[data-style="#{$variant}"] {
253
- border: none;
254
-
255
- .frg-tabs__underline {
256
- background-color: $tone;
257
- }
258
-
259
- &.is-active {
260
- @if list.index($solid-variants, $variant) {
261
- $fill: if($variant == 'light', color.scale($tone, $lightness: -8%), $tone);
262
- background-color: $fill;
263
- color: if($variant == 'light', $color-dark, $color-light);
264
- border-color: transparent;
265
- box-shadow: inset 0 -2px 0 rgba($tone, 0.28);
266
- .frg-tabs__underline {
267
- opacity: 0;
268
- height: 2px;
269
- transform: scaleX(0);
270
- }
271
- } @else if list.index($outline-variants, $variant) {
272
- background-color: transparent;
273
- border-color: transparent;
274
- border-width: 2px;
275
- color: if($variant == 'outline-light', $color-dark, $tone);
276
- border-bottom: 2px solid $tone;
277
- margin-bottom: -1px;
278
- .frg-tabs__underline {
279
- display: none;
280
- }
281
- .frg-tabs__label-desc {
282
- color: $color-dark-neutral;
283
- }
284
- }
285
-
286
- .frg-tabs__label-desc {
287
- color: if(
288
- list.index($outline-variants, $variant),
289
- $color-dark-neutral,
290
- if($variant == 'light', $color-dark-soft, color.scale($color-light, $lightness: -5%))
291
- );
292
- }
293
-
294
- .frg-tabs__icon {
295
- @if list.index($solid-variants, $variant) {
296
- background-color: color.scale($tone, $lightness: 12%);
297
- color: if($variant == 'light', $color-dark, $color-light);
298
- } @else {
299
- background-color: transparent;
300
- color: if($variant == 'outline-light', $color-dark, $tone);
301
- }
302
- }
303
- }
304
- }
305
- }
@@ -1,94 +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 { TabsComponent } from './tabs.component';
5
- import { TabItem } from './tabs.type';
6
-
7
- const items: TabItem[] = [
8
- { id: 'tab-a', label: 'Alpha', content: 'A' },
9
- { id: 'tab-b', label: 'Beta', content: 'B' },
10
- { id: 'tab-c', label: 'Gamma', content: 'C', disabled: true }
11
- ];
12
-
13
- @Component({
14
- standalone: true,
15
- imports: [TabsComponent],
16
- template: `
17
- <frg-tabs
18
- [items]="items"
19
- [activeId]="activeId"
20
- (activeIdChange)="activeId = $event">
21
- </frg-tabs>
22
- `
23
- })
24
- class TestHostComponent {
25
- items = [...items];
26
- activeId: string | null = null;
27
- }
28
-
29
- describe('TabsComponent', () => {
30
- let fixture: ComponentFixture<TestHostComponent>;
31
-
32
- const getTabs = (): TabsComponent =>
33
- fixture.debugElement.query(By.directive(TabsComponent)).componentInstance as TabsComponent;
34
-
35
- const getTabButtons = () =>
36
- fixture.debugElement.queryAll(By.css('.frg-tabs__tab'));
37
-
38
- beforeEach(async () => {
39
- await TestBed.configureTestingModule({
40
- imports: [TestHostComponent]
41
- }).compileComponents();
42
-
43
- fixture = TestBed.createComponent(TestHostComponent);
44
- });
45
-
46
- it('renders the tab labels', () => {
47
- fixture.detectChanges();
48
-
49
- const labels = fixture.debugElement.queryAll(By.css('.frg-tabs__label-text'));
50
- expect(labels.length).toBe(3);
51
- expect(labels[0].nativeElement.textContent).toContain('Alpha');
52
- expect(labels[1].nativeElement.textContent).toContain('Beta');
53
- });
54
-
55
- it('defaults to the first enabled tab when activeId is null', () => {
56
- fixture.detectChanges();
57
-
58
- const tabs = getTabs();
59
- expect(tabs.activeId as unknown as string).toBe('tab-a');
60
- });
61
-
62
- it('emits changes when a tab is clicked', () => {
63
- const tabs = getTabs();
64
- const changeSpy = spyOn(tabs.changed, 'emit');
65
- fixture.detectChanges();
66
-
67
- const buttons = getTabButtons();
68
- buttons[1].nativeElement.click();
69
-
70
- expect(tabs.activeId).toBe('tab-b');
71
- expect(fixture.componentInstance.activeId).toBe('tab-b');
72
- expect(changeSpy).toHaveBeenCalled();
73
- });
74
-
75
- it('does not activate disabled tabs', () => {
76
- fixture.detectChanges();
77
-
78
- const tabs = getTabs();
79
- const buttons = getTabButtons();
80
- buttons[2].nativeElement.click();
81
-
82
- expect(tabs.activeId).toBe('tab-a');
83
- });
84
-
85
- it('activates tab on Enter keydown', () => {
86
- fixture.detectChanges();
87
-
88
- const tabs = getTabs();
89
- const buttons = getTabButtons();
90
- buttons[1].nativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
91
-
92
- expect(tabs.activeId).toBe('tab-b');
93
- });
94
- });
@@ -1,282 +0,0 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import {
3
- Component,
4
- ContentChild,
5
- ElementRef,
6
- EventEmitter,
7
- Input,
8
- OnChanges,
9
- Output,
10
- QueryList,
11
- SimpleChanges,
12
- TemplateRef,
13
- ViewChildren
14
- } from '@angular/core';
15
- import { TabChangeEvent, TabItem, TabItemContext, TTabSize, TTabStyle } from './tabs.type';
16
-
17
- /**
18
- * TabsComponent
19
- *
20
- * Accessible tabset that supports keyboard navigation, style variants,
21
- * projected templates, and two-way active state management.
22
- */
23
- @Component({
24
- selector: 'frg-tabs',
25
- standalone: true,
26
- imports: [NgTemplateOutlet],
27
- templateUrl: './tabs.component.html',
28
- styleUrl: './tabs.component.scss'
29
- })
30
- export class TabsComponent implements OnChanges {
31
- /**
32
- * Tab definitions rendered by the component.
33
- */
34
- @Input() items: TabItem[] = [];
35
- /**
36
- * Identifier of the currently active tab. Auto-resolved when null.
37
- */
38
- @Input() activeId: string | null = null;
39
- /**
40
- * Visual style applied to tabs when no per-item style is provided.
41
- */
42
- @Input() styleType: TTabStyle = 'default';
43
- /**
44
- * Size variant applied to tabs when no per-item size is provided.
45
- */
46
- @Input() size: TTabSize = 'medium';
47
- /**
48
- * Horizontal alignment of the tab list.
49
- */
50
- @Input() align: 'start' | 'center' | 'end' | 'stretch' = 'start';
51
- /**
52
- * Enables panel fade/slide animations.
53
- */
54
- @Input() animated: boolean = true;
55
- /**
56
- * When true, moves focus to the active panel after selection.
57
- */
58
- @Input() focusPanelOnSelect: boolean = false;
59
-
60
- /**
61
- * Emits whenever the active tab changes (for two-way binding).
62
- */
63
- @Output() activeIdChange = new EventEmitter<string | null>();
64
- /**
65
- * Detailed change event emitted on active tab updates.
66
- */
67
- @Output() changed = new EventEmitter<TabChangeEvent>();
68
-
69
- /**
70
- * Optional projected template for tab labels.
71
- */
72
- @ContentChild('frgTabLabel', { read: TemplateRef }) labelTemplate?: TemplateRef<TabItemContext>;
73
- /**
74
- * Optional projected template for tab panels.
75
- */
76
- @ContentChild('frgTabContent', { read: TemplateRef }) contentTemplate?: TemplateRef<TabItemContext>;
77
- /**
78
- * Optional projected template for tab icons.
79
- */
80
- @ContentChild('frgTabIcon', { read: TemplateRef }) iconTemplate?: TemplateRef<TabItemContext>;
81
-
82
- /**
83
- * References to rendered tab buttons for keyboard focus.
84
- */
85
- @ViewChildren('tabBtn') tabButtons!: QueryList<ElementRef<HTMLButtonElement>>;
86
- /**
87
- * References to rendered panel elements for focus management.
88
- */
89
- @ViewChildren('panelBody') panelBodies!: QueryList<ElementRef<HTMLElement>>;
90
-
91
- /**
92
- * Normalized copy of `items` with generated ids and active flags.
93
- */
94
- viewItems: TabItem[] = [];
95
- /**
96
- * Internal counter used for deterministic id generation.
97
- */
98
- private uidCounter = 0;
99
-
100
- /**
101
- * Syncs inputs into internal view state and resolves active tab.
102
- */
103
- ngOnChanges(changes: SimpleChanges): void {
104
- if (changes['items']) {
105
- this.viewItems = this.normalizeItems(this.items);
106
- const initialActive = this.resolveActiveId(this.activeId);
107
- this.setActiveId(initialActive, false);
108
- }
109
-
110
- if (changes['activeId'] && !changes['activeId'].firstChange) {
111
- this.setActiveId(this.activeId, false);
112
- }
113
- }
114
-
115
- /**
116
- * Determines whether a given tab id matches the current active id.
117
- */
118
- isActive(id?: string | null): boolean {
119
- return !!id && this.activeId === id;
120
- }
121
-
122
- /**
123
- * Builds the DOM id for a tab element.
124
- */
125
- tabId(id: string): string {
126
- return `${id}-tab`;
127
- }
128
-
129
- /**
130
- * Builds the DOM id for a panel element.
131
- */
132
- panelId(id: string): string {
133
- return `${id}-panel`;
134
- }
135
-
136
- /**
137
- * Handles click selection for a tab at the given index.
138
- */
139
- onTabClick(index: number, event: Event): void {
140
- event.preventDefault();
141
- this.selectAt(index);
142
- }
143
-
144
- /**
145
- * Keyboard interaction handler to navigate and activate tabs.
146
- */
147
- onTabKeydown(event: KeyboardEvent, index: number): void {
148
- const key = event.key;
149
- const tabs = this.tabButtons?.toArray() || [];
150
- if (!tabs.length) {
151
- return;
152
- }
153
-
154
- if (key === 'Enter' || key === ' ') {
155
- event.preventDefault();
156
- this.selectAt(index);
157
- return;
158
- }
159
-
160
- if (key === 'ArrowRight' || key === 'ArrowDown') {
161
- event.preventDefault();
162
- this.focusTab((index + 1) % tabs.length);
163
- } else if (key === 'ArrowLeft' || key === 'ArrowUp') {
164
- event.preventDefault();
165
- this.focusTab((index - 1 + tabs.length) % tabs.length);
166
- } else if (key === 'Home') {
167
- event.preventDefault();
168
- this.focusTab(0);
169
- } else if (key === 'End') {
170
- event.preventDefault();
171
- this.focusTab(tabs.length - 1);
172
- }
173
- }
174
-
175
- /**
176
- * Builds a template context for projected templates.
177
- */
178
- buildContext<T = unknown>(item: TabItem<T>, index: number): TabItemContext<T> {
179
- return {
180
- $implicit: item,
181
- item,
182
- index,
183
- active: this.isActive(item.id),
184
- select: () => this.selectAt(index)
185
- };
186
- }
187
-
188
- /**
189
- * Selects the tab at the given index if enabled and different.
190
- */
191
- private selectAt(index: number): void {
192
- const item = this.viewItems[index];
193
- if (!item || item.disabled || !item.id || this.isActive(item.id)) {
194
- return;
195
- }
196
- this.setActiveId(item.id, true, item, index);
197
- }
198
-
199
- /**
200
- * Ensures every tab has an id and returns a new items array.
201
- */
202
- private normalizeItems(items: TabItem[]): TabItem[] {
203
- return (items || []).map((item, index) => ({
204
- ...item,
205
- id: item.id ?? this.generateId(index)
206
- }));
207
- }
208
-
209
- /**
210
- * Generates a deterministic id for tabs lacking one.
211
- */
212
- private generateId(index: number): string {
213
- this.uidCounter += 1;
214
- return `frg-tab-${index}-${this.uidCounter}`;
215
- }
216
-
217
- /**
218
- * Resolves the next active id based on provided preference and availability.
219
- */
220
- private resolveActiveId(candidate: string | null): string | null {
221
- const available = (this.viewItems || []).filter(item => !item.disabled);
222
- if (!available.length) {
223
- return null;
224
- }
225
- if (candidate && available.some(item => item.id === candidate)) {
226
- return candidate;
227
- }
228
- const preselected = available.find(item => item.active && item.id);
229
- if (preselected?.id) {
230
- return preselected.id;
231
- }
232
- return available[0].id ?? null;
233
- }
234
-
235
- /**
236
- * Applies the active id, updates view state, emits events, and manages focus.
237
- */
238
- private setActiveId(nextId: string | null, emit: boolean, item?: TabItem, index?: number): void {
239
- const resolved = this.resolveActiveId(nextId);
240
- this.activeId = resolved;
241
- this.viewItems = this.viewItems.map(viewItem => ({
242
- ...viewItem,
243
- active: resolved ? viewItem.id === resolved : false
244
- }));
245
-
246
- if (emit) {
247
- this.activeIdChange.emit(this.activeId);
248
- this.changed.emit({
249
- id: this.activeId,
250
- index: index ?? this.viewItems.findIndex(viewItem => viewItem.id === this.activeId),
251
- item
252
- });
253
- }
254
-
255
- if (this.focusPanelOnSelect && resolved) {
256
- const targetIndex = index ?? this.viewItems.findIndex(viewItem => viewItem.id === resolved);
257
- if (targetIndex >= 0) {
258
- setTimeout(() => this.focusPanel(targetIndex), 0);
259
- }
260
- }
261
- }
262
-
263
- /**
264
- * Moves focus to the tab at the given index.
265
- */
266
- private focusTab(index: number): void {
267
- const tab = this.tabButtons?.get(index);
268
- if (tab?.nativeElement) {
269
- tab.nativeElement.focus();
270
- }
271
- }
272
-
273
- /**
274
- * Moves focus to the panel at the given index.
275
- */
276
- private focusPanel(index: number): void {
277
- const panel = this.panelBodies?.get(index);
278
- if (panel?.nativeElement) {
279
- panel.nativeElement.focus();
280
- }
281
- }
282
- }