@kirbydesign/designsystem 11.11.4 → 12.0.0-dev-286cdc0

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 (291) hide show
  1. package/README.md +7 -0
  2. package/fesm2022/kirbydesign-designsystem-accordion.mjs +246 -135
  3. package/fesm2022/kirbydesign-designsystem-accordion.mjs.map +1 -1
  4. package/fesm2022/kirbydesign-designsystem-action-group.mjs +229 -134
  5. package/fesm2022/kirbydesign-designsystem-action-group.mjs.map +1 -1
  6. package/fesm2022/kirbydesign-designsystem-avatar.mjs +102 -55
  7. package/fesm2022/kirbydesign-designsystem-avatar.mjs.map +1 -1
  8. package/fesm2022/kirbydesign-designsystem-badge.mjs +85 -42
  9. package/fesm2022/kirbydesign-designsystem-badge.mjs.map +1 -1
  10. package/fesm2022/kirbydesign-designsystem-button.mjs +203 -170
  11. package/fesm2022/kirbydesign-designsystem-button.mjs.map +1 -1
  12. package/fesm2022/kirbydesign-designsystem-calendar.mjs +524 -516
  13. package/fesm2022/kirbydesign-designsystem-calendar.mjs.map +1 -1
  14. package/fesm2022/kirbydesign-designsystem-card.mjs +439 -205
  15. package/fesm2022/kirbydesign-designsystem-card.mjs.map +1 -1
  16. package/fesm2022/kirbydesign-designsystem-chart.mjs +1388 -1469
  17. package/fesm2022/kirbydesign-designsystem-chart.mjs.map +1 -1
  18. package/fesm2022/kirbydesign-designsystem-checkbox.mjs +223 -176
  19. package/fesm2022/kirbydesign-designsystem-checkbox.mjs.map +1 -1
  20. package/fesm2022/kirbydesign-designsystem-config.mjs +50 -96
  21. package/fesm2022/kirbydesign-designsystem-config.mjs.map +1 -1
  22. package/fesm2022/kirbydesign-designsystem-data-table.mjs +180 -83
  23. package/fesm2022/kirbydesign-designsystem-data-table.mjs.map +1 -1
  24. package/fesm2022/kirbydesign-designsystem-divider.mjs +46 -19
  25. package/fesm2022/kirbydesign-designsystem-divider.mjs.map +1 -1
  26. package/fesm2022/kirbydesign-designsystem-dropdown.mjs +878 -752
  27. package/fesm2022/kirbydesign-designsystem-dropdown.mjs.map +1 -1
  28. package/fesm2022/kirbydesign-designsystem-empty-state.mjs +175 -91
  29. package/fesm2022/kirbydesign-designsystem-empty-state.mjs.map +1 -1
  30. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs +213 -85
  31. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs.map +1 -1
  32. package/fesm2022/kirbydesign-designsystem-flag.mjs +67 -33
  33. package/fesm2022/kirbydesign-designsystem-flag.mjs.map +1 -1
  34. package/fesm2022/kirbydesign-designsystem-form-field.mjs +1260 -891
  35. package/fesm2022/kirbydesign-designsystem-form-field.mjs.map +1 -1
  36. package/fesm2022/kirbydesign-designsystem-gesture.mjs +38 -23
  37. package/fesm2022/kirbydesign-designsystem-gesture.mjs.map +1 -1
  38. package/fesm2022/kirbydesign-designsystem-header.mjs +422 -182
  39. package/fesm2022/kirbydesign-designsystem-header.mjs.map +1 -1
  40. package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs +16 -14
  41. package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs.map +1 -1
  42. package/fesm2022/kirbydesign-designsystem-helpers.mjs +251 -361
  43. package/fesm2022/kirbydesign-designsystem-helpers.mjs.map +1 -1
  44. package/fesm2022/kirbydesign-designsystem-icon.mjs +881 -296
  45. package/fesm2022/kirbydesign-designsystem-icon.mjs.map +1 -1
  46. package/fesm2022/kirbydesign-designsystem-item-group.mjs +52 -23
  47. package/fesm2022/kirbydesign-designsystem-item-group.mjs.map +1 -1
  48. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs +147 -43
  49. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs.map +1 -1
  50. package/fesm2022/kirbydesign-designsystem-item.mjs +395 -151
  51. package/fesm2022/kirbydesign-designsystem-item.mjs.map +1 -1
  52. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs +136 -54
  53. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs.map +1 -1
  54. package/fesm2022/kirbydesign-designsystem-list.mjs +1188 -697
  55. package/fesm2022/kirbydesign-designsystem-list.mjs.map +1 -1
  56. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs +166 -76
  57. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs.map +1 -1
  58. package/fesm2022/kirbydesign-designsystem-menu.mjs +420 -311
  59. package/fesm2022/kirbydesign-designsystem-menu.mjs.map +1 -1
  60. package/fesm2022/kirbydesign-designsystem-modal.mjs +2476 -1912
  61. package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
  62. package/fesm2022/kirbydesign-designsystem-page.mjs +1526 -905
  63. package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
  64. package/fesm2022/kirbydesign-designsystem-popover.mjs +204 -169
  65. package/fesm2022/kirbydesign-designsystem-popover.mjs.map +1 -1
  66. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs +209 -158
  67. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs.map +1 -1
  68. package/fesm2022/kirbydesign-designsystem-radio.mjs +537 -365
  69. package/fesm2022/kirbydesign-designsystem-radio.mjs.map +1 -1
  70. package/fesm2022/kirbydesign-designsystem-range.mjs +207 -150
  71. package/fesm2022/kirbydesign-designsystem-range.mjs.map +1 -1
  72. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs +217 -104
  73. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs.map +1 -1
  74. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs +113 -38
  75. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs.map +1 -1
  76. package/fesm2022/kirbydesign-designsystem-section-header.mjs +56 -18
  77. package/fesm2022/kirbydesign-designsystem-section-header.mjs.map +1 -1
  78. package/fesm2022/kirbydesign-designsystem-segmented-control.mjs +276 -232
  79. package/fesm2022/kirbydesign-designsystem-segmented-control.mjs.map +1 -1
  80. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs +328 -382
  81. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs.map +1 -1
  82. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs +73 -84
  83. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs.map +1 -1
  84. package/fesm2022/kirbydesign-designsystem-shared.mjs +665 -531
  85. package/fesm2022/kirbydesign-designsystem-shared.mjs.map +1 -1
  86. package/fesm2022/kirbydesign-designsystem-slide-button.mjs +140 -91
  87. package/fesm2022/kirbydesign-designsystem-slide-button.mjs.map +1 -1
  88. package/fesm2022/kirbydesign-designsystem-slide.mjs +360 -158
  89. package/fesm2022/kirbydesign-designsystem-slide.mjs.map +1 -1
  90. package/fesm2022/kirbydesign-designsystem-spinner.mjs +90 -32
  91. package/fesm2022/kirbydesign-designsystem-spinner.mjs.map +1 -1
  92. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs +348 -181
  93. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs.map +1 -1
  94. package/fesm2022/kirbydesign-designsystem-tabs.mjs +286 -121
  95. package/fesm2022/kirbydesign-designsystem-tabs.mjs.map +1 -1
  96. package/fesm2022/kirbydesign-designsystem-testing-base.mjs +6234 -3164
  97. package/fesm2022/kirbydesign-designsystem-testing-base.mjs.map +1 -1
  98. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs +118 -95
  99. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs.map +1 -1
  100. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs +128 -101
  101. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs.map +1 -1
  102. package/fesm2022/kirbydesign-designsystem-testing.mjs +236 -243
  103. package/fesm2022/kirbydesign-designsystem-testing.mjs.map +1 -1
  104. package/fesm2022/kirbydesign-designsystem-toast.mjs +98 -62
  105. package/fesm2022/kirbydesign-designsystem-toast.mjs.map +1 -1
  106. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs +155 -127
  107. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs.map +1 -1
  108. package/fesm2022/kirbydesign-designsystem-toggle.mjs +180 -150
  109. package/fesm2022/kirbydesign-designsystem-toggle.mjs.map +1 -1
  110. package/fesm2022/kirbydesign-designsystem-types.mjs +39 -24
  111. package/fesm2022/kirbydesign-designsystem-types.mjs.map +1 -1
  112. package/fesm2022/kirbydesign-designsystem.mjs +516 -407
  113. package/fesm2022/kirbydesign-designsystem.mjs.map +1 -1
  114. package/icons/svg/megaphone.svg +3 -0
  115. package/icons/svg/person-blocked.svg +3 -0
  116. package/icons/svg/person-check.svg +3 -0
  117. package/icons/svg/person-close.svg +3 -0
  118. package/icons/svg/person-cloud.svg +3 -0
  119. package/icons/svg/person-power.svg +3 -0
  120. package/icons/svg/person-warning.svg +3 -0
  121. package/icons/svg/phone-device-pin.svg +3 -0
  122. package/icons/svg/phone-device.svg +3 -2
  123. package/package.json +10 -10
  124. package/readme.md +37 -0
  125. package/types/kirbydesign-designsystem-accordion.d.ts +72 -39
  126. package/types/kirbydesign-designsystem-accordion.d.ts.map +1 -1
  127. package/types/kirbydesign-designsystem-action-group.d.ts +46 -39
  128. package/types/kirbydesign-designsystem-action-group.d.ts.map +1 -1
  129. package/types/kirbydesign-designsystem-avatar.d.ts +62 -26
  130. package/types/kirbydesign-designsystem-avatar.d.ts.map +1 -1
  131. package/types/kirbydesign-designsystem-badge.d.ts +30 -19
  132. package/types/kirbydesign-designsystem-badge.d.ts.map +1 -1
  133. package/types/kirbydesign-designsystem-button.d.ts +70 -45
  134. package/types/kirbydesign-designsystem-button.d.ts.map +1 -1
  135. package/types/kirbydesign-designsystem-calendar.d.ts +193 -132
  136. package/types/kirbydesign-designsystem-calendar.d.ts.map +1 -1
  137. package/types/kirbydesign-designsystem-card.d.ts +130 -66
  138. package/types/kirbydesign-designsystem-card.d.ts.map +1 -1
  139. package/types/kirbydesign-designsystem-chart.d.ts +198 -172
  140. package/types/kirbydesign-designsystem-chart.d.ts.map +1 -1
  141. package/types/kirbydesign-designsystem-checkbox.d.ts +102 -68
  142. package/types/kirbydesign-designsystem-checkbox.d.ts.map +1 -1
  143. package/types/kirbydesign-designsystem-config.d.ts +17 -21
  144. package/types/kirbydesign-designsystem-config.d.ts.map +1 -1
  145. package/types/kirbydesign-designsystem-data-table.d.ts +46 -26
  146. package/types/kirbydesign-designsystem-data-table.d.ts.map +1 -1
  147. package/types/kirbydesign-designsystem-divider.d.ts +11 -9
  148. package/types/kirbydesign-designsystem-divider.d.ts.map +1 -1
  149. package/types/kirbydesign-designsystem-dropdown.d.ts +219 -166
  150. package/types/kirbydesign-designsystem-dropdown.d.ts.map +1 -1
  151. package/types/kirbydesign-designsystem-empty-state.d.ts +58 -35
  152. package/types/kirbydesign-designsystem-empty-state.d.ts.map +1 -1
  153. package/types/kirbydesign-designsystem-fab-sheet.d.ts +34 -28
  154. package/types/kirbydesign-designsystem-fab-sheet.d.ts.map +1 -1
  155. package/types/kirbydesign-designsystem-flag.d.ts +18 -13
  156. package/types/kirbydesign-designsystem-flag.d.ts.map +1 -1
  157. package/types/kirbydesign-designsystem-form-field.d.ts +409 -242
  158. package/types/kirbydesign-designsystem-form-field.d.ts.map +1 -1
  159. package/types/kirbydesign-designsystem-gesture.d.ts +41 -46
  160. package/types/kirbydesign-designsystem-gesture.d.ts.map +1 -1
  161. package/types/kirbydesign-designsystem-header.d.ts +102 -64
  162. package/types/kirbydesign-designsystem-header.d.ts.map +1 -1
  163. package/types/kirbydesign-designsystem-helpers-scss.d.ts +6 -8
  164. package/types/kirbydesign-designsystem-helpers-scss.d.ts.map +1 -1
  165. package/types/kirbydesign-designsystem-helpers.d.ts +83 -97
  166. package/types/kirbydesign-designsystem-helpers.d.ts.map +1 -1
  167. package/types/kirbydesign-designsystem-icon.d.ts +63 -59
  168. package/types/kirbydesign-designsystem-icon.d.ts.map +1 -1
  169. package/types/kirbydesign-designsystem-item-group.d.ts +6 -9
  170. package/types/kirbydesign-designsystem-item-group.d.ts.map +1 -1
  171. package/types/kirbydesign-designsystem-item-sliding.d.ts +30 -26
  172. package/types/kirbydesign-designsystem-item-sliding.d.ts.map +1 -1
  173. package/types/kirbydesign-designsystem-item.d.ts +93 -54
  174. package/types/kirbydesign-designsystem-item.d.ts.map +1 -1
  175. package/types/kirbydesign-designsystem-kirby-app.d.ts +18 -19
  176. package/types/kirbydesign-designsystem-kirby-app.d.ts.map +1 -1
  177. package/types/kirbydesign-designsystem-list.d.ts +392 -263
  178. package/types/kirbydesign-designsystem-list.d.ts.map +1 -1
  179. package/types/kirbydesign-designsystem-loading-overlay.d.ts +35 -24
  180. package/types/kirbydesign-designsystem-loading-overlay.d.ts.map +1 -1
  181. package/types/kirbydesign-designsystem-menu.d.ts +119 -69
  182. package/types/kirbydesign-designsystem-menu.d.ts.map +1 -1
  183. package/types/kirbydesign-designsystem-modal.d.ts +578 -455
  184. package/types/kirbydesign-designsystem-modal.d.ts.map +1 -1
  185. package/types/kirbydesign-designsystem-page.d.ts +308 -226
  186. package/types/kirbydesign-designsystem-page.d.ts.map +1 -1
  187. package/types/kirbydesign-designsystem-popover.d.ts +48 -40
  188. package/types/kirbydesign-designsystem-popover.d.ts.map +1 -1
  189. package/types/kirbydesign-designsystem-progress-circle.d.ts +59 -61
  190. package/types/kirbydesign-designsystem-progress-circle.d.ts.map +1 -1
  191. package/types/kirbydesign-designsystem-radio.d.ts +147 -98
  192. package/types/kirbydesign-designsystem-radio.d.ts.map +1 -1
  193. package/types/kirbydesign-designsystem-range.d.ts +90 -45
  194. package/types/kirbydesign-designsystem-range.d.ts.map +1 -1
  195. package/types/kirbydesign-designsystem-reorder-list.d.ts +44 -32
  196. package/types/kirbydesign-designsystem-reorder-list.d.ts.map +1 -1
  197. package/types/kirbydesign-designsystem-router-outlet.d.ts +23 -18
  198. package/types/kirbydesign-designsystem-router-outlet.d.ts.map +1 -1
  199. package/types/kirbydesign-designsystem-section-header.d.ts +5 -8
  200. package/types/kirbydesign-designsystem-section-header.d.ts.map +1 -1
  201. package/types/kirbydesign-designsystem-segmented-control.d.ts +123 -100
  202. package/types/kirbydesign-designsystem-segmented-control.d.ts.map +1 -1
  203. package/types/kirbydesign-designsystem-shared-floating.d.ts +183 -128
  204. package/types/kirbydesign-designsystem-shared-floating.d.ts.map +1 -1
  205. package/types/kirbydesign-designsystem-shared-portal.d.ts +29 -28
  206. package/types/kirbydesign-designsystem-shared-portal.d.ts.map +1 -1
  207. package/types/kirbydesign-designsystem-shared.d.ts +143 -139
  208. package/types/kirbydesign-designsystem-shared.d.ts.map +1 -1
  209. package/types/kirbydesign-designsystem-slide-button.d.ts +43 -34
  210. package/types/kirbydesign-designsystem-slide-button.d.ts.map +1 -1
  211. package/types/kirbydesign-designsystem-slide.d.ts +80 -59
  212. package/types/kirbydesign-designsystem-slide.d.ts.map +1 -1
  213. package/types/kirbydesign-designsystem-spinner.d.ts +13 -14
  214. package/types/kirbydesign-designsystem-spinner.d.ts.map +1 -1
  215. package/types/kirbydesign-designsystem-tab-navigation.d.ts +78 -55
  216. package/types/kirbydesign-designsystem-tab-navigation.d.ts.map +1 -1
  217. package/types/kirbydesign-designsystem-tabs.d.ts +50 -45
  218. package/types/kirbydesign-designsystem-tabs.d.ts.map +1 -1
  219. package/types/kirbydesign-designsystem-testing-base.d.ts +2435 -815
  220. package/types/kirbydesign-designsystem-testing-base.d.ts.map +1 -1
  221. package/types/kirbydesign-designsystem-testing-jasmine.d.ts +9 -10
  222. package/types/kirbydesign-designsystem-testing-jasmine.d.ts.map +1 -1
  223. package/types/kirbydesign-designsystem-testing-jest.d.ts +9 -10
  224. package/types/kirbydesign-designsystem-testing-jest.d.ts.map +1 -1
  225. package/types/kirbydesign-designsystem-testing.d.ts +52 -58
  226. package/types/kirbydesign-designsystem-testing.d.ts.map +1 -1
  227. package/types/kirbydesign-designsystem-toast.d.ts +25 -31
  228. package/types/kirbydesign-designsystem-toast.d.ts.map +1 -1
  229. package/types/kirbydesign-designsystem-toggle-button.d.ts +62 -56
  230. package/types/kirbydesign-designsystem-toggle-button.d.ts.map +1 -1
  231. package/types/kirbydesign-designsystem-toggle.d.ts +71 -63
  232. package/types/kirbydesign-designsystem-toggle.d.ts.map +1 -1
  233. package/types/kirbydesign-designsystem-types.d.ts +15 -22
  234. package/types/kirbydesign-designsystem-types.d.ts.map +1 -1
  235. package/types/kirbydesign-designsystem.d.ts +135 -123
  236. package/types/kirbydesign-designsystem.d.ts.map +1 -1
  237. package/accordion/package.json +0 -4
  238. package/action-group/package.json +0 -4
  239. package/avatar/package.json +0 -4
  240. package/badge/package.json +0 -4
  241. package/button/package.json +0 -4
  242. package/calendar/package.json +0 -4
  243. package/card/package.json +0 -4
  244. package/chart/package.json +0 -4
  245. package/checkbox/package.json +0 -4
  246. package/config/package.json +0 -4
  247. package/data-table/package.json +0 -4
  248. package/divider/package.json +0 -4
  249. package/dropdown/package.json +0 -4
  250. package/empty-state/package.json +0 -4
  251. package/fab-sheet/package.json +0 -4
  252. package/flag/package.json +0 -4
  253. package/form-field/package.json +0 -4
  254. package/gesture/package.json +0 -4
  255. package/header/package.json +0 -4
  256. package/helpers/package.json +0 -4
  257. package/helpers/scss/package.json +0 -4
  258. package/icon/package.json +0 -4
  259. package/item/package.json +0 -4
  260. package/item-group/package.json +0 -4
  261. package/item-sliding/package.json +0 -4
  262. package/kirby-app/package.json +0 -4
  263. package/list/package.json +0 -4
  264. package/loading-overlay/package.json +0 -4
  265. package/menu/package.json +0 -4
  266. package/modal/package.json +0 -4
  267. package/page/package.json +0 -4
  268. package/popover/package.json +0 -4
  269. package/progress-circle/package.json +0 -4
  270. package/radio/package.json +0 -4
  271. package/range/package.json +0 -4
  272. package/reorder-list/package.json +0 -4
  273. package/router-outlet/package.json +0 -4
  274. package/section-header/package.json +0 -4
  275. package/segmented-control/package.json +0 -4
  276. package/shared/floating/package.json +0 -4
  277. package/shared/package.json +0 -4
  278. package/shared/portal/package.json +0 -4
  279. package/slide/package.json +0 -4
  280. package/slide-button/package.json +0 -4
  281. package/spinner/package.json +0 -4
  282. package/tab-navigation/package.json +0 -4
  283. package/tabs/package.json +0 -4
  284. package/testing/package.json +0 -4
  285. package/testing-base/package.json +0 -4
  286. package/testing-jasmine/package.json +0 -4
  287. package/testing-jest/package.json +0 -4
  288. package/toast/package.json +0 -4
  289. package/toggle/package.json +0 -4
  290. package/toggle-button/package.json +0 -4
  291. package/types/package.json +0 -4
