@konce-pt/react 0.11.2 → 0.14.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 (382) hide show
  1. package/README.md +128 -64
  2. package/dist/accordion/accordion.d.ts +14 -6
  3. package/dist/accordion/accordion.js +25 -17
  4. package/dist/accordion/llms.txt +22 -10
  5. package/dist/alert/alert.d.ts +2 -2
  6. package/dist/alert/alert.js +3 -2
  7. package/dist/alert/llms.txt +10 -9
  8. package/dist/app-shell/app-shell.d.ts +14 -14
  9. package/dist/app-shell/app-shell.js +22 -15
  10. package/dist/app-shell/llms.txt +16 -15
  11. package/dist/auth/auth-types.d.ts +6 -6
  12. package/dist/auth/auth.d.ts +2 -2
  13. package/dist/auth/auth.js +24 -15
  14. package/dist/auth/llms.txt +12 -11
  15. package/dist/autocomplete/autocomplete.d.ts +19 -6
  16. package/dist/autocomplete/autocomplete.js +32 -11
  17. package/dist/autocomplete/llms.txt +19 -5
  18. package/dist/avatar/avatar.d.ts +6 -6
  19. package/dist/avatar/avatar.js +6 -5
  20. package/dist/avatar/llms.txt +10 -10
  21. package/dist/avatar-group/avatar-group.d.ts +4 -4
  22. package/dist/avatar-group/avatar-group.js +4 -3
  23. package/dist/avatar-group/llms.txt +8 -8
  24. package/dist/backdrop/backdrop.d.ts +7 -26
  25. package/dist/backdrop/backdrop.js +32 -27
  26. package/dist/backdrop/llms.txt +27 -27
  27. package/dist/badge/badge.d.ts +3 -3
  28. package/dist/badge/badge.js +1 -1
  29. package/dist/badge/llms.txt +11 -11
  30. package/dist/bottom-sheet/bottom-sheet.d.ts +8 -3
  31. package/dist/bottom-sheet/bottom-sheet.js +5 -4
  32. package/dist/bottom-sheet/llms.txt +11 -8
  33. package/dist/breadcrumb/breadcrumb.d.ts +8 -2
  34. package/dist/breadcrumb/breadcrumb.js +11 -3
  35. package/dist/breadcrumb/llms.txt +10 -2
  36. package/dist/button/button.d.ts +3 -3
  37. package/dist/button/button.js +10 -9
  38. package/dist/button/llms.txt +27 -19
  39. package/dist/button-group/button-group.d.ts +18 -5
  40. package/dist/button-group/button-group.js +54 -6
  41. package/dist/button-group/llms.txt +27 -18
  42. package/dist/card/card.d.ts +8 -8
  43. package/dist/card/card.js +10 -9
  44. package/dist/card/llms.txt +20 -20
  45. package/dist/carousel/carousel.d.ts +6 -6
  46. package/dist/carousel/carousel.js +8 -5
  47. package/dist/carousel/llms.txt +10 -10
  48. package/dist/charts/chart-legend.d.ts +3 -3
  49. package/dist/charts/chart-legend.js +2 -1
  50. package/dist/charts/chart-tooltip.d.ts +3 -3
  51. package/dist/charts/chart-tooltip.js +1 -1
  52. package/dist/charts/chart.d.ts +4 -3
  53. package/dist/charts/chart.js +18 -10
  54. package/dist/charts/llms.txt +10 -7
  55. package/dist/charts-entry/public-api.js +2 -2
  56. package/dist/chat/chat.d.ts +17 -10
  57. package/dist/chat/chat.js +77 -23
  58. package/dist/chat/llms.txt +39 -15
  59. package/dist/chat-composer/chat-composer.d.ts +20 -7
  60. package/dist/chat-composer/chat-composer.js +29 -7
  61. package/dist/chat-composer/llms.txt +20 -11
  62. package/dist/chat-dock/chat-dock.d.ts +11 -4
  63. package/dist/chat-dock/chat-dock.js +10 -6
  64. package/dist/chat-dock/llms.txt +15 -14
  65. package/dist/chat-entry/public-api.js +1 -1
  66. package/dist/chat-message/chat-message.d.ts +12 -5
  67. package/dist/chat-message/chat-message.js +19 -8
  68. package/dist/chat-message/llms.txt +16 -15
  69. package/dist/chat-typing/chat-typing.d.ts +2 -2
  70. package/dist/chat-typing/chat-typing.js +4 -3
  71. package/dist/chat-typing/llms.txt +6 -6
  72. package/dist/checkbox/checkbox.d.ts +13 -6
  73. package/dist/checkbox/checkbox.js +31 -5
  74. package/dist/checkbox/llms.txt +26 -11
  75. package/dist/chip/chip.d.ts +4 -4
  76. package/dist/chip/chip.js +3 -2
  77. package/dist/chip/llms.txt +11 -11
  78. package/dist/chips-input/chips-input.d.ts +6 -4
  79. package/dist/chips-input/chips-input.js +47 -12
  80. package/dist/chips-input/llms.txt +18 -8
  81. package/dist/clock/clock.d.ts +11 -6
  82. package/dist/clock/clock.js +38 -8
  83. package/dist/clock/llms.txt +12 -8
  84. package/dist/color-picker/color-picker.d.ts +9 -5
  85. package/dist/color-picker/color-picker.js +37 -18
  86. package/dist/color-picker/llms.txt +8 -5
  87. package/dist/confirm/confirm-container.d.ts +3 -3
  88. package/dist/confirm/confirm-container.js +6 -5
  89. package/dist/confirm/confirm-store.d.ts +4 -4
  90. package/dist/confirm/confirm-store.js +11 -5
  91. package/dist/confirm/llms.txt +8 -7
  92. package/dist/context-menu/context-menu.d.ts +1 -1
  93. package/dist/context-menu/context-menu.js +37 -14
  94. package/dist/context-menu/llms.txt +10 -7
  95. package/dist/data-table/data-table-types.d.ts +5 -5
  96. package/dist/data-table/data-table.d.ts +37 -5
  97. package/dist/data-table/data-table.js +426 -119
  98. package/dist/data-table/export-csv.d.ts +3 -3
  99. package/dist/data-table/export-csv.js +8 -10
  100. package/dist/data-table/llms.txt +127 -79
  101. package/dist/data-view/data-view.d.ts +13 -5
  102. package/dist/data-view/data-view.js +68 -6
  103. package/dist/data-view/llms.txt +29 -10
  104. package/dist/date-range/date-range.d.ts +20 -8
  105. package/dist/date-range/date-range.js +86 -63
  106. package/dist/date-range/llms.txt +32 -18
  107. package/dist/datepicker/datepicker.d.ts +22 -8
  108. package/dist/datepicker/datepicker.js +103 -71
  109. package/dist/datepicker/llms.txt +36 -22
  110. package/dist/dialog/dialog.d.ts +4 -4
  111. package/dist/dialog/dialog.js +32 -11
  112. package/dist/dialog/llms.txt +13 -10
  113. package/dist/divider/divider.d.ts +7 -1
  114. package/dist/divider/divider.js +3 -2
  115. package/dist/divider/llms.txt +4 -3
  116. package/dist/drawer/drawer.d.ts +9 -4
  117. package/dist/drawer/drawer.js +5 -4
  118. package/dist/drawer/llms.txt +13 -10
  119. package/dist/empty/empty.d.ts +2 -2
  120. package/dist/empty/empty.js +1 -1
  121. package/dist/empty/llms.txt +9 -9
  122. package/dist/fab/fab.d.ts +1 -1
  123. package/dist/fab/fab.js +1 -1
  124. package/dist/fab/llms.txt +10 -6
  125. package/dist/fieldset/fieldset.d.ts +18 -4
  126. package/dist/fieldset/fieldset.js +12 -6
  127. package/dist/fieldset/llms.txt +26 -9
  128. package/dist/file-upload/file-upload.d.ts +8 -2
  129. package/dist/file-upload/file-upload.js +22 -11
  130. package/dist/file-upload/llms.txt +12 -9
  131. package/dist/form-field/form-field-context.d.ts +4 -4
  132. package/dist/form-field/form-field.d.ts +12 -4
  133. package/dist/form-field/form-field.js +27 -6
  134. package/dist/form-field/llms.txt +25 -11
  135. package/dist/galleria/galleria.d.ts +3 -3
  136. package/dist/galleria/galleria.js +9 -6
  137. package/dist/galleria/llms.txt +7 -7
  138. package/dist/grid/col.d.ts +4 -4
  139. package/dist/grid/col.js +2 -2
  140. package/dist/grid/flex.d.ts +3 -3
  141. package/dist/grid/flex.js +1 -1
  142. package/dist/grid/grid.d.ts +7 -7
  143. package/dist/grid/grid.js +3 -3
  144. package/dist/grid/layout.d.ts +2 -2
  145. package/dist/grid/layout.js +2 -2
  146. package/dist/grid/llms.txt +15 -15
  147. package/dist/grid-entry/public-api.js +1 -1
  148. package/dist/i18n/i18n-context.d.ts +6 -6
  149. package/dist/i18n/i18n-context.js +27 -5
  150. package/dist/icon/icon-registry.d.ts +3 -3
  151. package/dist/icon/icon-registry.js +3 -3
  152. package/dist/icon/icon.d.ts +4 -4
  153. package/dist/icon/icon.js +10 -7
  154. package/dist/icon/llms.txt +13 -13
  155. package/dist/icon-button/icon-button.d.ts +2 -2
  156. package/dist/icon-button/icon-button.js +1 -1
  157. package/dist/icon-button/llms.txt +9 -5
  158. package/dist/icons-entry/public-api.d.ts +2 -2
  159. package/dist/icons-entry/public-api.js +3 -3
  160. package/dist/image/image.js +5 -5
  161. package/dist/image/llms.txt +13 -13
  162. package/dist/input/input.d.ts +18 -5
  163. package/dist/input/input.js +22 -6
  164. package/dist/input/llms.txt +25 -11
  165. package/dist/input-mask/input-mask.d.ts +7 -2
  166. package/dist/input-mask/input-mask.js +17 -43
  167. package/dist/input-mask/llms.txt +8 -5
  168. package/dist/input-number/input-number.d.ts +11 -9
  169. package/dist/input-number/input-number.js +25 -21
  170. package/dist/input-number/llms.txt +17 -14
  171. package/dist/input-otp/input-otp.d.ts +18 -5
  172. package/dist/input-otp/input-otp.js +48 -24
  173. package/dist/input-otp/llms.txt +18 -7
  174. package/dist/internal/calendar-focus.d.ts +1 -1
  175. package/dist/internal/calendar-focus.js +3 -3
  176. package/dist/internal/cn.d.ts +1 -1
  177. package/dist/internal/mask.d.ts +14 -0
  178. package/dist/internal/mask.js +62 -0
  179. package/dist/internal/number-group.d.ts +22 -0
  180. package/dist/internal/number-group.js +53 -0
  181. package/dist/internal/option-key.d.ts +6 -0
  182. package/dist/internal/option-key.js +8 -0
  183. package/dist/internal/option-nav.d.ts +4 -4
  184. package/dist/internal/option-nav.js +5 -5
  185. package/dist/internal/overlay-container.js +1 -1
  186. package/dist/internal/overlay.d.ts +3 -3
  187. package/dist/internal/overlay.js +40 -10
  188. package/dist/internal/password-strength.d.ts +6 -0
  189. package/dist/internal/password-strength.js +74 -0
  190. package/dist/internal/roving.d.ts +2 -2
  191. package/dist/internal/roving.js +3 -3
  192. package/dist/internal/scroll-lock.d.ts +6 -0
  193. package/dist/internal/scroll-lock.js +35 -0
  194. package/dist/internal/slot-children.d.ts +13 -0
  195. package/dist/internal/slot-children.js +31 -0
  196. package/dist/internal/slot.d.ts +3 -3
  197. package/dist/internal/slot.js +2 -2
  198. package/dist/internal/step.d.ts +12 -0
  199. package/dist/internal/step.js +31 -0
  200. package/dist/internal/tween.d.ts +5 -5
  201. package/dist/internal/tween.js +7 -8
  202. package/dist/internal/types.d.ts +2 -2
  203. package/dist/internal/use-breakpoint.d.ts +2 -2
  204. package/dist/internal/use-breakpoint.js +4 -4
  205. package/dist/internal/use-controllable-state.d.ts +5 -0
  206. package/dist/internal/use-controllable-state.js +25 -4
  207. package/dist/internal/use-id.d.ts +2 -2
  208. package/dist/internal/use-id.js +2 -2
  209. package/dist/internal/use-modal-focus.d.ts +2 -1
  210. package/dist/internal/use-modal-focus.js +14 -3
  211. package/dist/knob/knob.d.ts +7 -4
  212. package/dist/knob/knob.js +27 -22
  213. package/dist/knob/llms.txt +18 -11
  214. package/dist/listbox/listbox.d.ts +8 -6
  215. package/dist/listbox/listbox.js +37 -17
  216. package/dist/listbox/llms.txt +12 -9
  217. package/dist/loader/llms.txt +56 -0
  218. package/dist/loader/loader.d.ts +49 -0
  219. package/dist/loader/loader.js +68 -0
  220. package/dist/map/llms.txt +30 -23
  221. package/dist/map/map-create-dialog.d.ts +4 -4
  222. package/dist/map/map-create-dialog.js +36 -28
  223. package/dist/map/map-hours-field.d.ts +4 -4
  224. package/dist/map/map-hours-field.js +8 -7
  225. package/dist/map/map-image-field.d.ts +2 -2
  226. package/dist/map/map-image-field.js +6 -5
  227. package/dist/map/map-legend.d.ts +4 -4
  228. package/dist/map/map-legend.js +3 -2
  229. package/dist/map/map-poi-card.d.ts +3 -3
  230. package/dist/map/map-poi-card.js +10 -9
  231. package/dist/map/map-search.d.ts +17 -6
  232. package/dist/map/map-search.js +70 -43
  233. package/dist/map/map.d.ts +25 -13
  234. package/dist/map/map.js +86 -57
  235. package/dist/map/ports.d.ts +9 -9
  236. package/dist/map/ports.js +6 -6
  237. package/dist/map-entry/public-api.js +2 -2
  238. package/dist/megamenu/llms.txt +18 -7
  239. package/dist/megamenu/megamenu.d.ts +12 -6
  240. package/dist/megamenu/megamenu.js +23 -14
  241. package/dist/mention/llms.txt +15 -15
  242. package/dist/mention/mention.d.ts +5 -5
  243. package/dist/mention/mention.js +2 -2
  244. package/dist/mention/mentions.d.ts +1 -1
  245. package/dist/mention/mentions.js +1 -1
  246. package/dist/menu/llms.txt +12 -12
  247. package/dist/menu/menu-item.d.ts +4 -4
  248. package/dist/menu/menu-keys.d.ts +2 -2
  249. package/dist/menu/menu-keys.js +5 -5
  250. package/dist/menu/menu-rows.js +1 -0
  251. package/dist/menu/menu.d.ts +2 -2
  252. package/dist/menu/menu.js +15 -8
  253. package/dist/menubar/llms.txt +19 -8
  254. package/dist/menubar/menubar.d.ts +11 -5
  255. package/dist/menubar/menubar.js +23 -11
  256. package/dist/meter-group/llms.txt +12 -12
  257. package/dist/meter-group/meter-group.d.ts +2 -2
  258. package/dist/meter-group/meter-group.js +2 -1
  259. package/dist/motion/motion-context.d.ts +22 -0
  260. package/dist/motion/motion-context.js +28 -0
  261. package/dist/order-list/llms.txt +24 -9
  262. package/dist/order-list/order-list.d.ts +12 -4
  263. package/dist/order-list/order-list.js +123 -25
  264. package/dist/paginator/llms.txt +8 -8
  265. package/dist/paginator/paginator.js +7 -4
  266. package/dist/panel/llms.txt +25 -13
  267. package/dist/panel/panel.d.ts +11 -3
  268. package/dist/panel/panel.js +12 -7
  269. package/dist/password/llms.txt +19 -7
  270. package/dist/password/password.d.ts +2 -2
  271. package/dist/password/password.js +27 -16
  272. package/dist/peek/llms.txt +11 -11
  273. package/dist/peek/peek.d.ts +6 -6
  274. package/dist/peek/peek.js +41 -19
  275. package/dist/pick-list/llms.txt +35 -12
  276. package/dist/pick-list/pick-list.d.ts +12 -4
  277. package/dist/pick-list/pick-list.js +128 -24
  278. package/dist/popover/llms.txt +13 -10
  279. package/dist/popover/popover.d.ts +6 -4
  280. package/dist/popover/popover.js +14 -7
  281. package/dist/progress/llms.txt +17 -17
  282. package/dist/progress/progress.d.ts +7 -7
  283. package/dist/progress/progress.js +7 -6
  284. package/dist/public-api.d.ts +16 -4
  285. package/dist/public-api.js +13 -7
  286. package/dist/radio-group/llms.txt +16 -6
  287. package/dist/radio-group/radio-group.d.ts +12 -3
  288. package/dist/radio-group/radio-group.js +23 -4
  289. package/dist/rating/llms.txt +20 -13
  290. package/dist/rating/rating-pointer.d.ts +16 -0
  291. package/dist/rating/rating-pointer.js +26 -0
  292. package/dist/rating/rating.d.ts +6 -6
  293. package/dist/rating/rating.js +77 -12
  294. package/dist/rich-text/lists.d.ts +2 -2
  295. package/dist/rich-text/lists.js +7 -7
  296. package/dist/rich-text/llms.txt +35 -12
  297. package/dist/rich-text/rich-text.d.ts +13 -14
  298. package/dist/rich-text/rich-text.js +311 -142
  299. package/dist/rich-text/sanitize.d.ts +11 -2
  300. package/dist/rich-text/sanitize.js +80 -32
  301. package/dist/rich-text/tables.d.ts +3 -3
  302. package/dist/rich-text/tables.js +3 -3
  303. package/dist/roadmap/llms.txt +23 -17
  304. package/dist/roadmap/roadmap.d.ts +6 -6
  305. package/dist/roadmap/roadmap.js +102 -25
  306. package/dist/roadmap-entry/public-api.js +2 -2
  307. package/dist/scroll-top/llms.txt +6 -6
  308. package/dist/scroll-top/scroll-top.d.ts +1 -1
  309. package/dist/scroll-top/scroll-top.js +2 -1
  310. package/dist/select/llms.txt +22 -12
  311. package/dist/select/select.d.ts +10 -8
  312. package/dist/select/select.js +87 -47
  313. package/dist/shared/types.d.ts +22 -1
  314. package/dist/shared/types.js +9 -1
  315. package/dist/sidenav/llms.txt +9 -9
  316. package/dist/sidenav/sidenav.d.ts +2 -3
  317. package/dist/sidenav/sidenav.js +5 -4
  318. package/dist/skeleton/llms.txt +3 -3
  319. package/dist/skeleton/skeleton.d.ts +1 -1
  320. package/dist/skeleton/skeleton.js +1 -1
  321. package/dist/slider/llms.txt +34 -12
  322. package/dist/slider/slider-drag.d.ts +26 -0
  323. package/dist/slider/slider-drag.js +79 -0
  324. package/dist/slider/slider.d.ts +8 -5
  325. package/dist/slider/slider.js +38 -8
  326. package/dist/speech/llms.txt +97 -0
  327. package/dist/speech/speech-button.d.ts +44 -0
  328. package/dist/speech/speech-button.js +86 -0
  329. package/dist/speech/speech-wave.d.ts +19 -0
  330. package/dist/speech/speech-wave.js +16 -0
  331. package/dist/speech/use-speech-recognition.d.ts +81 -0
  332. package/dist/speech/use-speech-recognition.js +179 -0
  333. package/dist/speed-dial/llms.txt +14 -8
  334. package/dist/speed-dial/speed-dial.d.ts +1 -1
  335. package/dist/speed-dial/speed-dial.js +3 -2
  336. package/dist/spinner/llms.txt +7 -7
  337. package/dist/spinner/spinner.d.ts +1 -1
  338. package/dist/spinner/spinner.js +2 -1
  339. package/dist/split-button/llms.txt +21 -15
  340. package/dist/split-button/split-button.d.ts +2 -2
  341. package/dist/split-button/split-button.js +13 -6
  342. package/dist/splitter/llms.txt +11 -11
  343. package/dist/splitter/splitter.d.ts +3 -3
  344. package/dist/splitter/splitter.js +25 -10
  345. package/dist/stepper/llms.txt +35 -13
  346. package/dist/stepper/stepper.d.ts +6 -6
  347. package/dist/stepper/stepper.js +60 -13
  348. package/dist/switch/llms.txt +15 -5
  349. package/dist/switch/switch.d.ts +10 -3
  350. package/dist/switch/switch.js +18 -4
  351. package/dist/switch-group/llms.txt +11 -8
  352. package/dist/switch-group/switch-group.d.ts +6 -4
  353. package/dist/switch-group/switch-group.js +9 -7
  354. package/dist/tabs/llms.txt +12 -9
  355. package/dist/tabs/tabs.d.ts +5 -5
  356. package/dist/tabs/tabs.js +36 -20
  357. package/dist/textarea/llms.txt +23 -12
  358. package/dist/textarea/textarea.d.ts +19 -6
  359. package/dist/textarea/textarea.js +22 -7
  360. package/dist/timeline/llms.txt +4 -4
  361. package/dist/timeline/timeline.d.ts +1 -1
  362. package/dist/timeline/timeline.js +1 -1
  363. package/dist/toast/llms.txt +50 -17
  364. package/dist/toast/toast-container.d.ts +9 -3
  365. package/dist/toast/toast-container.js +18 -9
  366. package/dist/toast/toast-store.d.ts +42 -2
  367. package/dist/toast/toast-store.js +36 -1
  368. package/dist/toolbar/llms.txt +7 -7
  369. package/dist/toolbar/toolbar.d.ts +3 -3
  370. package/dist/toolbar/toolbar.js +2 -2
  371. package/dist/tooltip/llms.txt +14 -12
  372. package/dist/tooltip/tooltip.d.ts +5 -4
  373. package/dist/tooltip/tooltip.js +100 -41
  374. package/dist/tree/llms.txt +25 -11
  375. package/dist/tree/tree-keys.d.ts +5 -5
  376. package/dist/tree/tree-keys.js +7 -7
  377. package/dist/tree/tree.d.ts +17 -5
  378. package/dist/tree/tree.js +62 -20
  379. package/dist/update/llms.txt +54 -0
  380. package/dist/update/update.d.ts +49 -0
  381. package/dist/update/update.js +82 -0
  382. package/package.json +18 -15
