@masmarino/gabarit 1.4.0 → 2.1.0

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 (348) hide show
  1. package/README.md +231 -144
  2. package/accordion/README.md +56 -0
  3. package/alert/README.md +87 -0
  4. package/app-shell/README.md +133 -0
  5. package/auth/README.md +155 -0
  6. package/auth-activate/README.md +119 -0
  7. package/auth-login/README.md +113 -0
  8. package/auth-register/README.md +104 -0
  9. package/auth-reset-password/README.md +120 -0
  10. package/autocomplete/README.md +77 -0
  11. package/avatar/README.md +34 -0
  12. package/avatar-group/README.md +47 -0
  13. package/badge/README.md +177 -0
  14. package/bar-chart/README.md +44 -0
  15. package/breadcrumb/README.md +38 -0
  16. package/button/README.md +175 -0
  17. package/card/README.md +179 -0
  18. package/checkbox/README.md +50 -0
  19. package/checkbox-group/README.md +78 -0
  20. package/confirm-danger-modal/README.md +77 -0
  21. package/copy-button/README.md +90 -0
  22. package/copy-field/README.md +54 -0
  23. package/date-picker/README.md +84 -0
  24. package/description-list/README.md +63 -0
  25. package/dimension-card/README.md +39 -0
  26. package/disclosure/README.md +48 -0
  27. package/divider/README.md +31 -0
  28. package/drawer/README.md +49 -0
  29. package/empty-state/README.md +84 -0
  30. package/fesm2022/masmarino-gabarit-accordion.mjs +243 -0
  31. package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -0
  32. package/fesm2022/masmarino-gabarit-alert.mjs +208 -0
  33. package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -0
  34. package/fesm2022/masmarino-gabarit-app-shell.mjs +378 -0
  35. package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -0
  36. package/fesm2022/masmarino-gabarit-auth-activate.mjs +415 -0
  37. package/fesm2022/masmarino-gabarit-auth-activate.mjs.map +1 -0
  38. package/fesm2022/masmarino-gabarit-auth-login.mjs +467 -0
  39. package/fesm2022/masmarino-gabarit-auth-login.mjs.map +1 -0
  40. package/fesm2022/masmarino-gabarit-auth-register.mjs +457 -0
  41. package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -0
  42. package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +364 -0
  43. package/fesm2022/masmarino-gabarit-auth-reset-password.mjs.map +1 -0
  44. package/fesm2022/masmarino-gabarit-auth.mjs +844 -0
  45. package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -0
  46. package/fesm2022/masmarino-gabarit-autocomplete.mjs +477 -0
  47. package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -0
  48. package/fesm2022/masmarino-gabarit-avatar-group.mjs +199 -0
  49. package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -0
  50. package/fesm2022/masmarino-gabarit-avatar.mjs +107 -0
  51. package/fesm2022/masmarino-gabarit-avatar.mjs.map +1 -0
  52. package/fesm2022/masmarino-gabarit-badge.mjs +449 -0
  53. package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -0
  54. package/fesm2022/masmarino-gabarit-bar-chart.mjs +408 -0
  55. package/fesm2022/masmarino-gabarit-bar-chart.mjs.map +1 -0
  56. package/fesm2022/masmarino-gabarit-breadcrumb.mjs +59 -0
  57. package/fesm2022/masmarino-gabarit-breadcrumb.mjs.map +1 -0
  58. package/fesm2022/masmarino-gabarit-button.mjs +374 -0
  59. package/fesm2022/masmarino-gabarit-button.mjs.map +1 -0
  60. package/fesm2022/masmarino-gabarit-card.mjs +400 -0
  61. package/fesm2022/masmarino-gabarit-card.mjs.map +1 -0
  62. package/fesm2022/masmarino-gabarit-chart.mjs +1289 -0
  63. package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -0
  64. package/fesm2022/masmarino-gabarit-checkbox-group.mjs +335 -0
  65. package/fesm2022/masmarino-gabarit-checkbox-group.mjs.map +1 -0
  66. package/fesm2022/masmarino-gabarit-checkbox.mjs +170 -0
  67. package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -0
  68. package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +387 -0
  69. package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs.map +1 -0
  70. package/fesm2022/masmarino-gabarit-copy-button.mjs +407 -0
  71. package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -0
  72. package/fesm2022/masmarino-gabarit-copy-field.mjs +229 -0
  73. package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -0
  74. package/fesm2022/masmarino-gabarit-date-picker.mjs +1238 -0
  75. package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -0
  76. package/fesm2022/masmarino-gabarit-description-list.mjs +127 -0
  77. package/fesm2022/masmarino-gabarit-description-list.mjs.map +1 -0
  78. package/fesm2022/masmarino-gabarit-dimension-card.mjs +162 -0
  79. package/fesm2022/masmarino-gabarit-dimension-card.mjs.map +1 -0
  80. package/fesm2022/masmarino-gabarit-disclosure.mjs +154 -0
  81. package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -0
  82. package/fesm2022/masmarino-gabarit-divider.mjs +90 -0
  83. package/fesm2022/masmarino-gabarit-divider.mjs.map +1 -0
  84. package/fesm2022/masmarino-gabarit-docs.mjs +21 -11
  85. package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
  86. package/fesm2022/masmarino-gabarit-drawer.mjs +209 -0
  87. package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -0
  88. package/fesm2022/masmarino-gabarit-empty-state.mjs +226 -0
  89. package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -0
  90. package/fesm2022/masmarino-gabarit-file-upload.mjs +335 -0
  91. package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -0
  92. package/fesm2022/masmarino-gabarit-floating-panel.mjs +13 -0
  93. package/fesm2022/masmarino-gabarit-floating-panel.mjs.map +1 -0
  94. package/fesm2022/masmarino-gabarit-format.mjs +345 -0
  95. package/fesm2022/masmarino-gabarit-format.mjs.map +1 -0
  96. package/fesm2022/masmarino-gabarit-funnel-chart.mjs +247 -0
  97. package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -0
  98. package/fesm2022/masmarino-gabarit-gauge-bar.mjs +180 -0
  99. package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -0
  100. package/fesm2022/masmarino-gabarit-git-field.mjs +127 -0
  101. package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -0
  102. package/fesm2022/masmarino-gabarit-icon-marker.mjs +150 -0
  103. package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -0
  104. package/fesm2022/masmarino-gabarit-icon.mjs +308 -0
  105. package/fesm2022/masmarino-gabarit-icon.mjs.map +1 -0
  106. package/fesm2022/masmarino-gabarit-input.mjs +493 -0
  107. package/fesm2022/masmarino-gabarit-input.mjs.map +1 -0
  108. package/fesm2022/masmarino-gabarit-job-graph.mjs +216 -0
  109. package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -0
  110. package/fesm2022/masmarino-gabarit-job-status.mjs +104 -0
  111. package/fesm2022/masmarino-gabarit-job-status.mjs.map +1 -0
  112. package/fesm2022/masmarino-gabarit-line-chart.mjs +574 -0
  113. package/fesm2022/masmarino-gabarit-line-chart.mjs.map +1 -0
  114. package/fesm2022/masmarino-gabarit-list-card.mjs +320 -0
  115. package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -0
  116. package/fesm2022/masmarino-gabarit-list-row.mjs +58 -0
  117. package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -0
  118. package/fesm2022/masmarino-gabarit-list-toolbar.mjs +369 -0
  119. package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -0
  120. package/fesm2022/masmarino-gabarit-menu.mjs +461 -0
  121. package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -0
  122. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +897 -0
  123. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -0
  124. package/fesm2022/masmarino-gabarit-mfa-settings.mjs +629 -0
  125. package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -0
  126. package/fesm2022/masmarino-gabarit-modal.mjs +260 -0
  127. package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -0
  128. package/fesm2022/masmarino-gabarit-nav-tabs.mjs +332 -0
  129. package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -0
  130. package/fesm2022/masmarino-gabarit-notification-dot.mjs +119 -0
  131. package/fesm2022/masmarino-gabarit-notification-dot.mjs.map +1 -0
  132. package/fesm2022/masmarino-gabarit-page-header.mjs +78 -0
  133. package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -0
  134. package/fesm2022/masmarino-gabarit-page-layout.mjs +157 -0
  135. package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -0
  136. package/fesm2022/masmarino-gabarit-pagination.mjs +415 -0
  137. package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -0
  138. package/fesm2022/masmarino-gabarit-panel.mjs +80 -0
  139. package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -0
  140. package/fesm2022/masmarino-gabarit-passkey-settings.mjs +606 -0
  141. package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -0
  142. package/fesm2022/masmarino-gabarit-pie-chart.mjs +317 -0
  143. package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -0
  144. package/fesm2022/masmarino-gabarit-popover.mjs +139 -0
  145. package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -0
  146. package/fesm2022/masmarino-gabarit-radio-group.mjs +202 -0
  147. package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -0
  148. package/fesm2022/masmarino-gabarit-save-status.mjs +142 -0
  149. package/fesm2022/masmarino-gabarit-save-status.mjs.map +1 -0
  150. package/fesm2022/masmarino-gabarit-search-bar.mjs +576 -0
  151. package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -0
  152. package/fesm2022/masmarino-gabarit-secret-reveal.mjs +348 -0
  153. package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -0
  154. package/fesm2022/masmarino-gabarit-segmented-control.mjs +272 -0
  155. package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -0
  156. package/fesm2022/masmarino-gabarit-select.mjs +510 -0
  157. package/fesm2022/masmarino-gabarit-select.mjs.map +1 -0
  158. package/fesm2022/masmarino-gabarit-skeleton-list.mjs +189 -0
  159. package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -0
  160. package/fesm2022/masmarino-gabarit-skeleton.mjs +109 -0
  161. package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -0
  162. package/fesm2022/masmarino-gabarit-slider.mjs +239 -0
  163. package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -0
  164. package/fesm2022/masmarino-gabarit-sparkline.mjs +276 -0
  165. package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -0
  166. package/fesm2022/masmarino-gabarit-spinner.mjs +86 -0
  167. package/fesm2022/masmarino-gabarit-spinner.mjs.map +1 -0
  168. package/fesm2022/masmarino-gabarit-stat-grid.mjs +139 -0
  169. package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -0
  170. package/fesm2022/masmarino-gabarit-stat-tile.mjs +312 -0
  171. package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -0
  172. package/fesm2022/masmarino-gabarit-stepper.mjs +219 -0
  173. package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -0
  174. package/fesm2022/masmarino-gabarit-switch.mjs +151 -0
  175. package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -0
  176. package/fesm2022/masmarino-gabarit-table.mjs +206 -0
  177. package/fesm2022/masmarino-gabarit-table.mjs.map +1 -0
  178. package/fesm2022/masmarino-gabarit-tabs.mjs +210 -0
  179. package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -0
  180. package/fesm2022/masmarino-gabarit-tag-input.mjs +288 -0
  181. package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -0
  182. package/fesm2022/masmarino-gabarit-tag.mjs +155 -0
  183. package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -0
  184. package/fesm2022/masmarino-gabarit-textarea.mjs +369 -0
  185. package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -0
  186. package/fesm2022/masmarino-gabarit-timeline-chart.mjs +521 -0
  187. package/fesm2022/masmarino-gabarit-timeline-chart.mjs.map +1 -0
  188. package/fesm2022/masmarino-gabarit-toaster.mjs +220 -0
  189. package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -0
  190. package/fesm2022/masmarino-gabarit-tooltip.mjs +182 -0
  191. package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -0
  192. package/fesm2022/masmarino-gabarit-tree.mjs +258 -0
  193. package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -0
  194. package/fesm2022/masmarino-gabarit-user-chip.mjs +106 -0
  195. package/fesm2022/masmarino-gabarit-user-chip.mjs.map +1 -0
  196. package/fesm2022/masmarino-gabarit.mjs +83 -24785
  197. package/fesm2022/masmarino-gabarit.mjs.map +1 -1
  198. package/file-upload/README.md +47 -0
  199. package/fonts/OFL-ibm-plex.txt +93 -0
  200. package/fonts/ibm-plex-mono-400.woff2 +0 -0
  201. package/fonts/ibm-plex-mono-500.woff2 +0 -0
  202. package/fonts/ibm-plex-sans-400.woff2 +0 -0
  203. package/fonts/ibm-plex-sans-500.woff2 +0 -0
  204. package/fonts/ibm-plex-sans-600.woff2 +0 -0
  205. package/fonts/ibm-plex-sans-condensed-600.woff2 +0 -0
  206. package/fonts/index.scss +28 -0
  207. package/funnel-chart/README.md +39 -0
  208. package/gauge-bar/README.md +35 -0
  209. package/git-field/README.md +34 -0
  210. package/icon/README.md +52 -0
  211. package/icon-marker/README.md +37 -0
  212. package/input/README.md +120 -0
  213. package/job-graph/README.md +76 -0
  214. package/job-status/README.md +34 -0
  215. package/line-chart/README.md +52 -0
  216. package/list-card/README.md +144 -0
  217. package/list-row/README.md +72 -0
  218. package/list-toolbar/README.md +52 -0
  219. package/menu/README.md +90 -0
  220. package/mfa-enrollment/README.md +189 -0
  221. package/mfa-settings/README.md +154 -0
  222. package/modal/README.md +72 -0
  223. package/nav-tabs/README.md +106 -0
  224. package/notification-dot/README.md +43 -0
  225. package/package.json +335 -1
  226. package/page-header/README.md +56 -0
  227. package/page-layout/README.md +76 -0
  228. package/pagination/README.md +73 -0
  229. package/panel/README.md +56 -0
  230. package/passkey-settings/README.md +120 -0
  231. package/pie-chart/README.md +85 -0
  232. package/popover/README.md +62 -0
  233. package/radio-group/README.md +47 -0
  234. package/save-status/README.md +44 -0
  235. package/search-bar/README.md +84 -0
  236. package/secret-reveal/README.md +60 -0
  237. package/segmented-control/README.md +79 -0
  238. package/select/README.md +61 -0
  239. package/skeleton/README.md +49 -0
  240. package/skeleton-list/README.md +40 -0
  241. package/slider/README.md +44 -0
  242. package/sparkline/README.md +37 -0
  243. package/spinner/README.md +41 -0
  244. package/src/lib/tokens/_a11y.scss +22 -0
  245. package/src/lib/tokens/_base.scss +31 -0
  246. package/src/lib/tokens/_palette.scss +52 -51
  247. package/src/lib/tokens/_semantic.scss +17 -124
  248. package/src/lib/tokens/_themes.scss +144 -0
  249. package/src/lib/tokens/_utilities.scss +10 -10
  250. package/src/lib/tokens/index.scss +3 -0
  251. package/stat-grid/README.md +47 -0
  252. package/stat-tile/README.md +75 -0
  253. package/stepper/README.md +67 -0
  254. package/switch/README.md +51 -0
  255. package/table/README.md +75 -0
  256. package/tabs/README.md +34 -0
  257. package/tag/README.md +34 -0
  258. package/tag-input/README.md +45 -0
  259. package/textarea/README.md +76 -0
  260. package/timeline-chart/README.md +49 -0
  261. package/toaster/README.md +92 -0
  262. package/tooltip/README.md +50 -0
  263. package/tree/README.md +79 -0
  264. package/types/masmarino-gabarit-accordion.d.ts +54 -0
  265. package/types/masmarino-gabarit-alert.d.ts +65 -0
  266. package/types/masmarino-gabarit-app-shell.d.ts +102 -0
  267. package/types/masmarino-gabarit-auth-activate.d.ts +70 -0
  268. package/types/masmarino-gabarit-auth-login.d.ts +63 -0
  269. package/types/masmarino-gabarit-auth-register.d.ts +66 -0
  270. package/types/masmarino-gabarit-auth-reset-password.d.ts +53 -0
  271. package/types/masmarino-gabarit-auth.d.ts +543 -0
  272. package/types/masmarino-gabarit-autocomplete.d.ts +139 -0
  273. package/types/masmarino-gabarit-avatar-group.d.ts +59 -0
  274. package/types/masmarino-gabarit-avatar.d.ts +31 -0
  275. package/types/masmarino-gabarit-badge.d.ts +139 -0
  276. package/types/masmarino-gabarit-bar-chart.d.ts +111 -0
  277. package/types/masmarino-gabarit-breadcrumb.d.ts +12 -0
  278. package/types/masmarino-gabarit-button.d.ts +108 -0
  279. package/types/masmarino-gabarit-card.d.ts +102 -0
  280. package/types/masmarino-gabarit-chart.d.ts +361 -0
  281. package/types/masmarino-gabarit-checkbox-group.d.ts +113 -0
  282. package/types/masmarino-gabarit-checkbox.d.ts +49 -0
  283. package/types/masmarino-gabarit-confirm-danger-modal.d.ts +94 -0
  284. package/types/masmarino-gabarit-copy-button.d.ts +111 -0
  285. package/types/masmarino-gabarit-copy-field.d.ts +64 -0
  286. package/types/masmarino-gabarit-date-picker.d.ts +397 -0
  287. package/types/masmarino-gabarit-description-list.d.ts +40 -0
  288. package/types/masmarino-gabarit-dimension-card.d.ts +55 -0
  289. package/types/masmarino-gabarit-disclosure.d.ts +44 -0
  290. package/types/masmarino-gabarit-divider.d.ts +20 -0
  291. package/types/masmarino-gabarit-docs.d.ts +20 -59
  292. package/types/masmarino-gabarit-drawer.d.ts +51 -0
  293. package/types/masmarino-gabarit-empty-state.d.ts +67 -0
  294. package/types/masmarino-gabarit-file-upload.d.ts +95 -0
  295. package/types/masmarino-gabarit-floating-panel.d.ts +7 -0
  296. package/types/masmarino-gabarit-format.d.ts +54 -0
  297. package/types/masmarino-gabarit-funnel-chart.d.ts +78 -0
  298. package/types/masmarino-gabarit-gauge-bar.d.ts +54 -0
  299. package/types/masmarino-gabarit-git-field.d.ts +39 -0
  300. package/types/masmarino-gabarit-icon-marker.d.ts +47 -0
  301. package/types/masmarino-gabarit-icon.d.ts +23 -0
  302. package/types/masmarino-gabarit-input.d.ts +181 -0
  303. package/types/masmarino-gabarit-job-graph.d.ts +63 -0
  304. package/types/masmarino-gabarit-job-status.d.ts +20 -0
  305. package/types/masmarino-gabarit-line-chart.d.ts +153 -0
  306. package/types/masmarino-gabarit-list-card.d.ts +87 -0
  307. package/types/masmarino-gabarit-list-row.d.ts +14 -0
  308. package/types/masmarino-gabarit-list-toolbar.d.ts +100 -0
  309. package/types/masmarino-gabarit-menu.d.ts +92 -0
  310. package/types/masmarino-gabarit-mfa-enrollment.d.ts +142 -0
  311. package/types/masmarino-gabarit-mfa-settings.d.ts +89 -0
  312. package/types/masmarino-gabarit-modal.d.ts +60 -0
  313. package/types/masmarino-gabarit-nav-tabs.d.ts +65 -0
  314. package/types/masmarino-gabarit-notification-dot.d.ts +34 -0
  315. package/types/masmarino-gabarit-page-header.d.ts +20 -0
  316. package/types/masmarino-gabarit-page-layout.d.ts +46 -0
  317. package/types/masmarino-gabarit-pagination.d.ts +109 -0
  318. package/types/masmarino-gabarit-panel.d.ts +21 -0
  319. package/types/masmarino-gabarit-passkey-settings.d.ts +94 -0
  320. package/types/masmarino-gabarit-pie-chart.d.ts +94 -0
  321. package/types/masmarino-gabarit-popover.d.ts +32 -0
  322. package/types/masmarino-gabarit-radio-group.d.ts +66 -0
  323. package/types/masmarino-gabarit-save-status.d.ts +39 -0
  324. package/types/masmarino-gabarit-search-bar.d.ts +183 -0
  325. package/types/masmarino-gabarit-secret-reveal.d.ts +95 -0
  326. package/types/masmarino-gabarit-segmented-control.d.ts +76 -0
  327. package/types/masmarino-gabarit-select.d.ts +145 -0
  328. package/types/masmarino-gabarit-skeleton-list.d.ts +54 -0
  329. package/types/masmarino-gabarit-skeleton.d.ts +26 -0
  330. package/types/masmarino-gabarit-slider.d.ts +73 -0
  331. package/types/masmarino-gabarit-sparkline.d.ts +70 -0
  332. package/types/masmarino-gabarit-spinner.d.ts +20 -0
  333. package/types/masmarino-gabarit-stat-grid.d.ts +39 -0
  334. package/types/masmarino-gabarit-stat-tile.d.ts +79 -0
  335. package/types/masmarino-gabarit-stepper.d.ts +67 -0
  336. package/types/masmarino-gabarit-switch.d.ts +42 -0
  337. package/types/masmarino-gabarit-table.d.ts +60 -0
  338. package/types/masmarino-gabarit-tabs.d.ts +40 -0
  339. package/types/masmarino-gabarit-tag-input.d.ts +78 -0
  340. package/types/masmarino-gabarit-tag.d.ts +35 -0
  341. package/types/masmarino-gabarit-textarea.d.ts +109 -0
  342. package/types/masmarino-gabarit-timeline-chart.d.ts +145 -0
  343. package/types/masmarino-gabarit-toaster.d.ts +62 -0
  344. package/types/masmarino-gabarit-tooltip.d.ts +38 -0
  345. package/types/masmarino-gabarit-tree.d.ts +71 -0
  346. package/types/masmarino-gabarit-user-chip.d.ts +26 -0
  347. package/types/masmarino-gabarit.d.ts +83 -6605
  348. package/user-chip/README.md +42 -0