@@ -1,552 +1,686 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, ElementRef, Input, HostBinding, Directive, LOCALE_ID, Inject } from '@angular/core';
3
- import * as i2 from '@kirbydesign/designsystem/helpers';
4
- import { DesignTokenHelper, ColorHelper, LineClampHelper } from '@kirbydesign/designsystem/helpers';
5
-
6
- /**
7
- * Factory that creates a new ResizeObserver and allows us to stub it out in unit tests.
8
- * @docs-private
9
- */
10
- class ResizeObserverFactory {
11
- create(callback) {
12
- return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
13
- }
14
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
15
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' }); }
16
- }
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverFactory, decorators: [{
18
- type: Injectable,
19
- args: [{ providedIn: 'root' }]
20
- }] });
21
-
22
- class ResizeObserverService {
23
- constructor(_resizeObserverFactory) {
24
- this._resizeObserverFactory = _resizeObserverFactory;
25
- this.observedElements = new WeakMap();
26
- this.observer = this._resizeObserverFactory.create((entries) => this.handleResize(entries));
27
- }
28
- observe(elementOrRef, action) {
29
- const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
30
- if (!this.observedElements.has(element)) {
31
- if (this.observer) {
32
- this.observer.observe(element);
33
- }
34
- this.observedElements.set(element, action);
35
- }
36
- }
37
- ngOnDestroy() {
38
- if (this.observer) {
39
- this.observer.disconnect();
40
- }
41
- this.observedElements = null;
42
- }
43
- unobserve(elementOrRef) {
44
- const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
45
- if (this.observedElements.has(element)) {
46
- if (this.observer) {
47
- this.observer.unobserve(element);
48
- }
49
- this.observedElements.delete(element);
50
- }
51
- }
52
- handleResize(entries) {
53
- entries.forEach((entry) => {
54
- const action = this.observedElements.get(entry.target);
55
- if (action) {
56
- action(entry);
57
- }
58
- });
59
- }
60
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverService, providedIn: 'root' }); }
62
- }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ResizeObserverService, decorators: [{
64
- type: Injectable,
65
- args: [{ providedIn: 'root' }]
66
- }], ctorParameters: () => [{ type: ResizeObserverFactory }] });
67
-
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, ElementRef, HostBinding, Inject, Injectable, Input, LOCALE_ID } from "@angular/core";
3
+ import * as i2 from "@kirbydesign/designsystem/helpers";
4
+ import { ColorHelper, DesignTokenHelper, LineClampHelper } from "@kirbydesign/designsystem/helpers";
5
+ var ResizeObserverFactory = class ResizeObserverFactory {
6
+ create(callback) {
7
+ return typeof ResizeObserver === "undefined" ? null : new ResizeObserver(callback);
8
+ }
9
+ static {
10
+ this.ɵfac = i0.ɵɵngDeclareFactory({
11
+ minVersion: "12.0.0",
12
+ version: "22.2.3",
13
+ ngImport: i0,
14
+ type: ResizeObserverFactory,
15
+ deps: [],
16
+ target: i0.ɵɵFactoryTarget.Injectable
17
+ });
18
+ }
19
+ static {
20
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
21
+ minVersion: "12.0.0",
22
+ version: "22.2.3",
23
+ ngImport: i0,
24
+ type: ResizeObserverFactory,
25
+ providedIn: "root"
26
+ });
27
+ }
28
+ };
29
+ i0.ɵɵngDeclareClassMetadata({
30
+ minVersion: "12.0.0",
31
+ version: "22.2.3",
32
+ ngImport: i0,
33
+ type: ResizeObserverFactory,
34
+ decorators: [{
35
+ type: Injectable,
36
+ args: [{ providedIn: "root" }]
37
+ }]
38
+ });
39
+ var ResizeObserverService = class ResizeObserverService {
40
+ constructor(_resizeObserverFactory) {
41
+ this._resizeObserverFactory = _resizeObserverFactory;
42
+ this.observedElements = /* @__PURE__ */ new WeakMap();
43
+ this.observer = this._resizeObserverFactory.create((entries) => this.handleResize(entries));
44
+ }
45
+ observe(elementOrRef, action) {
46
+ const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
47
+ if (!this.observedElements.has(element)) {
48
+ if (this.observer) this.observer.observe(element);
49
+ this.observedElements.set(element, action);
50
+ }
51
+ }
52
+ ngOnDestroy() {
53
+ if (this.observer) this.observer.disconnect();
54
+ }
55
+ unobserve(elementOrRef) {
56
+ const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
57
+ if (this.observedElements.has(element)) {
58
+ if (this.observer) this.observer.unobserve(element);
59
+ this.observedElements.delete(element);
60
+ }
61
+ }
62
+ handleResize(entries) {
63
+ entries.forEach((entry) => {
64
+ const action = this.observedElements.get(entry.target);
65
+ if (action) action(entry);
66
+ });
67
+ }
68
+ static {
69
+ this.ɵfac = i0.ɵɵngDeclareFactory({
70
+ minVersion: "12.0.0",
71
+ version: "22.2.3",
72
+ ngImport: i0,
73
+ type: ResizeObserverService,
74
+ deps: [{ token: ResizeObserverFactory }],
75
+ target: i0.ɵɵFactoryTarget.Injectable
76
+ });
77
+ }
78
+ static {
79
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
80
+ minVersion: "12.0.0",
81
+ version: "22.2.3",
82
+ ngImport: i0,
83
+ type: ResizeObserverService,
84
+ providedIn: "root"
85
+ });
86
+ }
87
+ };
88
+ i0.ɵɵngDeclareClassMetadata({
89
+ minVersion: "12.0.0",
90
+ version: "22.2.3",
91
+ ngImport: i0,
92
+ type: ResizeObserverService,
93
+ decorators: [{
94
+ type: Injectable,
95
+ args: [{ providedIn: "root" }]
96
+ }],
97
+ ctorParameters: () => [{ type: ResizeObserverFactory }]
98
+ });
68
99
  const TEXT_RESIZE_THRESHOLD = parseFloat(DesignTokenHelper.textResizeThreshold());