@@ -1,17 +1,23 @@
1
1
  import { type ComponentPropsWithRef } from 'react';
2
2
  import { type KptI18nOverrides } from '../i18n/i18n-context.tsx';
3
+ import { type KptToastPosition } from './toast-store.ts';
3
4
  export interface KptToastContainerProps extends ComponentPropsWithRef<'div'>, KptI18nOverrides {
5
+ /** Położenie toastów, które nie podały własnego `position`. Domyślnie `bottom-end`. */
6
+ position?: KptToastPosition;
4
7
  }
5
8
  /**
6
9
  * Kontener renderujący toasty z `kptToast`. Umieść raz w aplikacji, np. w komponencie głównym.
7
10
  *
8
- * Ogłaszanie idzie przez dwa stałe, niewidoczne regiony na żywo — uprzejmy dla zwykłych toastów
9
- * i natychmiastowy dla błędów — a nie przez same toasty: region musi istnieć, zanim pojawi się
11
+ * Ogłaszanie idzie przez dwa stałe, niewidoczne regiony na żywo - uprzejmy dla zwykłych toastów
12
+ * i natychmiastowy dla błędów - a nie przez same toasty: region musi istnieć, zanim pojawi się
10
13
  * w nim treść, a zagnieżdżone regiony część czytników ogłasza dwa razy. Gdy wskaźnik albo fokus
11
14
  * jest na toastach, liczniki stoją, więc komunikat nie znika w trakcie czytania.
12
15
  *
16
+ * Toasty rosną w rogu z `position` kontenera albo z własnego `position` - każdy róg to osobny stos,
17
+ * przy górnej krawędzi najnowszy jest na górze, przy dolnej na dole.
18
+ *
13
19
  * @example
14
20
  * <KptToastContainer />
15
21
  * // gdziekolwiek: kptToast.success('Zapisano');
16
22
  */