@@ -0,0 +1,151 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, input, signal } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ let nextSwitchId = 0;
5
+ var Switch = class Switch {
6
+ id = input(`gbt-switch-${++nextSwitchId}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
7
+ label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
8
+ disabled = input(false, {
9
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
10
+ transform: booleanAttribute
11
+ });
12
+ hint = input("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
13
+ hintId = computed(() => `${this.id()}-hint`, ...ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []);
14
+ checked = signal(false, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
15
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
16
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
17
+ onChange = () => {};
18
+ onTouched = () => {};
19
+ writeValue(value) {
20
+ this.checked.set(!!value);
21
+ }
22
+ registerOnChange(fn) {
23
+ this.onChange = fn;
24
+ }
25
+ registerOnTouched(fn) {
26
+ this.onTouched = fn;
27
+ }
28
+ setDisabledState(isDisabled) {
29
+ this.formDisabled.set(isDisabled);
30
+ }
31
+ onToggle(event) {
32
+ const value = event.target.checked;
33
+ this.checked.set(value);
34
+ this.onChange(value);
35
+ this.onTouched();
36
+ }
37
+ static ɵfac = i0.ɵɵngDeclareFactory({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.0",
40
+ ngImport: i0,
41
+ type: Switch,
42
+ deps: [],
43
+ target: i0.ɵɵFactoryTarget.Component
44
+ });
45
+ static ɵcmp = i0.ɵɵngDeclareComponent({
46
+ minVersion: "17.0.0",
47
+ version: "22.2.0",
48
+ type: Switch,
49
+ isStandalone: true,
50
+ selector: "gbt-switch",
51
+ inputs: {
52
+ id: {
53
+ classPropertyName: "id",
54
+ publicName: "id",
55
+ isSignal: true,
56
+ isRequired: false,
57
+ transformFunction: null
58
+ },
59
+ label: {
60
+ classPropertyName: "label",
61
+ publicName: "label",
62
+ isSignal: true,
63
+ isRequired: false,
64
+ transformFunction: null
65
+ },
66
+ disabled: {
67
+ classPropertyName: "disabled",
68
+ publicName: "disabled",
69
+ isSignal: true,
70
+ isRequired: false,
71
+ transformFunction: null
72
+ },
73
+ hint: {
74
+ classPropertyName: "hint",
75
+ publicName: "hint",
76
+ isSignal: true,
77
+ isRequired: false,
78
+ transformFunction: null
79
+ }
80
+ },
81
+ host: { properties: { "class.gbt-switch-host--hint": "!!hint()" } },
82
+ providers: [{
83
+ provide: NG_VALUE_ACCESSOR,
84
+ useExisting: forwardRef(() => Switch),
85
+ multi: true
86
+ }],
87
+ ngImport: i0,
88
+ template: "<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n",
89
+ styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;transition:background .15s ease}.gbt-switch__input:checked+.gbt-switch__track{background:var(--primary)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--bg-principal);border-radius:50%;box-shadow:var(--site-shadow-sm);transition:transform .15s ease}.gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(1rem)}.gbt-switch__hint{margin:.125rem 0 0;padding-left:2.75rem;font-size:.75rem;line-height:1.4;color:var(--text-secondary)}@media(prefers-reduced-motion:reduce){.gbt-switch__track,.gbt-switch__thumb{transition:none}}\n"],
90
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
91
+ });
92
+ };
93
+ i0.ɵɵngDeclareClassMetadata({
94
+ minVersion: "12.0.0",
95
+ version: "22.2.0",
96
+ ngImport: i0,
97
+ type: Switch,
98
+ decorators: [{
99
+ type: Component,
100
+ args: [{
101
+ selector: "gbt-switch",
102
+ standalone: true,
103
+ changeDetection: ChangeDetectionStrategy.OnPush,
104
+ host: { "[class.gbt-switch-host--hint]": "!!hint()" },
105
+ providers: [{
106
+ provide: NG_VALUE_ACCESSOR,
107
+ useExisting: forwardRef(() => Switch),
108
+ multi: true
109
+ }],
110
+ template: "<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n",
111
+ styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;transition:background .15s ease}.gbt-switch__input:checked+.gbt-switch__track{background:var(--primary)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--bg-principal);border-radius:50%;box-shadow:var(--site-shadow-sm);transition:transform .15s ease}.gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(1rem)}.gbt-switch__hint{margin:.125rem 0 0;padding-left:2.75rem;font-size:.75rem;line-height:1.4;color:var(--text-secondary)}@media(prefers-reduced-motion:reduce){.gbt-switch__track,.gbt-switch__thumb{transition:none}}\n"]
112
+ }]
113
+ }],
114
+ propDecorators: {
115
+ id: [{
116
+ type: i0.Input,
117
+ args: [{
118
+ isSignal: true,
119
+ alias: "id",
120
+ required: false
121
+ }]
122
+ }],
123
+ label: [{
124
+ type: i0.Input,
125
+ args: [{
126
+ isSignal: true,
127
+ alias: "label",
128
+ required: false
129
+ }]
130
+ }],
131
+ disabled: [{
132
+ type: i0.Input,
133
+ args: [{
134
+ isSignal: true,
135
+ alias: "disabled",
136
+ required: false
137
+ }]
138
+ }],
139
+ hint: [{
140
+ type: i0.Input,
141
+ args: [{
142
+ isSignal: true,
143
+ alias: "hint",
144
+ required: false
145
+ }]
146
+ }]
147
+ }
148
+ });
149
+ export { Switch };
150
+
151
+ //# sourceMappingURL=masmarino-gabarit-switch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masmarino-gabarit-switch.mjs","names":[],"sources":["../../../projects/gabarit/switch/switch.ts","../../../projects/gabarit/switch/switch.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextSwitchId = 0\n\n@Component({\n selector: 'gbt-switch',\n standalone: true,\n templateUrl: './switch.html',\n styleUrl: './switch.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-switch-host--hint]': '!!hint()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Switch),\n multi: true,\n },\n ],\n})\nexport class Switch implements ControlValueAccessor {\n id = input<string>(`gbt-switch-${++nextSwitchId}`)\n label = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n hint = input<string>('')\n\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly checked = signal(false)\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: boolean) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: boolean): void {\n this.checked.set(!!value)\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onToggle(event: Event): void {\n const value = (event.target as HTMLInputElement).checked\n this.checked.set(value)\n this.onChange(value)\n this.onTouched()\n }\n}\n","<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n"],"mappings":";;;AAWA,IAAI,eAAe;AAmBnB,IAAa,SAAb,MAAa,OAAM;CACjB,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CA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AA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,+BAAA,WAAA,EAAA;EAAA,WARN,CACT;GACE,SAAS;GACT,aAAa,iBAAiB,MAAM;GACpC,OAAO;EACR,CACF;EAAA,UAAA;EAAA,UC5BH;EAmBA,QAAA,CAAA,+2CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;ADWa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAjBlB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,YACV;GAAI,iBAGC,wBAAwB;GAAM,MACzC,EACJ,iCAAiC,WAClC;GAAA,WACU,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,+2CAAA;EAAA,CAAA"}
@@ -0,0 +1,206 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, booleanAttribute, input, output } from "@angular/core";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ const INTERACTIVE_TARGET_SELECTOR = [
5
+ "button",
6
+ "a[href]",
7
+ "input",
8
+ "select",
9
+ "textarea",
10
+ "label",
11
+ "summary",
12
+ "[contenteditable]:not([contenteditable=\"false\"])",
13
+ "[role=\"button\"]",
14
+ "[role=\"link\"]",
15
+ "[role=\"checkbox\"]",
16
+ "[role=\"switch\"]",
17
+ "[role=\"radio\"]",
18
+ "[role=\"tab\"]",
19
+ "[role=\"option\"]",
20
+ "[role=\"menuitem\"]",
21
+ "[role=\"menuitemcheckbox\"]",
22
+ "[role=\"menuitemradio\"]",
23
+ "[role=\"textbox\"]",
24
+ "[role=\"searchbox\"]",
25
+ "[role=\"slider\"]",
26
+ "[role=\"spinbutton\"]"
27
+ ].join(", ");
28
+ var Table = class Table {
29
+ data = input.required(...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
30
+ columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
31
+ trackBy = input(null, ...ngDevMode ? [{ debugName: "trackBy" }] : /* istanbul ignore next */ []);
32
+ emptyMessage = input("No data", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
33
+ caption = input.required(...ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []);
34
+ clickableRows = input(false, {
35
+ ...ngDevMode ? { debugName: "clickableRows" } : /* istanbul ignore next */ {},
36
+ transform: booleanAttribute
37
+ });
38
+ rowClick = output();
39
+ trackRow = (index, row) => {
40
+ const identify = this.trackBy();
41
+ return identify ? identify(row) : index;
42
+ };
43
+ onRowClick(event, row) {
44
+ if (!this.isInteractiveTarget(event)) this.rowClick.emit(row);
45
+ }
46
+ onRowKeydown(event, row) {
47
+ if ((event.key === "Enter" || event.key === " ") && !this.isInteractiveTarget(event)) {
48
+ event.preventDefault();
49
+ this.rowClick.emit(row);
50
+ }
51
+ }
52
+ isInteractiveTarget(event) {
53
+ return event.target.closest(INTERACTIVE_TARGET_SELECTOR) !== null;
54
+ }
55
+ cellValue(row, column) {
56
+ return column.format ? column.format(row) : row[column.key];
57
+ }
58
+ static ɵfac = i0.ɵɵngDeclareFactory({
59
+ minVersion: "12.0.0",
60
+ version: "22.2.0",
61
+ ngImport: i0,
62
+ type: Table,
63
+ deps: [],
64
+ target: i0.ɵɵFactoryTarget.Component
65
+ });
66
+ static ɵcmp = i0.ɵɵngDeclareComponent({
67
+ minVersion: "17.0.0",
68
+ version: "22.2.0",
69
+ type: Table,
70
+ isStandalone: true,
71
+ selector: "gbt-table",
72
+ inputs: {
73
+ data: {
74
+ classPropertyName: "data",
75
+ publicName: "data",
76
+ isSignal: true,
77
+ isRequired: true,
78
+ transformFunction: null
79
+ },
80
+ columns: {
81
+ classPropertyName: "columns",
82
+ publicName: "columns",
83
+ isSignal: true,
84
+ isRequired: true,
85
+ transformFunction: null
86
+ },
87
+ trackBy: {
88
+ classPropertyName: "trackBy",
89
+ publicName: "trackBy",
90
+ isSignal: true,
91
+ isRequired: false,
92
+ transformFunction: null
93
+ },
94
+ emptyMessage: {
95
+ classPropertyName: "emptyMessage",
96
+ publicName: "emptyMessage",
97
+ isSignal: true,
98
+ isRequired: false,
99
+ transformFunction: null
100
+ },
101
+ caption: {
102
+ classPropertyName: "caption",
103
+ publicName: "caption",
104
+ isSignal: true,
105
+ isRequired: true,
106
+ transformFunction: null
107
+ },
108
+ clickableRows: {
109
+ classPropertyName: "clickableRows",
110
+ publicName: "clickableRows",
111
+ isSignal: true,
112
+ isRequired: false,
113
+ transformFunction: null
114
+ }
115
+ },
116
+ outputs: { rowClick: "rowClick" },
117
+ ngImport: i0,
118
+ template: "<table class=\"gbt-table\">\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n @for (column of columns(); track column.key) {\n <th scope=\"col\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of data(); track trackRow($index, row)) {\n <tr\n [class.gbt-table__row--clickable]=\"clickableRows()\"\n [attr.tabindex]=\"clickableRows() ? 0 : null\"\n (click)=\"clickableRows() && onRowClick($event, row)\"\n (keydown)=\"clickableRows() && onRowKeydown($event, row)\"\n >\n @for (column of columns(); track column.key) {\n <td>\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n } @else {\n {{ cellValue(row, column) }}\n }\n </td>\n }\n </tr>\n } @empty {\n <tr class=\"gbt-table__empty\">\n <td [attr.colspan]=\"columns().length\">{{ emptyMessage() }}</td>\n </tr>\n }\n </tbody>\n</table>\n",
119
+ styles: [".gbt-table{width:100%;border-collapse:collapse;font-size:.875rem}.gbt-table caption{text-align:left;padding:0 0 .625rem;font-weight:600;color:var(--text-primary)}.gbt-table th{text-align:left;padding:.625rem .75rem;font-weight:600;color:var(--text-secondary);border-bottom:1px solid var(--border-color)}.gbt-table td{padding:.625rem .75rem;color:var(--text-primary);border-bottom:1px solid var(--border-color)}.gbt-table tbody tr{transition:background-color var(--site-transition-fast)}.gbt-table tbody tr.gbt-table__row--clickable{cursor:pointer}.gbt-table tbody tr.gbt-table__row--clickable:hover{background:var(--bg-hover)}.gbt-table tbody tr:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-table__empty{cursor:default;text-align:center;color:var(--text-discret)}.gbt-table__empty:hover{background:none}\n"],
120
+ dependencies: [{
121
+ kind: "directive",
122
+ type: NgTemplateOutlet,
123
+ selector: "[ngTemplateOutlet]",
124
+ inputs: [
125
+ "ngTemplateOutletContext",
126
+ "ngTemplateOutlet",
127
+ "ngTemplateOutletInjector"
128
+ ]
129
+ }],
130
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
131
+ });
132
+ };
133
+ i0.ɵɵngDeclareClassMetadata({
134
+ minVersion: "12.0.0",
135
+ version: "22.2.0",
136
+ ngImport: i0,
137
+ type: Table,
138
+ decorators: [{
139
+ type: Component,
140
+ args: [{
141
+ selector: "gbt-table",
142
+ standalone: true,
143
+ imports: [NgTemplateOutlet],
144
+ changeDetection: ChangeDetectionStrategy.OnPush,
145
+ template: "<table class=\"gbt-table\">\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n @for (column of columns(); track column.key) {\n <th scope=\"col\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of data(); track trackRow($index, row)) {\n <tr\n [class.gbt-table__row--clickable]=\"clickableRows()\"\n [attr.tabindex]=\"clickableRows() ? 0 : null\"\n (click)=\"clickableRows() && onRowClick($event, row)\"\n (keydown)=\"clickableRows() && onRowKeydown($event, row)\"\n >\n @for (column of columns(); track column.key) {\n <td>\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n } @else {\n {{ cellValue(row, column) }}\n }\n </td>\n }\n </tr>\n } @empty {\n <tr class=\"gbt-table__empty\">\n <td [attr.colspan]=\"columns().length\">{{ emptyMessage() }}</td>\n </tr>\n }\n </tbody>\n</table>\n",
146
+ styles: [".gbt-table{width:100%;border-collapse:collapse;font-size:.875rem}.gbt-table caption{text-align:left;padding:0 0 .625rem;font-weight:600;color:var(--text-primary)}.gbt-table th{text-align:left;padding:.625rem .75rem;font-weight:600;color:var(--text-secondary);border-bottom:1px solid var(--border-color)}.gbt-table td{padding:.625rem .75rem;color:var(--text-primary);border-bottom:1px solid var(--border-color)}.gbt-table tbody tr{transition:background-color var(--site-transition-fast)}.gbt-table tbody tr.gbt-table__row--clickable{cursor:pointer}.gbt-table tbody tr.gbt-table__row--clickable:hover{background:var(--bg-hover)}.gbt-table tbody tr:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-table__empty{cursor:default;text-align:center;color:var(--text-discret)}.gbt-table__empty:hover{background:none}\n"]
147
+ }]
148
+ }],
149
+ propDecorators: {
150
+ data: [{
151
+ type: i0.Input,
152
+ args: [{
153
+ isSignal: true,
154
+ alias: "data",
155
+ required: true
156
+ }]
157
+ }],
158
+ columns: [{
159
+ type: i0.Input,
160
+ args: [{
161
+ isSignal: true,
162
+ alias: "columns",
163
+ required: true
164
+ }]
165
+ }],
166
+ trackBy: [{
167
+ type: i0.Input,
168
+ args: [{
169
+ isSignal: true,
170
+ alias: "trackBy",
171
+ required: false
172
+ }]
173
+ }],
174
+ emptyMessage: [{
175
+ type: i0.Input,
176
+ args: [{
177
+ isSignal: true,
178
+ alias: "emptyMessage",
179
+ required: false
180
+ }]
181
+ }],
182
+ caption: [{
183
+ type: i0.Input,
184
+ args: [{
185
+ isSignal: true,
186
+ alias: "caption",
187
+ required: true
188
+ }]
189
+ }],
190
+ clickableRows: [{
191
+ type: i0.Input,
192
+ args: [{
193
+ isSignal: true,
194
+ alias: "clickableRows",
195
+ required: false
196
+ }]
197
+ }],
198
+ rowClick: [{
199
+ type: i0.Output,
200
+ args: ["rowClick"]
201
+ }]
202
+ }
203
+ });
204
+ export { Table };
205
+
206
+ //# sourceMappingURL=masmarino-gabarit-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masmarino-gabarit-table.mjs","names":[],"sources":["../../../projects/gabarit/table/table.ts","../../../projects/gabarit/table/table.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n booleanAttribute,\n input,\n output,\n} from '@angular/core'\nimport { NgTemplateOutlet } from '@angular/common'\n\nexport interface TableColumn<T> {\n key: string\n label: string\n format?: (row: T) => string\n cellTemplate?: TemplateRef<{ $implicit: T }>\n}\n\nconst INTERACTIVE_TARGET_SELECTOR = [\n 'button',\n 'a[href]',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'summary',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[role=\"checkbox\"]',\n '[role=\"switch\"]',\n '[role=\"radio\"]',\n '[role=\"tab\"]',\n '[role=\"option\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n '[role=\"textbox\"]',\n '[role=\"searchbox\"]',\n '[role=\"slider\"]',\n '[role=\"spinbutton\"]',\n].join(', ')\n\n@Component({\n selector: 'gbt-table',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './table.html',\n styleUrl: './table.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Table<T extends object> {\n data = input.required<T[]>()\n columns = input.required<TableColumn<T>[]>()\n trackBy = input<((row: T) => unknown) | null>(null)\n emptyMessage = input<string>('No data')\n caption = input.required<string>()\n clickableRows = input(false, { transform: booleanAttribute })\n\n rowClick = output<T>()\n\n protected trackRow = (index: number, row: T): unknown => {\n const identify = this.trackBy()\n return identify ? identify(row) : index\n }\n\n protected onRowClick(event: MouseEvent, row: T): void {\n if (!this.isInteractiveTarget(event)) {\n this.rowClick.emit(row)\n }\n }\n\n protected onRowKeydown(event: KeyboardEvent, row: T): void {\n if ((event.key === 'Enter' || event.key === ' ') && !this.isInteractiveTarget(event)) {\n event.preventDefault()\n this.rowClick.emit(row)\n }\n }\n\n private isInteractiveTarget(event: Event): boolean {\n return (event.target as HTMLElement).closest(INTERACTIVE_TARGET_SELECTOR) !== null\n }\n\n protected cellValue(row: T, column: TableColumn<T>): unknown {\n return column.format ? column.format(row) : (row as Record<string, unknown>)[column.key]\n }\n}\n","<table class=\"gbt-table\">\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n @for (column of columns(); track column.key) {\n <th scope=\"col\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of data(); track trackRow($index, row)) {\n <tr\n [class.gbt-table__row--clickable]=\"clickableRows()\"\n [attr.tabindex]=\"clickableRows() ? 0 : null\"\n (click)=\"clickableRows() && onRowClick($event, row)\"\n (keydown)=\"clickableRows() && onRowKeydown($event, row)\"\n >\n @for (column of columns(); track column.key) {\n <td>\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n } @else {\n {{ cellValue(row, column) }}\n }\n </td>\n }\n </tr>\n } @empty {\n <tr class=\"gbt-table__empty\">\n <td [attr.colspan]=\"columns().length\">{{ emptyMessage() }}</td>\n </tr>\n }\n </tbody>\n</table>\n"],"mappings":";;;AAiBA,MAAM,8BAA8B;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAA,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A,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAL,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAK,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,eAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,UAAA,WAAA;EAAA,UAAA;EAAA,UClDlB;EAyCA,QAAA,CAAA,41BAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MDIY;GAAgB,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAKf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAK,YAAA,CAAA;EARjB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,YACT;GAAI,SACP,CAAC,gBAAgB;GAAC,iBAGV,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,41BAAA;EAAA,CAAA"}
@@ -0,0 +1,210 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, contentChildren, effect, input, model, signal, viewChildren } from "@angular/core";
3
+ var Tab = class Tab {
4
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
5
+ active = signal(false, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
6
+ index = signal(0, ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
7
+ groupId = signal("", ...ngDevMode ? [{ debugName: "groupId" }] : /* istanbul ignore next */ []);
8
+ setState(index, active, groupId) {
9
+ this.index.set(index);
10
+ this.active.set(active);
11
+ this.groupId.set(groupId);
12
+ }
13
+ static ɵfac = i0.ɵɵngDeclareFactory({
14
+ minVersion: "12.0.0",
15
+ version: "22.2.0",
16
+ ngImport: i0,
17
+ type: Tab,
18
+ deps: [],
19
+ target: i0.ɵɵFactoryTarget.Component
20
+ });
21
+ static ɵcmp = i0.ɵɵngDeclareComponent({
22
+ minVersion: "17.1.0",
23
+ version: "22.2.0",
24
+ type: Tab,
25
+ isStandalone: true,
26
+ selector: "gbt-tab",
27
+ inputs: { label: {
28
+ classPropertyName: "label",
29
+ publicName: "label",
30
+ isSignal: true,
31
+ isRequired: true,
32
+ transformFunction: null
33
+ } },
34
+ host: {
35
+ attributes: { "role": "tabpanel" },
36
+ properties: {
37
+ "style.display": "active() ? null : 'none'",
38
+ "id": "groupId() + '-panel-' + index()",
39
+ "attr.aria-labelledby": "groupId() + '-trigger-' + index()"
40
+ }
41
+ },
42
+ ngImport: i0,
43
+ template: `<ng-content></ng-content>`,
44
+ isInline: true,
45
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
46
+ });
47
+ };
48
+ i0.ɵɵngDeclareClassMetadata({
49
+ minVersion: "12.0.0",
50
+ version: "22.2.0",
51
+ ngImport: i0,
52
+ type: Tab,
53
+ decorators: [{
54
+ type: Component,
55
+ args: [{
56
+ selector: "gbt-tab",
57
+ standalone: true,
58
+ imports: [],
59
+ template: `<ng-content></ng-content>`,
60
+ host: {
61
+ role: "tabpanel",
62
+ "[style.display]": "active() ? null : 'none'",
63
+ "[id]": "groupId() + '-panel-' + index()",
64
+ "[attr.aria-labelledby]": "groupId() + '-trigger-' + index()"
65
+ },
66
+ changeDetection: ChangeDetectionStrategy.OnPush
67
+ }]
68
+ }],
69
+ propDecorators: { label: [{
70
+ type: i0.Input,
71
+ args: [{
72
+ isSignal: true,
73
+ alias: "label",
74
+ required: true
75
+ }]
76
+ }] }
77
+ });
78
+ let nextTabsId = 0;
79
+ var Tabs = class Tabs {
80
+ id = input(`gbt-tabs-${++nextTabsId}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
81
+ tabs = contentChildren(Tab, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
82
+ triggers = viewChildren("trigger", ...ngDevMode ? [{ debugName: "triggers" }] : /* istanbul ignore next */ []);
83
+ activeIndex = model(0, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
84
+ constructor() {
85
+ effect(() => {
86
+ const tabs = this.tabs();
87
+ const active = this.activeIndex();
88
+ const groupId = this.id();
89
+ tabs.forEach((tab, i) => tab.setState(i, i === active, groupId));
90
+ });
91
+ effect(() => {
92
+ const count = this.tabs().length;
93
+ if (count === 0) return;
94
+ const current = this.activeIndex();
95
+ const clamped = Math.min(Math.max(current, 0), count - 1);
96
+ if (clamped !== current) this.activeIndex.set(clamped);
97
+ });
98
+ }
99
+ select(index) {
100
+ this.activeIndex.set(index);
101
+ }
102
+ onKeydown(event, index) {
103
+ const count = this.tabs().length;
104
+ if (count === 0) return;
105
+ let next = null;
106
+ if (event.key === "ArrowRight") next = (index + 1) % count;
107
+ else if (event.key === "ArrowLeft") next = (index - 1 + count) % count;
108
+ if (next === null) return;
109
+ event.preventDefault();
110
+ this.select(next);
111
+ this.triggers()[next]?.nativeElement.focus();
112
+ }
113
+ static ɵfac = i0.ɵɵngDeclareFactory({
114
+ minVersion: "12.0.0",
115
+ version: "22.2.0",
116
+ ngImport: i0,
117
+ type: Tabs,
118
+ deps: [],
119
+ target: i0.ɵɵFactoryTarget.Component
120
+ });
121
+ static ɵcmp = i0.ɵɵngDeclareComponent({
122
+ minVersion: "17.0.0",
123
+ version: "22.2.0",
124
+ type: Tabs,
125
+ isStandalone: true,
126
+ selector: "gbt-tabs",
127
+ inputs: {
128
+ id: {
129
+ classPropertyName: "id",
130
+ publicName: "id",
131
+ isSignal: true,
132
+ isRequired: false,
133
+ transformFunction: null
134
+ },
135
+ activeIndex: {
136
+ classPropertyName: "activeIndex",
137
+ publicName: "activeIndex",
138
+ isSignal: true,
139
+ isRequired: false,
140
+ transformFunction: null
141
+ }
142
+ },
143
+ outputs: { activeIndex: "activeIndexChange" },
144
+ queries: [{
145
+ propertyName: "tabs",
146
+ predicate: Tab,
147
+ isSignal: true
148
+ }],
149
+ viewQueries: [{
150
+ propertyName: "triggers",
151
+ predicate: ["trigger"],
152
+ descendants: true,
153
+ isSignal: true
154
+ }],
155
+ ngImport: i0,
156
+ template: "<div class=\"gbt-tabs\">\n <div class=\"gbt-tabs__list\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n #trigger\n type=\"button\"\n class=\"gbt-tabs__trigger\"\n [class.gbt-tabs__trigger--active]=\"activeIndex() === i\"\n role=\"tab\"\n [id]=\"id() + '-trigger-' + i\"\n [attr.aria-selected]=\"activeIndex() === i\"\n [attr.aria-controls]=\"id() + '-panel-' + i\"\n [tabIndex]=\"activeIndex() === i ? 0 : -1\"\n (click)=\"select(i)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ tab.label() }}\n </button>\n }\n </div>\n <div class=\"gbt-tabs__panels\">\n <ng-content></ng-content>\n </div>\n</div>\n",
157
+ styles: [":host{display:block}.gbt-tabs{display:flex;flex-direction:column}.gbt-tabs__list{display:flex;gap:.5rem;border-bottom:1px solid var(--border-color);overflow-x:auto}.gbt-tabs__trigger{appearance:none;background:none;border:none;border-bottom:2px solid transparent;padding:.75rem 1rem;font-size:.9375rem;font-weight:500;color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:color var(--site-transition-fast),border-color var(--site-transition-fast)}.gbt-tabs__trigger:hover{color:var(--text-primary)}.gbt-tabs__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px;border-radius:var(--site-border-radius-sm)}.gbt-tabs__trigger--active{color:var(--primary);border-bottom-color:var(--primary)}.gbt-tabs__panels{padding-top:1rem;display:flex;flex-direction:column;gap:1rem}\n"],
158
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
159
+ });
160
+ };
161
+ i0.ɵɵngDeclareClassMetadata({
162
+ minVersion: "12.0.0",
163
+ version: "22.2.0",
164
+ ngImport: i0,
165
+ type: Tabs,
166
+ decorators: [{
167
+ type: Component,
168
+ args: [{
169
+ selector: "gbt-tabs",
170
+ standalone: true,
171
+ imports: [],
172
+ changeDetection: ChangeDetectionStrategy.OnPush,
173
+ template: "<div class=\"gbt-tabs\">\n <div class=\"gbt-tabs__list\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n #trigger\n type=\"button\"\n class=\"gbt-tabs__trigger\"\n [class.gbt-tabs__trigger--active]=\"activeIndex() === i\"\n role=\"tab\"\n [id]=\"id() + '-trigger-' + i\"\n [attr.aria-selected]=\"activeIndex() === i\"\n [attr.aria-controls]=\"id() + '-panel-' + i\"\n [tabIndex]=\"activeIndex() === i ? 0 : -1\"\n (click)=\"select(i)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ tab.label() }}\n </button>\n }\n </div>\n <div class=\"gbt-tabs__panels\">\n <ng-content></ng-content>\n </div>\n</div>\n",
174
+ styles: [":host{display:block}.gbt-tabs{display:flex;flex-direction:column}.gbt-tabs__list{display:flex;gap:.5rem;border-bottom:1px solid var(--border-color);overflow-x:auto}.gbt-tabs__trigger{appearance:none;background:none;border:none;border-bottom:2px solid transparent;padding:.75rem 1rem;font-size:.9375rem;font-weight:500;color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:color var(--site-transition-fast),border-color var(--site-transition-fast)}.gbt-tabs__trigger:hover{color:var(--text-primary)}.gbt-tabs__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px;border-radius:var(--site-border-radius-sm)}.gbt-tabs__trigger--active{color:var(--primary);border-bottom-color:var(--primary)}.gbt-tabs__panels{padding-top:1rem;display:flex;flex-direction:column;gap:1rem}\n"]
175
+ }]
176
+ }],
177
+ ctorParameters: () => [],
178
+ propDecorators: {
179
+ id: [{
180
+ type: i0.Input,
181
+ args: [{
182
+ isSignal: true,
183
+ alias: "id",
184
+ required: false
185
+ }]
186
+ }],
187
+ tabs: [{
188
+ type: i0.ContentChildren,
189
+ args: [i0.forwardRef(() => Tab), { isSignal: true }]
190
+ }],
191
+ triggers: [{
192
+ type: i0.ViewChildren,
193
+ args: ["trigger", { isSignal: true }]
194
+ }],
195
+ activeIndex: [{
196
+ type: i0.Input,
197
+ args: [{
198
+ isSignal: true,
199
+ alias: "activeIndex",
200
+ required: false
201
+ }]
202
+ }, {
203
+ type: i0.Output,
204
+ args: ["activeIndexChange"]
205
+ }]
206
+ }
207
+ });
208
+ export { Tab, Tabs };
209
+
210
+ //# sourceMappingURL=masmarino-gabarit-tabs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masmarino-gabarit-tabs.mjs","names":[],"sources":["../../../projects/gabarit/tabs/tab/tab.ts","../../../projects/gabarit/tabs/tabs.ts","../../../projects/gabarit/tabs/tabs.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core'\n\n@Component({\n selector: 'gbt-tab',\n standalone: true,\n imports: [],\n template: `<ng-content></ng-content>`,\n host: {\n role: 'tabpanel',\n '[style.display]': \"active() ? null : 'none'\",\n '[id]': \"groupId() + '-panel-' + index()\",\n '[attr.aria-labelledby]': \"groupId() + '-trigger-' + index()\",\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Tab {\n label = input.required<string>()\n\n protected readonly active = signal(false)\n protected readonly index = signal(0)\n protected readonly groupId = signal('')\n\n setState(index: number, active: boolean, groupId: string): void {\n this.index.set(index)\n this.active.set(active)\n this.groupId.set(groupId)\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n contentChildren,\n effect,\n input,\n model,\n viewChildren,\n} from '@angular/core'\nimport { Tab } from './tab/tab'\n\nlet nextTabsId = 0\n\n@Component({\n selector: 'gbt-tabs',\n standalone: true,\n imports: [],\n templateUrl: './tabs.html',\n styleUrl: './tabs.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Tabs {\n id = input<string>(`gbt-tabs-${++nextTabsId}`)\n\n protected readonly tabs = contentChildren(Tab)\n private readonly triggers = viewChildren<ElementRef<HTMLButtonElement>>('trigger')\n\n activeIndex = model(0)\n\n constructor() {\n effect(() => {\n const tabs = this.tabs()\n const active = this.activeIndex()\n const groupId = this.id()\n tabs.forEach((tab, i) => tab.setState(i, i === active, groupId))\n })\n\n effect(() => {\n const count = this.tabs().length\n if (count === 0) {\n return\n }\n const current = this.activeIndex()\n const clamped = Math.min(Math.max(current, 0), count - 1)\n if (clamped !== current) {\n this.activeIndex.set(clamped)\n }\n })\n }\n\n protected select(index: number): void {\n this.activeIndex.set(index)\n }\n\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const count = this.tabs().length\n if (count === 0) {\n return\n }\n let next: number | null = null\n if (event.key === 'ArrowRight') {\n next = (index + 1) % count\n } else if (event.key === 'ArrowLeft') {\n next = (index - 1 + count) % count\n }\n if (next === null) {\n return\n }\n event.preventDefault()\n this.select(next)\n this.triggers()[next]?.nativeElement.focus()\n }\n}\n","<div class=\"gbt-tabs\">\n <div class=\"gbt-tabs__list\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n #trigger\n type=\"button\"\n class=\"gbt-tabs__trigger\"\n [class.gbt-tabs__trigger--active]=\"activeIndex() === i\"\n role=\"tab\"\n [id]=\"id() + '-trigger-' + i\"\n [attr.aria-selected]=\"activeIndex() === i\"\n [attr.aria-controls]=\"id() + '-panel-' + i\"\n [tabIndex]=\"activeIndex() === i ? 0 : -1\"\n (click)=\"select(i)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ tab.label() }}\n </button>\n }\n </div>\n <div class=\"gbt-tabs__panels\">\n <ng-content></ng-content>\n </div>\n</div>\n"],"mappings":";;AAeA,IAAa,MAAb,MAAa,IAAG;CACd,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEb,SAAS,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACtB,QAAQ,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACjB,UAAU,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEvC,SAAS,OAAe,QAAiB,SAAe;EACtD,KAAK,MAAM,IAAI,KAAK;EACpB,KAAK,OAAO,IAAI,MAAM;EACtB,KAAK,QAAQ,IAAI,OAAO;CAC1B;CAXW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAG,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAH,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAG,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,OAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,WAAA;GAAA,YAAA;IAAA,iBAAA;IAAA,MAAA;IAAA,wBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UATJ;EAA2B,UAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAS1B,GAAA,yBAAA;CAAA,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