69
- const TEXT_RESIZE_CLASS = 'kirby-trt';
100
+ const TEXT_RESIZE_CLASS = "kirby-trt";
70
101
  const BASE_FONT_SIZE_PX = parseInt(DesignTokenHelper.baseFontSizePx());
71
- /**
72
- * Element width combines both signals: rem scaling (desktop/iOS) and env(preferred-text-scale)
73
- * (Android). On platforms where env() is unsupported, the fallback `1` makes it a no-op multiplier.
74
- */
75
- const OBSERVER_ELEMENT_STYLES = 'position:absolute;width:calc(1rem * env(preferred-text-scale, 1));height:1rem;top:-9999px;visibility:hidden;pointer-events:none';
76
- /**
77
- * Detects when text is resized above a certain threshold in browser/OS settings and toggles a
78
- * `kirby-trt` class on the root html element.
79
- *
80
- * Uses a `ResizeObserver` on a hidden element sized with `calc(1rem * env(preferred-text-scale, 1))`.
81
- * This combines two detections into one element:
82
- *
83
- * - **rem scaling** — on desktop browsers and iOS, changing text size modifies the root font-size,
84
- * which changes `1rem` and triggers the observer.
85
- *
86
- * - **`env(preferred-text-scale)`** — on platforms that support this CSS environment variable
87
- * (e.g. Android Chrome/WebView), the multiplier reflects the OS/browser text scale factor.
88
- * When the user changes font size in system settings, the env value updates and the element resizes.
89
- *
90
- * On platforms where `env(preferred-text-scale)` is not supported, the value falls back to `1`,
91
- * making the width equivalent to `1rem`.
92
- *
93
- * @example
94
- * ```scss
95
- * @include utils.media('<medium') {
96
- * :host-context(.kirby-trt) {
97
- * // Styles for narrow screens with scaled text
98
- * }
99
- * }
100
- * ```
101
- *
102
- * @see https://drafts.csswg.org/css-env-1/#preferred-text-scale
103
- */
104
- class TextResizeObserverService {
105
- constructor() {
106
- this.resizeObserver = null;
107
- this.textResizeObserverElement = null;
108
- this.onObservedResize = () => {
109
- const widthInPx = this.textResizeObserverElement?.offsetWidth ?? BASE_FONT_SIZE_PX;
110
- const scale = widthInPx / BASE_FONT_SIZE_PX;
111
- document.documentElement.classList.toggle(TEXT_RESIZE_CLASS, scale > TEXT_RESIZE_THRESHOLD);
112
- };
113
- }
114
- initialize() {
115
- if (typeof window === 'undefined') {
116
- return;
117
- }
118
- this.textResizeObserverElement = document.createElement('div');
119
- this.textResizeObserverElement.style.cssText = OBSERVER_ELEMENT_STYLES;
120
- document.body.appendChild(this.textResizeObserverElement);
121
- this.resizeObserver = new ResizeObserver(this.onObservedResize);
122
- this.resizeObserver.observe(this.textResizeObserverElement);
123
- this.onObservedResize();
124
- }
125
- ngOnDestroy() {
126
- this.resizeObserver?.disconnect();
127
- this.textResizeObserverElement?.remove();
128
- }
129
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TextResizeObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
130
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TextResizeObserverService, providedIn: 'root' }); }
131
- }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TextResizeObserverService, decorators: [{
133
- type: Injectable,
134
- args: [{ providedIn: 'root' }]
135
- }] });
136
-
137
- class ThemeColorDirective {
138
- constructor() {
139
- this._isDefault = true;
140
- }
141
- get isDefault() {
142
- return this._isDefault;
143
- }
144
- get isPrimary() {
145
- return this._isPrimary;
146
- }
147
- get isSecondary() {
148
- return this._isSecondary;
149
- }
150
- get isTertiary() {
151
- return this._isTertiary;
152
- }
153
- get isSuccess() {
154
- return this._isSuccess;
155
- }
156
- get isWarning() {
157
- return this._isWarning;
158
- }
159
- get isDanger() {
160
- return this._isDanger;
161
- }
162
- get isLight() {
163
- return this._isLight;
164
- }
165
- get isMedium() {
166
- return this._isMedium;
167
- }
168
- get isDark() {
169
- return this._isDark;
170
- }
171
- get isWhite() {
172
- return this._isWhite;
173
- }
174
- get isBrightnessWhite() {
175
- return this._isBrightnessWhite;
176
- }
177
- get isBrightnessLight() {
178
- return this._isBrightnessLight;
179
- }
180
- get isBrightnessDark() {
181
- return this._isBrightnessDark;
182
- }
183
- set themeColor(value) {
184
- this._isDefault = !value;
185
- this._isPrimary = value === 'primary';
186
- this._isSecondary = value === 'secondary';
187
- this._isTertiary = value === 'tertiary';
188
- this._isSuccess = value === 'success';
189
- this._isWarning = value === 'warning';
190
- this._isDanger = value === 'danger';
191
- this._isLight = value === 'light';
192
- this._isMedium = value === 'medium';
193
- this._isDark = value === 'dark';
194
- this._isWhite = value === 'white';
195
- const colorBrightness = ColorHelper.getColorBrightness(value);
196
- this._isBrightnessWhite = colorBrightness === 'white';
197
- this._isBrightnessLight = colorBrightness === 'light';
198
- this._isBrightnessDark = colorBrightness === 'dark';
199
- }
200
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ThemeColorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
201
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.18", type: ThemeColorDirective, isStandalone: true, selector: "kirby-avatar[themeColor],\n kirby-card[themeColor],\n kirby-icon[themeColor],\n kirby-progress-circle-ring[themeColor],\n kirby-modal-footer[themeColor],\n kirby-empty-state[themeColor]", inputs: { themeColor: "themeColor" }, host: { properties: { "class.default": "this.isDefault", "class.primary": "this.isPrimary", "class.secondary": "this.isSecondary", "class.tertiary": "this.isTertiary", "class.success": "this.isSuccess", "class.warning": "this.isWarning", "class.danger": "this.isDanger", "class.light": "this.isLight", "class.medium": "this.isMedium", "class.dark": "this.isDark", "class.white": "this.isWhite", "class.kirby-color-brightness-white": "this.isBrightnessWhite", "class.kirby-color-brightness-light": "this.isBrightnessLight", "class.kirby-color-brightness-dark": "this.isBrightnessDark" } }, ngImport: i0 }); }
202
- }
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ThemeColorDirective, decorators: [{
204
- type: Directive,
205
- args: [{
206
- standalone: true,
207
- // eslint-disable-next-line @angular-eslint/directive-selector
208
- selector: `kirby-avatar[themeColor],
102
+ const OBSERVER_ELEMENT_STYLES = "position:absolute;width:calc(1rem * env(preferred-text-scale, 1));height:1rem;top:-9999px;visibility:hidden;pointer-events:none";
103
+ var TextResizeObserverService = class TextResizeObserverService {
104
+ constructor() {
105
+ this.resizeObserver = null;
106
+ this.textResizeObserverElement = null;
107
+ this.onObservedResize = () => {
108
+ const scale = (this.textResizeObserverElement?.offsetWidth ?? BASE_FONT_SIZE_PX) / BASE_FONT_SIZE_PX;
109
+ document.documentElement.classList.toggle(TEXT_RESIZE_CLASS, scale > TEXT_RESIZE_THRESHOLD);
110
+ };
111
+ }
112
+ initialize() {
113
+ if (typeof window === "undefined") return;
114
+ this.textResizeObserverElement = document.createElement("div");
115
+ this.textResizeObserverElement.style.cssText = OBSERVER_ELEMENT_STYLES;
116
+ document.body.appendChild(this.textResizeObserverElement);
117
+ this.resizeObserver = new ResizeObserver(this.onObservedResize);
118
+ this.resizeObserver.observe(this.textResizeObserverElement);
119
+ this.onObservedResize();
120
+ }
121
+ ngOnDestroy() {
122
+ this.resizeObserver?.disconnect();
123
+ this.textResizeObserverElement?.remove();
124
+ }
125
+ static {
126
+ this.ɵfac = i0.ɵɵngDeclareFactory({
127
+ minVersion: "12.0.0",
128
+ version: "22.2.3",
129
+ ngImport: i0,
130
+ type: TextResizeObserverService,
131
+ deps: [],
132
+ target: i0.ɵɵFactoryTarget.Injectable
133
+ });
134
+ }
135
+ static {
136
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
137
+ minVersion: "12.0.0",
138
+ version: "22.2.3",
139
+ ngImport: i0,
140
+ type: TextResizeObserverService,
141
+ providedIn: "root"
142
+ });
143
+ }
144
+ };
145
+ i0.ɵɵngDeclareClassMetadata({
146
+ minVersion: "12.0.0",
147
+ version: "22.2.3",
148
+ ngImport: i0,
149
+ type: TextResizeObserverService,
150
+ decorators: [{
151
+ type: Injectable,
152
+ args: [{ providedIn: "root" }]
153
+ }]
154
+ });
155
+ var ThemeColorDirective = class ThemeColorDirective {
156
+ constructor() {
157
+ this._isDefault = true;
158
+ this._isPrimary = false;
159
+ this._isSecondary = false;
160
+ this._isTertiary = false;
161
+ this._isSuccess = false;
162
+ this._isWarning = false;
163
+ this._isDanger = false;
164
+ this._isLight = false;
165
+ this._isMedium = false;
166
+ this._isDark = false;
167
+ this._isWhite = false;
168
+ this._isBrightnessWhite = false;
169
+ this._isBrightnessLight = false;
170
+ this._isBrightnessDark = false;
171
+ }
172
+ get isDefault() {
173
+ return this._isDefault;
174
+ }
175
+ get isPrimary() {
176
+ return this._isPrimary;
177
+ }
178
+ get isSecondary() {
179
+ return this._isSecondary;
180
+ }
181
+ get isTertiary() {
182
+ return this._isTertiary;
183
+ }
184
+ get isSuccess() {
185
+ return this._isSuccess;
186
+ }
187
+ get isWarning() {
188
+ return this._isWarning;
189
+ }
190
+ get isDanger() {
191
+ return this._isDanger;
192
+ }
193
+ get isLight() {
194
+ return this._isLight;
195
+ }
196
+ get isMedium() {
197
+ return this._isMedium;
198
+ }
199
+ get isDark() {
200
+ return this._isDark;
201
+ }
202
+ get isWhite() {
203
+ return this._isWhite;
204
+ }
205
+ get isBrightnessWhite() {
206
+ return this._isBrightnessWhite;
207
+ }
208
+ get isBrightnessLight() {
209
+ return this._isBrightnessLight;
210
+ }
211
+ get isBrightnessDark() {
212
+ return this._isBrightnessDark;
213
+ }
214
+ set themeColor(value) {
215
+ this._isDefault = !value;
216
+ this._isPrimary = value === "primary";
217
+ this._isSecondary = value === "secondary";
218
+ this._isTertiary = value === "tertiary";
219
+ this._isSuccess = value === "success";
220
+ this._isWarning = value === "warning";
221
+ this._isDanger = value === "danger";
222
+ this._isLight = value === "light";
223
+ this._isMedium = value === "medium";
224
+ this._isDark = value === "dark";
225
+ this._isWhite = value === "white";
226
+ const colorBrightness = ColorHelper.getColorBrightness(value);
227
+ this._isBrightnessWhite = colorBrightness === "white";
228
+ this._isBrightnessLight = colorBrightness === "light";
229
+ this._isBrightnessDark = colorBrightness === "dark";
230
+ }
231
+ static {
232
+ this.ɵfac = i0.ɵɵngDeclareFactory({
233
+ minVersion: "12.0.0",
234
+ version: "22.2.3",
235
+ ngImport: i0,
236
+ type: ThemeColorDirective,
237
+ deps: [],
238
+ target: i0.ɵɵFactoryTarget.Directive
239
+ });
240
+ }
241
+ static {
242
+ this.ɵdir = i0.ɵɵngDeclareDirective({
243
+ minVersion: "14.0.0",
244
+ version: "22.2.3",
245
+ type: ThemeColorDirective,
246
+ isStandalone: true,
247
+ selector: "kirby-avatar[themeColor],\n kirby-card[themeColor],\n kirby-icon[themeColor],\n kirby-progress-circle-ring[themeColor],\n kirby-modal-footer[themeColor],\n kirby-empty-state[themeColor]",
248
+ inputs: { themeColor: "themeColor" },
249
+ host: { properties: {
250
+ "class.default": "this.isDefault",
251
+ "class.primary": "this.isPrimary",
252
+ "class.secondary": "this.isSecondary",
253
+ "class.tertiary": "this.isTertiary",
254
+ "class.success": "this.isSuccess",
255
+ "class.warning": "this.isWarning",
256
+ "class.danger": "this.isDanger",
257
+ "class.light": "this.isLight",
258
+ "class.medium": "this.isMedium",
259
+ "class.dark": "this.isDark",
260
+ "class.white": "this.isWhite",
261
+ "class.kirby-color-brightness-white": "this.isBrightnessWhite",
262
+ "class.kirby-color-brightness-light": "this.isBrightnessLight",
263
+ "class.kirby-color-brightness-dark": "this.isBrightnessDark"
264
+ } },
265
+ ngImport: i0
266
+ });
267
+ }
268
+ };
269
+ i0.ɵɵngDeclareClassMetadata({
270
+ minVersion: "12.0.0",
271
+ version: "22.2.3",
272
+ ngImport: i0,
273
+ type: ThemeColorDirective,
274
+ decorators: [{
275
+ type: Directive,
276
+ args: [{
277
+ standalone: true,
278
+ selector: `kirby-avatar[themeColor],
209
279
  kirby-card[themeColor],
210
280
  kirby-icon[themeColor],
211
281
  kirby-progress-circle-ring[themeColor],
212
282
  kirby-modal-footer[themeColor],
213
- kirby-empty-state[themeColor]`,
214
- }]
215
- }], propDecorators: { isDefault: [{
216
- type: HostBinding,
217
- args: ['class.default']
218
- }], isPrimary: [{
219
- type: HostBinding,
220
- args: ['class.primary']
221
- }], isSecondary: [{
222
- type: HostBinding,
223
- args: ['class.secondary']
224
- }], isTertiary: [{
225
- type: HostBinding,
226
- args: ['class.tertiary']
227
- }], isSuccess: [{
228
- type: HostBinding,
229
- args: ['class.success']
230
- }], isWarning: [{
231
- type: HostBinding,
232
- args: ['class.warning']
233
- }], isDanger: [{
234
- type: HostBinding,
235
- args: ['class.danger']
236
- }], isLight: [{
237
- type: HostBinding,
238
- args: ['class.light']
239
- }], isMedium: [{
240
- type: HostBinding,
241
- args: ['class.medium']
242
- }], isDark: [{
243
- type: HostBinding,
244
- args: ['class.dark']
245
- }], isWhite: [{
246
- type: HostBinding,
247
- args: ['class.white']
248
- }], isBrightnessWhite: [{
249
- type: HostBinding,
250
- args: ['class.kirby-color-brightness-white']
251
- }], isBrightnessLight: [{
252
- type: HostBinding,
253
- args: ['class.kirby-color-brightness-light']
254
- }], isBrightnessDark: [{
255
- type: HostBinding,
256
- args: ['class.kirby-color-brightness-dark']
257
- }], themeColor: [{
258
- type: Input
259
- }] } });
260
-
261
- class ComponentLoaderDirective {
262
- constructor(componentFactoryResolver, viewContainerRef, renderer) {
263
- this.componentFactoryResolver = componentFactoryResolver;
264
- this.viewContainerRef = viewContainerRef;
265
- this.renderer = renderer;
266
- }
267
- ngOnInit() {
268
- this.loadCard();
269
- }
270
- loadCard() {
271
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.configuration.component);
272
- this.viewContainerRef.clear();
273
- const componentRef = this.viewContainerRef.createComponent(componentFactory);
274
- if (componentRef && componentRef.location && componentRef.location.nativeElement) {
275
- this.renderer.addClass(componentRef.location.nativeElement, this.cssClass);
276
- }
277
- componentRef.instance.data = this.configuration.data;
278
- }
279
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ComponentLoaderDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
280
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.18", type: ComponentLoaderDirective, isStandalone: true, selector: "[kirbyLoadComponent]", inputs: { configuration: ["kirbyLoadComponent", "configuration"], cssClass: "cssClass" }, ngImport: i0 }); }
281
- }
282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ComponentLoaderDirective, decorators: [{
283
- type: Directive,
284
- args: [{
285
- selector: '[kirbyLoadComponent]',
286
- standalone: true,
287
- }]
288
- }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }], propDecorators: { configuration: [{
289
- type: Input,
290
- args: ['kirbyLoadComponent']
291
- }], cssClass: [{
292
- type: Input
293
- }] } });
294
-
295
- const fontSize = DesignTokenHelper.fontSize;
296
- const lineHeight = DesignTokenHelper.lineHeight;
297
- class FitHeadingDirective {
298
- constructor(elementRef, renderer, resizeObserverService, lineClampHelper) {
299
- this.elementRef = elementRef;
300
- this.renderer = renderer;
301
- this.resizeObserverService = resizeObserverService;
302
- this.lineClampHelper = lineClampHelper;
303
- this.headingSizes = [
304
- {
305
- name: 'h1',
306
- fontSize: fontSize('xl'),
307
- lineHeight: lineHeight('xl'),
308
- },
309
- {
310
- name: 'h2',
311
- fontSize: fontSize('l'),
312
- lineHeight: lineHeight('l'),
313
- },
314
- {
315
- name: 'h3',
316
- fontSize: fontSize('m'),
317
- lineHeight: lineHeight('m'),
318
- },
319
- ];
320
- }
321
- ngOnInit() {
322
- if (this.config && this.config.maxLines) {
323
- this.observeResize();
324
- this.isObservingHostElement = true;
325
- }
326
- }
327
- ngOnDestroy() {
328
- if (this.isObservingHostElement) {
329
- this.resizeObserverService.unobserve(this.elementRef);
330
- if (this.hostElementClone) {
331
- this.renderer.removeChild(this.elementRef.nativeElement, this.hostElementClone);
332
- }
333
- }
334
- }
335
- observeResize() {
336
- this.resizeObserverService.observe(this.elementRef, () => {
337
- /**
338
- * setTimeout is used here to avoid repeated size changes
339
- * while the first size change is still ongoing.
340
- * This would result in the ResizeObserver being called again,
341
- * giving 'ResizeObserver loop limit exceeded' types of errors.
342
- */
343
- setTimeout(() => {
344
- this.scaleHeader();
345
- }, 0);
346
- });
347
- }
348
- scaleHeader() {
349
- if (this.isScalingHeader)
350
- return;
351
- this.isScalingHeader = true;
352
- if (!this.hostElementClone) {
353
- // Capture original CSS size before any scaling
354
- const computed = getComputedStyle(this.elementRef.nativeElement);
355
- this.originalSize = {
356
- name: 'original',
357
- fontSize: computed.fontSize,
358
- lineHeight: computed.lineHeight,
359
- };
360
- // Skip line-clamp for elements with line-height: normal (e.g. key-value) — conflicts with flex layout
361
- if (computed.lineHeight !== 'normal') {
362
- this.lineClampHelper.setMaxLines(this.elementRef.nativeElement, this.config.maxLines);
363
- }
364
- this.hostElementClone = this.generateHostElementClone();
365
- this.renderer.appendChild(this.elementRef.nativeElement.parentElement, this.hostElementClone);
366
- }
367
- // Use parent width to avoid feedback loop from shrink-wrapped element width
368
- const availableWidth = this.elementRef.nativeElement.parentElement.clientWidth;
369
- this.renderer.setStyle(this.hostElementClone, 'width', `${availableWidth}px`);
370
- // Try original CSS size first, then scale down through heading sizes
371
- const candidates = [this.originalSize, ...this.headingSizes];
372
- const fallbackSize = this.headingSizes[this.headingSizes.length - 1];
373
- const fittedSize = candidates.find(this.canFitHeading.bind(this)) || fallbackSize;
374
- this.setSize(this.elementRef.nativeElement, fittedSize);
375
- this.lineClampHelper.setLineHeight(this.elementRef.nativeElement, fittedSize.lineHeight);
376
- this.isScalingHeader = false;
377
- }
378
- canFitHeading(size) {
379
- this.setSize(this.hostElementClone, size);
380
- // Resolve line-height to pixels via getComputedStyle (handles unitless ratios)
381
- const computedLineHeight = parseFloat(getComputedStyle(this.hostElementClone).lineHeight);
382
- // Skip vertical check for line-height: normal (single-line content like values)
383
- const fitsVertically = isNaN(computedLineHeight)
384
- ? true
385
- : Math.round(this.hostElementClone.clientHeight / computedLineHeight) <= this.config.maxLines;
386
- // Check horizontal overflow for non-wrapping content (e.g. numbers)
387
- const fitsHorizontally = this.hostElementClone.scrollWidth <= this.hostElementClone.clientWidth;
388
- return fitsVertically && fitsHorizontally;
389
- }
390
- generateHostElementClone() {
391
- const clone = this.elementRef.nativeElement.cloneNode(true);
392
- this.renderer.setStyle(clone, 'position', 'absolute');
393
- this.renderer.setStyle(clone, 'visibility', 'hidden');
394
- this.lineClampHelper.removeLineClamp(clone);
395
- return clone;
396
- }
397
- setSize(el, size) {
398
- this.renderer.setStyle(el, 'font-size', size.fontSize);
399
- this.renderer.setStyle(el, 'line-height', size.lineHeight);
400
- }
401
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: FitHeadingDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: ResizeObserverService }, { token: i2.LineClampHelper }], target: i0.ɵɵFactoryTarget.Directive }); }
402
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.18", type: FitHeadingDirective, isStandalone: true, selector: "h1[kirbyFitHeading],h2[kirbyFitHeading],h3[kirbyFitHeading],[kirbyFitHeading]", inputs: { config: ["kirbyFitHeading", "config"] }, providers: [LineClampHelper], ngImport: i0 }); }
403
- }
404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: FitHeadingDirective, decorators: [{
405
- type: Directive,
406
- args: [{
407
- standalone: true,
408
- selector: `h1[kirbyFitHeading],h2[kirbyFitHeading],h3[kirbyFitHeading],[kirbyFitHeading]`,
409
- providers: [LineClampHelper],
410
- }]
411
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: ResizeObserverService }, { type: i2.LineClampHelper }], propDecorators: { config: [{
412
- type: Input,
413
- args: ['kirbyFitHeading']
414
- }] } });
415
-
283
+ kirby-empty-state[themeColor]`
284
+ }]
285
+ }],
286
+ propDecorators: {
287
+ isDefault: [{
288
+ type: HostBinding,
289
+ args: ["class.default"]
290
+ }],
291
+ isPrimary: [{
292
+ type: HostBinding,
293
+ args: ["class.primary"]
294
+ }],
295
+ isSecondary: [{
296
+ type: HostBinding,
297
+ args: ["class.secondary"]
298
+ }],
299
+ isTertiary: [{
300
+ type: HostBinding,
301
+ args: ["class.tertiary"]
302
+ }],
303
+ isSuccess: [{
304
+ type: HostBinding,
305
+ args: ["class.success"]
306
+ }],
307
+ isWarning: [{
308
+ type: HostBinding,
309
+ args: ["class.warning"]
310
+ }],
311
+ isDanger: [{
312
+ type: HostBinding,
313
+ args: ["class.danger"]
314
+ }],
315
+ isLight: [{
316
+ type: HostBinding,
317
+ args: ["class.light"]
318
+ }],
319
+ isMedium: [{
320
+ type: HostBinding,
321
+ args: ["class.medium"]
322
+ }],
323
+ isDark: [{
324
+ type: HostBinding,
325
+ args: ["class.dark"]
326
+ }],
327
+ isWhite: [{
328
+ type: HostBinding,
329
+ args: ["class.white"]
330
+ }],
331
+ isBrightnessWhite: [{
332
+ type: HostBinding,
333
+ args: ["class.kirby-color-brightness-white"]
334
+ }],
335
+ isBrightnessLight: [{
336
+ type: HostBinding,
337
+ args: ["class.kirby-color-brightness-light"]
338
+ }],
339
+ isBrightnessDark: [{
340
+ type: HostBinding,
341
+ args: ["class.kirby-color-brightness-dark"]
342
+ }],
343
+ themeColor: [{ type: Input }]
344
+ }
345
+ });
346
+ var ComponentLoaderDirective = class ComponentLoaderDirective {
347
+ constructor(viewContainerRef, renderer) {
348
+ this.viewContainerRef = viewContainerRef;
349
+ this.renderer = renderer;
350
+ this.cssClass = "";
351
+ }
352
+ ngOnInit() {
353
+ this.loadCard();
354
+ }
355
+ loadCard() {
356
+ this.viewContainerRef.clear();
357
+ const componentRef = this.viewContainerRef.createComponent(this.configuration.component);
358
+ if (componentRef && componentRef.location && componentRef.location.nativeElement) this.renderer.addClass(componentRef.location.nativeElement, this.cssClass);
359
+ componentRef.instance.data = this.configuration.data;
360
+ }
361
+ static {
362
+ this.ɵfac = i0.ɵɵngDeclareFactory({
363
+ minVersion: "12.0.0",
364
+ version: "22.2.3",
365
+ ngImport: i0,
366
+ type: ComponentLoaderDirective,
367
+ deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }],
368
+ target: i0.ɵɵFactoryTarget.Directive
369
+ });
370
+ }
371
+ static {
372
+ this.ɵdir = i0.ɵɵngDeclareDirective({
373
+ minVersion: "14.0.0",
374
+ version: "22.2.3",
375
+ type: ComponentLoaderDirective,
376
+ isStandalone: true,
377
+ selector: "[kirbyLoadComponent]",
378
+ inputs: {
379
+ configuration: ["kirbyLoadComponent", "configuration"],
380
+ cssClass: "cssClass"
381
+ },
382
+ ngImport: i0
383
+ });
384
+ }
385
+ };
386
+ i0.ɵɵngDeclareClassMetadata({
387
+ minVersion: "12.0.0",
388
+ version: "22.2.3",
389
+ ngImport: i0,
390
+ type: ComponentLoaderDirective,
391
+ decorators: [{
392
+ type: Directive,
393
+ args: [{
394
+ selector: "[kirbyLoadComponent]",
395
+ standalone: true
396
+ }]
397
+ }],
398
+ ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }],
399
+ propDecorators: {
400
+ configuration: [{
401
+ type: Input,
402
+ args: ["kirbyLoadComponent"]
403
+ }],
404
+ cssClass: [{ type: Input }]
405
+ }
406
+ });
407
+ var FitHeadingDirective = class FitHeadingDirective {
408
+ constructor(elementRef, renderer, resizeObserverService, lineClampHelper) {
409
+ this.elementRef = elementRef;
410
+ this.renderer = renderer;
411
+ this.resizeObserverService = resizeObserverService;
412
+ this.lineClampHelper = lineClampHelper;
413
+ this.isObservingHostElement = false;
414
+ this.isScalingHeader = false;
415
+ this.headingSizes = [
416
+ {
417
+ name: "h1",
418
+ fontSize: "var(--kirby-font-size-xl)",
419
+ lineHeight: "var(--kirby-line-height-xl)"
420
+ },
421
+ {
422
+ name: "h2",
423
+ fontSize: "var(--kirby-font-size-l)",
424
+ lineHeight: "var(--kirby-line-height-l)"
425
+ },
426
+ {
427
+ name: "h3",
428
+ fontSize: "var(--kirby-font-size-m)",
429
+ lineHeight: "var(--kirby-line-height-m)"
430
+ }
431
+ ];
432
+ }
433
+ ngOnInit() {
434
+ if (this.config && this.config.maxLines) {
435
+ this.observeResize();
436
+ this.isObservingHostElement = true;
437
+ }
438
+ }
439
+ ngOnDestroy() {
440
+ if (this.isObservingHostElement) {
441
+ this.resizeObserverService.unobserve(this.elementRef);
442
+ if (this.hostElementClone) this.renderer.removeChild(this.elementRef.nativeElement, this.hostElementClone);
443
+ }
444
+ }
445
+ observeResize() {
446
+ this.resizeObserverService.observe(this.elementRef, () => {
447
+ setTimeout(() => {
448
+ this.scaleHeader();
449
+ }, 0);
450
+ });
451
+ }
452
+ scaleHeader() {
453
+ const maxLines = this.config?.maxLines;
454
+ if (!maxLines || this.isScalingHeader) return;
455
+ this.isScalingHeader = true;
456
+ if (!this.hostElementClone) {
457
+ const computed = getComputedStyle(this.elementRef.nativeElement);
458
+ this.originalSize = {
459
+ name: "original",
460
+ fontSize: computed.fontSize,
461
+ lineHeight: computed.lineHeight
462
+ };
463
+ if (computed.lineHeight !== "normal") this.lineClampHelper.setMaxLines(this.elementRef.nativeElement, maxLines);
464
+ this.hostElementClone = this.generateHostElementClone();
465
+ this.renderer.appendChild(this.elementRef.nativeElement.parentElement, this.hostElementClone);
466
+ }
467
+ const availableWidth = this.elementRef.nativeElement.parentElement.clientWidth;
468
+ this.renderer.setStyle(this.hostElementClone, "width", `${availableWidth}px`);
469
+ const candidates = this.originalSize ? [this.originalSize, ...this.headingSizes] : this.headingSizes;
470
+ const fallbackSize = this.headingSizes[this.headingSizes.length - 1];
471
+ const fittedSize = candidates.find(this.canFitHeading.bind(this)) || fallbackSize;
472
+ this.setSize(this.elementRef.nativeElement, fittedSize);
473
+ this.lineClampHelper.setLineHeight(this.elementRef.nativeElement, fittedSize.lineHeight);
474
+ this.isScalingHeader = false;
475
+ }
476
+ canFitHeading(size) {
477
+ const hostElementClone = this.hostElementClone;
478
+ if (!hostElementClone || !this.config) return false;
479
+ this.setSize(hostElementClone, size);
480
+ const computedLineHeight = parseFloat(getComputedStyle(hostElementClone).lineHeight);
481
+ const fitsVertically = isNaN(computedLineHeight) ? true : Math.round(hostElementClone.clientHeight / computedLineHeight) <= this.config.maxLines;
482
+ const fitsHorizontally = hostElementClone.scrollWidth <= hostElementClone.clientWidth;
483
+ return fitsVertically && fitsHorizontally;
484
+ }
485
+ generateHostElementClone() {
486
+ const clone = this.elementRef.nativeElement.cloneNode(true);
487
+ this.renderer.setStyle(clone, "position", "absolute");
488
+ this.renderer.setStyle(clone, "visibility", "hidden");
489
+ this.lineClampHelper.removeLineClamp(clone);
490
+ return clone;
491
+ }
492
+ setSize(el, size) {
493
+ this.renderer.setStyle(el, "font-size", size.fontSize);
494
+ this.renderer.setStyle(el, "line-height", size.lineHeight);
495
+ }
496
+ static {
497
+ this.ɵfac = i0.ɵɵngDeclareFactory({
498
+ minVersion: "12.0.0",
499
+ version: "22.2.3",
500
+ ngImport: i0,
501
+ type: FitHeadingDirective,
502
+ deps: [
503
+ { token: i0.ElementRef },
504
+ { token: i0.Renderer2 },
505
+ { token: ResizeObserverService },
506
+ { token: i2.LineClampHelper }
507
+ ],
508
+ target: i0.ɵɵFactoryTarget.Directive
509
+ });
510
+ }
511
+ static {
512
+ this.ɵdir = i0.ɵɵngDeclareDirective({
513
+ minVersion: "14.0.0",
514
+ version: "22.2.3",
515
+ type: FitHeadingDirective,
516
+ isStandalone: true,
517
+ selector: "h1[kirbyFitHeading],h2[kirbyFitHeading],h3[kirbyFitHeading],[kirbyFitHeading]",
518
+ inputs: { config: ["kirbyFitHeading", "config"] },
519
+ providers: [LineClampHelper],
520
+ ngImport: i0
521
+ });
522
+ }
523
+ };
524
+ i0.ɵɵngDeclareClassMetadata({
525
+ minVersion: "12.0.0",
526
+ version: "22.2.3",
527
+ ngImport: i0,
528
+ type: FitHeadingDirective,
529
+ decorators: [{
530
+ type: Directive,
531
+ args: [{
532
+ standalone: true,
533
+ selector: `h1[kirbyFitHeading],h2[kirbyFitHeading],h3[kirbyFitHeading],[kirbyFitHeading]`,
534
+ providers: [LineClampHelper]
535
+ }]
536
+ }],
537
+ ctorParameters: () => [
538
+ { type: i0.ElementRef },
539
+ { type: i0.Renderer2 },
540
+ { type: ResizeObserverService },
541
+ { type: i2.LineClampHelper }
542
+ ],
543
+ propDecorators: { config: [{
544
+ type: Input,
545
+ args: ["kirbyFitHeading"]
546
+ }] }
547
+ });
416
548
  function findItemLabel(element) {
417
- const itemEl = element.closest('kirby-item');
418
- if (itemEl) {
419
- return itemEl.querySelector('kirby-label');
420
- }
421
- return null;
549
+ const itemEl = element.closest("kirby-item");
550
+ if (itemEl) return itemEl.querySelector("kirby-label");
551
+ return null;
422
552
  }