17
- export declare function KptToastContainer({ locale, dictionary, className, ...rest }: Readonly<KptToastContainerProps>): import("react").JSX.Element;
23
+ export declare function KptToastContainer({ position, locale, dictionary, className, ...rest }: Readonly<KptToastContainerProps>): import("react").JSX.Element;
@@ -1,9 +1,12 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from 'react';
3
4
  import { cn } from "../internal/cn.js";
4
5
  import { useKptMessages } from "../i18n/i18n-context.js";
5
6
  import { KptIcon } from "../icon/icon.js";
6
- import { kptToast, useKptToasts } from "./toast-store.js";
7
+ import { kptToast, useKptToasts, useKptToastsPaused } from "./toast-store.js";
8
+ /** Kolejność grup w DOM - stała, żeby dodanie toastu w innym rogu nie przestawiało pozostałych. */
9
+ const POSITIONS = ['top-start', 'top-center', 'top-end', 'bottom-start', 'bottom-center', 'bottom-end'];
7
10
  const ICONS = {
8
11
  info: 'info',
9
12
  success: 'circle-check',
@@ -13,21 +16,27 @@ const ICONS = {
13
16
  /**
14
17
  * Kontener renderujący toasty z `kptToast`. Umieść raz w aplikacji, np. w komponencie głównym.
15
18
  *
16
- * Ogłaszanie idzie przez dwa stałe, niewidoczne regiony na żywo — uprzejmy dla zwykłych toastów
17
- * i natychmiastowy dla błędów — a nie przez same toasty: region musi istnieć, zanim pojawi się
19
+ * Ogłaszanie idzie przez dwa stałe, niewidoczne regiony na żywo - uprzejmy dla zwykłych toastów
20
+ * i natychmiastowy dla błędów - a nie przez same toasty: region musi istnieć, zanim pojawi się
18
21
  * w nim treść, a zagnieżdżone regiony część czytników ogłasza dwa razy. Gdy wskaźnik albo fokus
19
22
  * jest na toastach, liczniki stoją, więc komunikat nie znika w trakcie czytania.
20
23
  *
24
+ * Toasty rosną w rogu z `position` kontenera albo z własnego `position` - każdy róg to osobny stos,
25
+ * przy górnej krawędzi najnowszy jest na górze, przy dolnej na dole.
26
+ *
21
27
  * @example
22
28
  * <KptToastContainer />
23
29
  * // gdziekolwiek: kptToast.success('Zapisano');
24
30
  */
25
- export function KptToastContainer({ locale, dictionary, className, ...rest }) {
31
+ export function KptToastContainer({ position = 'bottom-end', locale, dictionary, className, ...rest }) {
26
32
  const { t } = useKptMessages({ locale, dictionary });
27
33
  const toasts = useKptToasts();
34
+ const paused = useKptToastsPaused();
35
+ // Toasty pogrupowane po rogu; tylko niepuste grupy, każda w osobnym przypiętym stosie.
36
+ const groups = POSITIONS.map((at) => ({ position: at, toasts: toasts.filter((toast) => (toast.position ?? position) === at) })).filter((group) => group.toasts.length);
28
37
  const [politeText, setPoliteText] = useState('');
29
38
  const [alertText, setAlertText] = useState('');
30
- // Ostatni ogłoszony toast — zamknięcie nowszego nie może ponownie ogłosić starszego.
39
+ // Ostatni ogłoszony toast - zamknięcie nowszego nie może ponownie ogłosić starszego.
31
40
  const lastAnnounced = useRef(0);
32
41
  const holds = useRef(new Set());
33
42
  const hold = (reason, on) => {
@@ -41,7 +50,7 @@ export function KptToastContainer({ locale, dictionary, className, ...rest }) {
41
50
  kptToast.resume();
42
51
  };
43
52
  useEffect(() => {
44
- // Pusty kontener nie dostanie już `mouseleave`, więc zdejmujemy wstrzymanie sami —
53
+ // Pusty kontener nie dostanie już `mouseleave`, więc zdejmujemy wstrzymanie sami -
45
54
  // inaczej kolejne toasty czekałyby w nieskończoność.
46
55
  if (!toasts.length && holds.current.size) {
47
56
  holds.current.clear();
@@ -55,7 +64,7 @@ export function KptToastContainer({ locale, dictionary, className, ...rest }) {
55
64
  for (const toast of fresh) {
56
65
  const text = toast.title ? `${toast.title}. ${toast.message}` : toast.message;
57
66
  const set = toast.variant === 'danger' ? setAlertText : setPoliteText;
58
- // Czyścimy region przed wpisaniem — ten sam tekst drugi raz inaczej nie zostałby ogłoszony.
67
+ // Czyścimy region przed wpisaniem - ten sam tekst drugi raz inaczej nie zostałby ogłoszony.
59
68
  set('');
60
69
  frames.push(requestAnimationFrame(() => set(text)));
61
70
  }
@@ -67,8 +76,8 @@ export function KptToastContainer({ locale, dictionary, className, ...rest }) {
67
76
  return;
68
77
  hold('focus', false);
69
78
  };
70
- return (_jsxs("div", { className: cn('kpt-toast-container-host', className), ...rest, children: [_jsx("div", { className: "kpt-toast-container", role: toasts.length ? 'region' : undefined, "aria-label": toasts.length ? t('toast.region') : undefined, onMouseEnter: () => hold('pointer', true), onMouseLeave: () => hold('pointer', false), onFocus: () => hold('focus', true), onBlur: onBlur, children: toasts.map((toast) => (_jsxs("div", { className: "kpt-toast", "data-variant": toast.variant, children: [_jsx(KptIcon, { className: "kpt-toast__icon", name: ICONS[toast.variant] }), _jsxs("div", { className: "kpt-toast__content", children: [toast.title ? _jsx("div", { className: "kpt-toast__title", children: toast.title }) : null, _jsx("div", { className: "kpt-toast__message", children: toast.message })] }), toast.action ? (_jsx("button", { className: "kpt-toast__action", type: "button", onClick: () => {
79
+ return (_jsxs("div", { className: cn('kpt-toast-container-host', className), ...rest, children: [groups.map((group) => (_jsx("div", { className: "kpt-toast-container", role: "region", "data-position": group.position, "data-paused": paused ? '' : undefined, "aria-label": t('toast.region'), onMouseEnter: () => hold('pointer', true), onMouseLeave: () => hold('pointer', false), onFocus: () => hold('focus', true), onBlur: onBlur, children: group.toasts.map((toast) => (_jsxs("div", { className: "kpt-toast", "data-variant": toast.variant, "data-appearance": toast.appearance, children: [_jsx(KptIcon, { className: "kpt-toast__icon", name: ICONS[toast.variant] }), _jsxs("div", { className: "kpt-toast__content", children: [toast.title ? _jsx("div", { className: "kpt-toast__title", children: toast.title }) : null, _jsx("div", { className: "kpt-toast__message", children: toast.message })] }), toast.action ? (_jsx("button", { className: "kpt-toast__action", type: "button", onClick: () => {
71
80
  toast.action?.run();
72
81
  kptToast.dismiss(toast.id);
73
- }, children: toast.action.label })) : null, _jsx("button", { className: "kpt-toast__close", type: "button", onClick: () => kptToast.dismiss(toast.id), "aria-label": t('common.close'), children: _jsx(KptIcon, { name: "x" }) })] }, toast.id))) }), _jsx("span", { className: "kpt-toast-container__live", "aria-live": "polite", "aria-atomic": "true", children: politeText }), _jsx("span", { className: "kpt-toast-container__live", "aria-live": "assertive", "aria-atomic": "true", children: alertText })] }));
82
+ }, children: toast.action.label })) : null, toast.closable ? (_jsx("button", { className: "kpt-toast__close", type: "button", onClick: () => kptToast.dismiss(toast.id), "aria-label": t('common.close'), children: _jsx(KptIcon, { name: "x" }) })) : null, toast.progress && toast.duration > 0 ? (_jsx("span", { className: "kpt-toast__timer", "aria-hidden": "true", style: { '--_duration': `${toast.duration}ms` } })) : null] }, toast.id))) }, group.position))), _jsx("span", { className: "kpt-toast-container__live", "aria-live": "polite", "aria-atomic": "true", children: politeText }), _jsx("span", { className: "kpt-toast-container__live", "aria-live": "assertive", "aria-atomic": "true", children: alertText })] }));
74
83
  }
@@ -1,19 +1,54 @@
1
1
  import type { KptAlertVariant } from '../shared/types.ts';
2
- /** Przycisk akcji w toaście, np. „Cofnij”. Kliknięcie uruchamia `run` i zamyka toast. */
2
+ /** Przycisk akcji w toaście, np. "Cofnij". Kliknięcie uruchamia `run` i zamyka toast. */
3
3
  export interface KptToastAction {
4
4
  label: string;
5
5
  run: () => void;
6
6
  }
7
+ /**
8
+ * Róg albo środek krawędzi okna, przy którym rosną toasty. `start`/`end` są logiczne - w układzie
9
+ * od prawej do lewej zamieniają się stronami same.
10
+ */
11
+ export type KptToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
12
+ /** `outline` - jasna powierzchnia z akcentem na krawędzi; `filled` - całe tło w barwie wariantu. */
13
+ export type KptToastAppearance = 'outline' | 'filled';
7
14
  export interface KptToast {
8
15
  id: number;
9
16
  message: string;
10
17
  title?: string;
11
18
  variant: KptAlertVariant;
12
- /** Czas życia w ms; 0 = bez auto-zamykania. */
19
+ /**
20
+ * Czas życia w ms; 0 = bez auto-zamykania. Domyślnie 4000 ms, a dla toastu z `action` - 0:
21
+ * użytkownik klawiatury albo czytnika nie zdąży dojść do przycisku "Cofnij" w kontenerze na końcu
22
+ * strony, zanim toast zniknie (WCAG 2.2.1). Jawne `duration` zawsze wygrywa - poza jednym
23
+ * przypadkiem: toast bez X, bez akcji i bez czasu nie dałby się zamknąć, więc dostaje 5000 ms.
24
+ */
13
25
  duration: number;
14
26
  action?: KptToastAction;
27
+ /** Położenie tego toastu; bez wartości - `position` kontenera. */
28
+ position?: KptToastPosition;
29
+ appearance: KptToastAppearance;
30
+ /** `false` chowa przycisk X. */
31
+ closable: boolean;
32
+ /** Pasek czasu na dole toastu - kurczy się do zamknięcia i staje razem z licznikiem. */
33
+ progress: boolean;
15
34
  }
16
35
  export type KptToastOptions = Partial<Omit<KptToast, 'id' | 'message'>>;
36
+ /** Wartości domyślne toastów całej aplikacji - `kptToast.configure(...)`. Opcje toastu wygrywają. */
37
+ export interface KptToastConfig {
38
+ /** Czas życia toastu bez akcji (ms). Domyślnie 4000. */
39
+ duration?: number;
40
+ appearance?: KptToastAppearance;
41
+ closable?: boolean;
42
+ progress?: boolean;
43
+ }
44
+ /** Czas toastu, którego inaczej nie dałoby się zamknąć (bez X, bez akcji, bez czasu). */
45
+ export declare const KPT_TOAST_FALLBACK_DURATION = 5000;
46
+ /**
47
+ * Pełny toast z opcji i konfiguracji. Kolejność: opcja toastu > `kptToast.configure` > wartość
48
+ * biblioteki. Na końcu bezpiecznik: toast, którego nie da się zamknąć ani przyciskiem, ani akcją,
49
+ * dostaje czas, bo inaczej zostałby na ekranie na zawsze.
50
+ */
51
+ export declare function resolveKptToast(id: number, message: string, options: KptToastOptions, config: KptToastConfig | null): KptToast;
17
52
  declare function show(message: string, options?: KptToastOptions): number;
18
53
  declare function dismiss(id: number): void;
19
54
  declare function clear(): void;
@@ -21,8 +56,11 @@ declare function clear(): void;
21
56
  declare function pause(): void;
22
57
  /** Wznawia liczniki od pozostałego czasu. */
23
58
  declare function resume(): void;
59
+ /** Domyślny wygląd i zachowanie toastów w całej aplikacji; wołaj raz, przy starcie. */
60
+ declare function configure(next: KptToastConfig): void;
24
61
  /** Powiadomienia (toasty). Renderuje je `<KptToastContainer />`, umieszczony raz w aplikacji. */
25
62
  export declare const kptToast: {
63
+ configure: typeof configure;
26
64
  show: typeof show;
27
65
  info: (message: string, options?: KptToastOptions) => number;
28
66
  success: (message: string, options?: KptToastOptions) => number;
@@ -35,4 +73,6 @@ export declare const kptToast: {
35
73
  };
36
74
  /** Bieżąca lista toastów. Używane przez kontener; przydaje się też do własnego renderowania. */
37
75
  export declare function useKptToasts(): KptToast[];
76
+ /** Czy liczniki stoją (wskaźnik albo fokus na toastach, albo `kptToast.pause()`). */
77
+ export declare function useKptToastsPaused(): boolean;
38
78
  export {};
@@ -1,7 +1,31 @@
1
1
  import { useSyncExternalStore } from 'react';
2
+ /** Czas toastu, którego inaczej nie dałoby się zamknąć (bez X, bez akcji, bez czasu). */
3
+ export const KPT_TOAST_FALLBACK_DURATION = 5000;
4
+ /**
5
+ * Pełny toast z opcji i konfiguracji. Kolejność: opcja toastu > `kptToast.configure` > wartość
6
+ * biblioteki. Na końcu bezpiecznik: toast, którego nie da się zamknąć ani przyciskiem, ani akcją,
7
+ * dostaje czas, bo inaczej zostałby na ekranie na zawsze.
8
+ */
9
+ export function resolveKptToast(id, message, options, config) {
10
+ const closable = options.closable ?? config?.closable ?? true;
11
+ let duration = options.duration ?? (options.action ? 0 : (config?.duration ?? 4000));
12
+ if (!closable && !options.action && duration <= 0)
13
+ duration = KPT_TOAST_FALLBACK_DURATION;
14
+ return {
15
+ variant: 'info',
16
+ ...options,
17
+ id,
18
+ message,
19
+ duration,
20
+ closable,
21
+ appearance: options.appearance ?? config?.appearance ?? 'outline',
22
+ progress: options.progress ?? config?.progress ?? false,
23
+ };
24
+ }
2
25
  let toasts = [];
3
26
  let seq = 0;
4
27
  let paused = false;
28
+ let config = null;
5
29
  const timers = new Map();
6
30
  const listeners = new Set();
7
31
  function emit() {
@@ -10,7 +34,7 @@ function emit() {
10
34
  }
11
35
  function show(message, options = {}) {
12
36
  const id = ++seq;
13
- const toast = { id, message, variant: 'info', duration: 4000, ...options };
37
+ const toast = resolveKptToast(id, message, options, config);
14
38
  toasts = [...toasts, toast];
15
39
  emit();
16
40
  if (toast.duration > 0) {
@@ -48,6 +72,7 @@ function pause() {
48
72
  if (paused)
49
73
  return;
50
74
  paused = true;
75
+ emit();
51
76
  const now = Date.now();
52
77
  for (const timer of timers.values()) {
53
78
  if (!timer.handle)
@@ -62,11 +87,17 @@ function resume() {
62
87
  if (!paused)
63
88
  return;
64
89
  paused = false;
90
+ emit();
65
91
  for (const id of timers.keys())
66
92
  start(id);
67
93
  }
94
+ /** Domyślny wygląd i zachowanie toastów w całej aplikacji; wołaj raz, przy starcie. */
95
+ function configure(next) {
96
+ config = { ...next };
97
+ }
68
98
  /** Powiadomienia (toasty). Renderuje je `<KptToastContainer />`, umieszczony raz w aplikacji. */
69
99
  export const kptToast = {
100
+ configure,
70
101
  show,
71
102
  info: (message, options) => show(message, { ...options, variant: 'info' }),
72
103
  success: (message, options) => show(message, { ...options, variant: 'success' }),
@@ -88,3 +119,7 @@ function subscribe(listener) {
88
119
  export function useKptToasts() {
89
120
  return useSyncExternalStore(subscribe, () => toasts, () => EMPTY);
90
121
  }
122
+ /** Czy liczniki stoją (wskaźnik albo fokus na toastach, albo `kptToast.pause()`). */
123
+ export function useKptToastsPaused() {
124
+ return useSyncExternalStore(subscribe, () => paused, () => false);
125
+ }
@@ -1,18 +1,18 @@
1
1
  # KptToolbar (@konce-pt/react)
2
2
 
3
- The top bar — a horizontal strip for application content (logo, actions).
3
+ The top bar - a horizontal strip for application content (logo, actions).
4
4
  Import: `import { KptToolbar, KptToolbarSpacer } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
7
  <div class="kpt-toolbar kpt-toolbar--elevated">
8
- …children…
8
+ ...children...
9
9
  <span kpttoolbarspacer=""></span>
10
- …children…
10
+ ...children...
11
11
  </div>
12
12
 
13
13
  ## Props
14
- - `elevated`: boolean — adds a shadow under the bar
15
- - `wrap`: boolean — lets the content wrap onto further rows when it runs out of room
14
+ - `elevated`: boolean - adds a shadow under the bar
15
+ - `wrap`: boolean - lets the content wrap onto further rows when it runs out of room
16
16
  - `className`, `ref` and every other `<div>` prop go to the bar itself
17
17
 
18
18
  `wrap` is opt-in because wrapping changes what `<KptToolbarSpacer>` does: in a single-row bar it
@@ -30,10 +30,10 @@ serves both ports).
30
30
  <KptButton variant="text">Sign out</KptButton>
31
31
  </KptToolbar>
32
32
 
33
- <KptAppShell toolbar={<KptToolbar elevated>…</KptToolbar>} sidenav={…}>…</KptAppShell>
33
+ <KptAppShell toolbar={<KptToolbar elevated>...</KptToolbar>} sidenav={...}>...</KptAppShell>
34
34
 
35
35
  ## Responsiveness
36
- Below the `sm` breakpoint the bar shrinks on its own — a lower height
36
+ Below the `sm` breakpoint the bar shrinks on its own - a lower height
37
37
  (`--kpt-toolbar-height-compact`), narrower inline padding and a smaller gap. No props involved.
38
38
 
39
39
  ## Tokens
@@ -4,13 +4,13 @@ export interface KptToolbarProps extends ComponentPropsWithRef<'div'> {
4
4
  elevated?: boolean;
5
5
  /**
6
6
  * Pozwala zawartości paska zawinąć się do kolejnych wierszy, gdy zabraknie miejsca.
7
- * Opcjonalne, bo zawijanie zmienia zachowanie `<KptToolbarSpacer>` — w jednowierszowym
7
+ * Opcjonalne, bo zawijanie zmienia zachowanie `<KptToolbarSpacer>` - w jednowierszowym
8
8
  * pasku rozpycha on treść, a w zawijanym potrafi zepchnąć resztę do nowego wiersza.
9
9
  */
10
10
  wrap?: boolean;
11
11
  }
12
12
  /**
13
- * Górny pasek (toolbar) — pozioma belka na treść aplikacji (logo, akcje).
13
+ * Górny pasek (toolbar) - pozioma belka na treść aplikacji (logo, akcje).
14
14
  * Poniżej breakpointa `sm` pasek sam zbiega się do niższej wysokości i węższych marginesów.
15
15
  *
16
16
  * @example
@@ -22,7 +22,7 @@ export interface KptToolbarProps extends ComponentPropsWithRef<'div'> {
22
22
  */
23
23
  export declare function KptToolbar({ elevated, wrap, className, ...rest }: Readonly<KptToolbarProps>): import("react").JSX.Element;
24
24
  /**
25
- * Elastyczny odstęp rozpychający zawartość paska. Nosi atrybut `kpttoolbarspacer` —
25
+ * Elastyczny odstęp rozpychający zawartość paska. Nosi atrybut `kpttoolbarspacer` -
26
26
  * to po nim celuje wspólny SCSS (nazwy atrybutów w selektorach CSS są w HTML
27
27
  * case-insensitive, więc jedna reguła obsługuje oba porty).
28
28
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../internal/cn.js";
3
3
  /**
4
- * Górny pasek (toolbar) — pozioma belka na treść aplikacji (logo, akcje).
4
+ * Górny pasek (toolbar) - pozioma belka na treść aplikacji (logo, akcje).
5
5
  * Poniżej breakpointa `sm` pasek sam zbiega się do niższej wysokości i węższych marginesów.
6
6
  *
7
7
  * @example
@@ -15,7 +15,7 @@ export function KptToolbar({ elevated = false, wrap = false, className, ...rest
15
15
  return (_jsx("div", { className: cn('kpt-toolbar', elevated && 'kpt-toolbar--elevated', className), "data-wrap": wrap ? '' : undefined, ...rest }));
16
16
  }
17
17
  /**
18
- * Elastyczny odstęp rozpychający zawartość paska. Nosi atrybut `kpttoolbarspacer` —
18
+ * Elastyczny odstęp rozpychający zawartość paska. Nosi atrybut `kpttoolbarspacer` -
19
19
  * to po nim celuje wspólny SCSS (nazwy atrybutów w selektorach CSS są w HTML
20
20
  * case-insensitive, więc jedna reguła obsługuje oba porty).
21
21
  */
@@ -1,32 +1,31 @@
1
1
  # KptTooltip (@konce-pt/react)
2
2
 
3
- A tooltip shown on hover and focus. Light — the element is appended to `body` and positioned
3
+ A tooltip shown on hover and focus. Light - the element is appended to `body` and positioned
4
4
  against the child. Import: `import { KptTooltip } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
- The component renders NO wrapper of its own — it clones the child and attaches the handlers and a
7
+ The component renders NO wrapper of its own - it clones the child and attaches the handlers and a
8
8
  ref to it, so the tree stays exactly as it would be without the tooltip. This is the port of the
9
9
  `[kptTooltip]` directive, which likewise added nothing to the DOM.
10
10
 
11
11
  <!-- while visible, appended to body: -->
12
- <div class="kpt-tooltip" role="tooltip" style="position: fixed; …">Save changes</div>
12
+ <div class="kpt-tooltip" role="tooltip" style="position: fixed; ...">Save changes</div>
13
13
 
14
14
  ## Props
15
- - `text`: string — the bubble content; empty text disables the tooltip
15
+ - `text`: string - the bubble content; empty text disables the tooltip
16
16
  - `position`: 'top' | 'bottom' | 'left' | 'right' (default 'top')
17
- - `onlyWhenTruncated`: boolean — show it only when the content does not fit
18
- - `children` — exactly one element, the one that gets hover and focus
17
+ - `onlyWhenTruncated`: boolean - show it only when the content does not fit
18
+ - `children` - exactly one element, the one that gets hover and focus
19
19
 
20
20
  ## onlyWhenTruncated
21
21
  The check runs at hover time, not at render, so the result is always current after a width or zoom
22
22
  change, with no observers. It measures the host AND its direct children, because
23
- `text-overflow: ellipsis` usually sits on an inner element — and such an element shrinks to the
23
+ `text-overflow: ellipsis` usually sits on an inner element - and such an element shrinks to the
24
24
  available width instead of stretching its parent, so measuring the host alone would find nothing.
25
25
 
26
26
  ## Styling
27
- The bubble carries inline styles built from tokens rather than a class from the shared stylesheet,
28
- exactly like the Angular directive — it is created outside React's tree, so there is nothing to
29
- attach a stylesheet rule to reliably.
27
+ The bubble is created outside React's tree, so its look comes from `.kpt-tooltip` in `@konce-pt/styles`
28
+ (see "Styling and the top layer" below), the same rule the Angular directive uses.
30
29
 
31
30
  ## Examples
32
31
  <KptTooltip text="Save changes" position="bottom"><KptButton>Save</KptButton></KptTooltip>
@@ -45,5 +44,8 @@ attach a stylesheet rule to reliably.
45
44
  the tooltip) and with `onlyWhenTruncated`, where the text is already in the DOM; the visible
46
45
  bubble is then `aria-hidden`.
47
46
  - `Escape` closes the bubble, and the pointer can move onto it without it disappearing (a 120 ms
48
- grace period) — WCAG 1.4.13.
49
- - It does NOT replace an accessible name — an icon-only button still needs its own label.
47
+ grace period) - WCAG 1.4.13.
48
+ - It does NOT replace an accessible name - an icon-only button still needs its own label.
49
+
50
+ ## Styling and the top layer
51
+ The bubble is styled by `.kpt-tooltip` from `@konce-pt/styles`, in the `kpt.components` layer - override it from your own CSS without `!important`; only `position: fixed` and the coordinates stay inline. Inside an open `<dialog>` or popover the bubble is attached to that element, because a modal dialog lives in the top layer and anything outside it is hidden behind it regardless of `z-index`. A hover shows the bubble after 300 ms (sliding across a toolbar does not light every icon); focus shows it at once. Changing the text while the bubble is visible updates it.
@@ -9,18 +9,19 @@ export interface KptTooltipProps {
9
9
  * Dzięki temu podpowiedź nie powtarza tekstu, który i tak widać.
10
10
  */
11
11
  onlyWhenTruncated?: boolean;
12
- /** Dokładnie jeden element — to on dostaje obsługę hovera i fokusu. */
12
+ /** Dokładnie jeden element - to on dostaje obsługę hovera i fokusu. */
13
13
  children: ReactNode;
14
14
  }
15
15
  /**
16
- * Dymek podpowiedzi pokazywany na hover i focus. Lekki — element dodawany do `body`
17
- * i pozycjonowany względem dziecka.
16
+ * Dymek podpowiedzi pokazywany na hover i focus. Lekki - element dodawany do `body` (albo do
17
+ * otwartego `<dialog>`/popovera dziecka, żeby był widoczny w warstwie szczytowej) i pozycjonowany
18
+ * względem dziecka. Wygląd daje klasa `.kpt-tooltip` z `@konce-pt/styles` w warstwie `kpt.components`.
18
19
  *
19
20
  * Port dyrektywy `[kptTooltip]`: nie renderuje własnego opakowania, tylko dokleja handlery
20
21
  * i ref do przekazanego elementu, więc drzewo DOM zostaje takie samo jak bez tooltipa.
21
22
  *
22
23
  * Dostępność (jak w porcie Angulara): tekst trafia do czytników przez trwały, ukryty opis
23
- * powiązany `aria-describedby` z elementem przyjmującym fokus — pomijany, gdy powtarzałby
24
+ * powiązany `aria-describedby` z elementem przyjmującym fokus - pomijany, gdy powtarzałby
24
25
  * jego nazwę albo przy `onlyWhenTruncated`. `Escape` zamyka dymek, a wskaźnik może na niego
25
26
  * przejść bez zniknięcia (WCAG 1.4.13).
26
27
  *