423
553
  function setAccessibleLabel(element) {
424
- const label = findItemLabel(element);
425
- if (label) {
426
- label.setAttribute('aria-hidden', 'true');
427
- return label.textContent;
428
- }
554
+ const label = findItemLabel(element);
555
+ if (!label) return "";
556
+ label.setAttribute("aria-hidden", "true");
557
+ return label.textContent ?? "";
429
558
  }
430
559
  function inheritAriaLabelText(element) {
431
- const attribute = 'aria-label';
432
- if (element.hasAttribute(attribute)) {
433
- const value = element.getAttribute(attribute);
434
- element.removeAttribute(attribute);
435
- return value;
436
- }
560
+ const attribute = "aria-label";
561
+ if (!element.hasAttribute(attribute)) return "";
562
+ const value = element.getAttribute(attribute);
563
+ element.removeAttribute(attribute);
564
+ return value ?? "";
437
565
  }
438
- /**
439
- * Forwards specified attributes from a source element to a target element.
440
- *
441
- * @param sourceElement - The HTML element from which attributes will be removed from.
442
- * @param attributes - An array of attribute names to inherit from the source element.
443
- * @param renderer - An instance of Angular's Renderer2.
444
- * @param targetElement - (Optional) The HTML element to which the attributes should be applied.
445
- * If not provided, the attributes will only be removed from the source element.
446
- *
447
- * @returns A record of the inherited attributes and their values. If no attributes are inherited, an empty object is returned.
448
- */
449
566
  function forwardAttributes(sourceElement, attributes, renderer, targetElement) {
450
- const inheritedAttributes = {};
451
- if (!sourceElement || !attributes || attributes.length === 0) {
452
- return inheritedAttributes;
453
- }
454
- attributes.forEach((attribute) => {
455
- if (sourceElement.hasAttribute(attribute)) {
456
- const value = sourceElement.getAttribute(attribute);
457
- inheritedAttributes[attribute] = value;
458
- if (targetElement) {
459
- renderer.setAttribute(targetElement, attribute, value);
460
- }
461
- renderer.removeAttribute(sourceElement, attribute);
462
- }
463
- });
464
- return inheritedAttributes;
567
+ const inheritedAttributes = {};
568
+ if (!sourceElement || !attributes || attributes.length === 0) return inheritedAttributes;
569
+ attributes.forEach((attribute) => {
570
+ if (sourceElement.hasAttribute(attribute)) {
571
+ const value = sourceElement.getAttribute(attribute);
572
+ inheritedAttributes[attribute] = value;
573
+ if (targetElement) renderer.setAttribute(targetElement, attribute, value ?? "");
574
+ renderer.removeAttribute(sourceElement, attribute);
575
+ }
576
+ });
577
+ return inheritedAttributes;
465
578
  }
466
-
467
579
  const da = {
468
- $code: 'da',
469
- back: 'Tilbage',
470
- close: 'Luk',
471
- nextMonth: 'Næste måned',
472
- nextSlide: 'Næste slide',
473
- previousMonth: 'Forrige måned',
474
- previousSlide: 'Forrige slide',
475
- selectYear: 'Vælg år',
476
- readMore: 'Læs mere',
477
- more: 'Mere',
478
- characters: 'Tegn',
479
- outOf: 'af',
480
- entered: 'indtastet',
580
+ $code: "da",
581
+ back: "Tilbage",
582
+ close: "Luk",
583
+ nextMonth: "Næste måned",
584
+ nextSlide: "Næste slide",
585
+ previousMonth: "Forrige måned",
586
+ previousSlide: "Forrige slide",
587
+ selectYear: "Vælg år",
588
+ readMore: "Læs mere",
589
+ more: "Mere",
590
+ characters: "Tegn",
591
+ outOf: "af",
592
+ entered: "indtastet"
481
593
  };
482
-
483
594
  const en = {
484
- $code: 'en',
485
- back: 'Back',
486
- close: 'Close',
487
- nextMonth: 'Next month',
488
- nextSlide: 'Next slide',
489
- previousMonth: 'Previous month',
490
- previousSlide: 'Previous slide',
491
- selectYear: 'Select year',
492
- readMore: 'Read more',
493
- more: 'More',
494
- characters: 'Characters',
495
- outOf: 'out of',
496
- entered: 'entered',
595
+ $code: "en",
596
+ back: "Back",
597
+ close: "Close",
598
+ nextMonth: "Next month",
599
+ nextSlide: "Next slide",
600
+ previousMonth: "Previous month",
601
+ previousSlide: "Previous slide",
602
+ selectYear: "Select year",
603
+ readMore: "Read more",
604
+ more: "More",
605
+ characters: "Characters",
606
+ outOf: "out of",
607
+ entered: "entered"
497
608
  };
498
-
499
609
  const de = {
500
- $code: 'de',
501
- back: 'Zurück',
502
- close: 'Schließen',
503
- nextMonth: 'Nächsten Monat',
504
- nextSlide: 'Zur nächsten Folie',
505
- previousMonth: 'Letzten Monat',
506
- previousSlide: 'Zur vorherigen Folie',
507
- selectYear: 'Jahr auswählen',
508
- readMore: 'Mehr lesen',
509
- more: 'Mehr',
510
- characters: 'Zeichen',
511
- outOf: 'von',
512
- entered: 'eingegeben',
610
+ $code: "de",
611
+ back: "Zurück",
612
+ close: "Schließen",
613
+ nextMonth: "Nächsten Monat",
614
+ nextSlide: "Zur nächsten Folie",
615
+ previousMonth: "Letzten Monat",
616
+ previousSlide: "Zur vorherigen Folie",
617
+ selectYear: "Jahr auswählen",
618
+ readMore: "Mehr lesen",
619
+ more: "Mehr",
620
+ characters: "Zeichen",
621
+ outOf: "von",
622
+ entered: "eingegeben"
513
623
  };
514
-
515
- class TranslationService {
516
- constructor(localeId) {
517
- this.localeId = localeId;
518
- this.activeTranslation = en;
519
- this.translations = { da, en, de };
520
- this.setActiveTranslation(localeId);
521
- }
522
- setActiveTranslation(localeId) {
523
- const baseLocaleId = localeId.split('-')[0];
524
- const translation = this.translations[baseLocaleId];
525
- if (!translation) {
526
- console.warn(`[Kirby] Internal component translations were not found for locale "${this.localeId}", falling back to ${this.get('$code')}`);
527
- return;
528
- }
529
- this.activeTranslation = translation;
530
- }
531
- get(key) {
532
- return this.activeTranslation[key];
533
- }
534
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TranslationService, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
535
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TranslationService, providedIn: 'root' }); }
536
- }
537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TranslationService, decorators: [{
538
- type: Injectable,
539
- args: [{
540
- providedIn: 'root',
541
- }]
542
- }], ctorParameters: () => [{ type: undefined, decorators: [{
543
- type: Inject,
544
- args: [LOCALE_ID]
545
- }] }] });
546
-
547
- /**
548
- * Generated bundle index. Do not edit.
549
- */
550
-
624
+ var TranslationService = class TranslationService {
625
+ constructor(localeId) {
626
+ this.localeId = localeId;
627
+ this.activeTranslation = en;
628
+ this.translations = {
629
+ da,
630
+ en,
631
+ de
632
+ };
633
+ this.setActiveTranslation(localeId);
634
+ }
635
+ setActiveTranslation(localeId) {
636
+ const baseLocaleId = localeId.split("-")[0];
637
+ const translation = this.translations[baseLocaleId];
638
+ if (!translation) {
639
+ console.warn(`[Kirby] Internal component translations were not found for locale "${this.localeId}", falling back to ${this.get("$code")}`);
640
+ return;
641
+ }
642
+ this.activeTranslation = translation;
643
+ }
644
+ get(key) {
645
+ return this.activeTranslation[key];
646
+ }
647
+ static {
648
+ this.ɵfac = i0.ɵɵngDeclareFactory({
649
+ minVersion: "12.0.0",
650
+ version: "22.2.3",
651
+ ngImport: i0,
652
+ type: TranslationService,
653
+ deps: [{ token: LOCALE_ID }],
654
+ target: i0.ɵɵFactoryTarget.Injectable
655
+ });
656
+ }
657
+ static {
658
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
659
+ minVersion: "12.0.0",
660
+ version: "22.2.3",
661
+ ngImport: i0,
662
+ type: TranslationService,
663
+ providedIn: "root"
664
+ });
665
+ }
666
+ };
667
+ i0.ɵɵngDeclareClassMetadata({
668
+ minVersion: "12.0.0",
669
+ version: "22.2.3",
670
+ ngImport: i0,
671
+ type: TranslationService,
672
+ decorators: [{
673
+ type: Injectable,
674
+ args: [{ providedIn: "root" }]
675
+ }],
676
+ ctorParameters: () => [{
677
+ type: void 0,
678
+ decorators: [{
679
+ type: Inject,
680
+ args: [LOCALE_ID]
681
+ }]
682
+ }]
683
+ });
551
684
  export { ComponentLoaderDirective, FitHeadingDirective, ResizeObserverFactory, ResizeObserverService, TextResizeObserverService, ThemeColorDirective, TranslationService, findItemLabel, forwardAttributes, inheritAriaLabelText, setAccessibleLabel };
552
- //# sourceMappingURL=kirbydesign-designsystem-shared.mjs.map
685
+
686
+ //# sourceMappingURL=kirbydesign-designsystem-shared.mjs.map