@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
@@ -9,33 +9,33 @@ Import: `import { KptBackdrop } from '@konce-pt/react';`
9
9
  ## DOM
10
10
  <div class="kpt-backdrop-host" data-effect="wave">
11
11
  <canvas class="kpt-backdrop__canvas" aria-hidden="true"></canvas>
12
- <div class="kpt-backdrop__content">…</div>
12
+ <div class="kpt-backdrop__content">...</div>
13
13
  </div>
14
14
 
15
15
  ## Props (shared)
16
16
  - `effect`: 'signal-grid' | 'wave' (default 'signal-grid')
17
- - `background`: string — the section background; empty takes `--kpt-color-surface`
18
- - `speed`: number (default 1) — 1 is the calm pace of either effect, 0 freezes the picture
19
- - `seed`: number (default 0) — the same value gives the same layout and the same sway
20
- - `paused`: boolean — stops the animation, leaving the last frame
21
- - `adaptive`: boolean — carries hardcoded colours onto the current theme's surface
22
- - `contentProps` — props for the `.kpt-backdrop__content` layer
17
+ - `background`: string - the section background; empty takes `--kpt-color-surface`
18
+ - `speed`: number (default 1) - 1 is the calm pace of either effect, 0 freezes the picture
19
+ - `seed`: number (default 0) - the same value gives the same layout and the same sway
20
+ - `paused`: boolean - stops the animation, leaving the last frame
21
+ - `adaptive`: boolean - carries hardcoded colours onto the current theme's surface
22
+ - `contentProps` - props for the `.kpt-backdrop__content` layer
23
23
  - `className`, `ref` and every other `<div>` prop go to `.kpt-backdrop-host`
24
24
 
25
25
  ## Props (signal-grid)
26
- - `color`: string — the square colour, any CSS notation, tokens included; empty takes
26
+ - `color`: string - the square colour, any CSS notation, tokens included; empty takes
27
27
  `--kpt-color-primary`
28
- - `anchor`: 'left' | 'right' (default 'right') — the edge the grid is densest at
29
- - `cell`: number (default 5), `gap`: number (default 11) — the square and the space between, in px
30
- - `density`: number (default 0.8) — the share of lit cells at the anchor, 0–1
31
- - `falloff`: number (default 1.4) — how fast the grid fades towards the far edge
28
+ - `anchor`: 'left' | 'right' (default 'right') - the edge the grid is densest at
29
+ - `cell`: number (default 5), `gap`: number (default 11) - the square and the space between, in px
30
+ - `density`: number (default 0.8) - the share of lit cells at the anchor, 0-1
31
+ - `falloff`: number (default 1.4) - how fast the grid fades towards the far edge
32
32
 
33
33
  ## Props (wave)
34
- - `colors`: string[] — the colour ramp the current slides along, closed into a loop; every
34
+ - `colors`: string[] - the colour ramp the current slides along, closed into a loop; every
35
35
  stop takes any CSS notation, `color`'s rules exactly
36
- - `rotation`: number (default 12) — the angle the current crosses the frame at, in degrees
37
- - `band`: number (default 0.34) — the band's width as a fraction of the frame's height
38
- - `amplitude`: number (default 0.16) — how far the centre line sways
36
+ - `rotation`: number (default 12) - the angle the current crosses the frame at, in degrees
37
+ - `band`: number (default 0.34) - the band's width as a fraction of the frame's height
38
+ - `amplitude`: number (default 0.16) - how far the centre line sways
39
39
 
40
40
  A prop that does not belong to the current effect is simply not read.
41
41
 
@@ -56,12 +56,12 @@ rotation. The library's palette is neutral, so that default current is single-hu
56
56
 
57
57
  Every stop is put to the browser, so `oklch()`, `color-mix()`, `rgb()` and named colours are read
58
58
  the same as hex; alpha is dropped. A stop the browser refuses falls out of the ramp, and if every
59
- one of them falls out the default ramp takes over rather than the section going blank — a dev
59
+ one of them falls out the default ramp takes over rather than the section going blank - a dev
60
60
  build says in the console which stops it dropped.
61
61
 
62
62
  ## The same picture in both ports
63
- Everything that decides how it looks — the grid layout, the density ramp, the twinkle, the current
64
- and the colour ramp, plus the renderers themselves — lives in `@konce-pt/backdrop`, shared with
63
+ Everything that decides how it looks - the grid layout, the density ramp, the twinkle, the current
64
+ and the colour ramp, plus the renderers themselves - lives in `@konce-pt/backdrop`, shared with
65
65
  the Angular port. This component is the lifecycle: `rAF`, `ResizeObserver`, `IntersectionObserver`,
66
66
  the reduced-motion query and the theme watch. The same props therefore give the
67
67
  same frame in either port.
@@ -74,7 +74,7 @@ slider accelerates the picture instead of jumping it. A change of `colors` is tr
74
74
  not by array identity, so a fresh array from a parent render does not rebuild the renderer.
75
75
 
76
76
  ## Accessibility
77
- The canvas carries `aria-hidden="true"` and `pointer-events: none` — it is decoration with no
77
+ The canvas carries `aria-hidden="true"` and `pointer-events: none` - it is decoration with no
78
78
  content and nothing to hit. Children keep their own roles and tab order.
79
79
 
80
80
  ## Tokens
@@ -86,24 +86,24 @@ A literal stays put by design, which is right for a brand colour and wrong for a
86
86
  read in both themes. `adaptive` closes that gap: it carries `color`, `colors` and `background`
87
87
  onto the surface of the current theme, keeping each one's distance from that surface. Black picked
88
88
  for a white section comes out white on a near-black ground, and that white background comes out at
89
- the surface's own lightness. Only lightness moves — hue and chroma stay, so a brand colour keeps
89
+ the surface's own lightness. Only lightness moves - hue and chroma stay, so a brand colour keeps
90
90
  being that colour and only changes how light it is.
91
91
 
92
92
  It touches literals only. An empty input takes a token, and a value reaching through `var()`
93
93
  reaches a token too; both already follow the theme, and adapting them would turn them back again.
94
- Values written for the light theme are the assumption — the library keeps light in `:root` and
94
+ Values written for the light theme are the assumption - the library keeps light in `:root` and
95
95
  dark as the override.
96
96
 
97
97
  ## Content on a custom background
98
98
  The host paints `--kpt-color-surface` and lets content inherit `--kpt-color-on-surface`, which is
99
- right until the section gets a `background` of its own — then that token describes the page around
99
+ right until the section gets a `background` of its own - then that token describes the page around
100
100
  it, not the ground the content actually sits on. A dark section in a light theme would come out
101
101
  black on black.
102
102
 
103
103
  So a section with its own background works out its own ink: the host sets `color` to match what it
104
104
  paints, and announces the result as `data-tone` (`light` for a light background, `dark` for a dark
105
- one). Text follows by inheritance; anything needing more than a text colour — buttons in the
106
- section, say — can hang its own tokens off the attribute:
105
+ one). Text follows by inheritance; anything needing more than a text colour - buttons in the
106
+ section, say - can hang its own tokens off the attribute:
107
107
 
108
108
  :where(div.kpt-backdrop-host[data-tone='light']) .hero { --kpt-button-filled-bg: #15181a; }
109
109
 
@@ -112,7 +112,7 @@ matches the adapted value, not the one written in the template. A section withou
112
112
  background announces nothing and content stays on `--kpt-color-on-surface`.
113
113
 
114
114
  ## Theme
115
- Canvas does not expand `var()`, so the colour is read once and baked into the renderer — the
115
+ Canvas does not expand `var()`, so the colour is read once and baked into the renderer - the
116
116
  component therefore watches for anything that can restyle the tokens under it and reads them
117
117
  again. `[data-theme="dark"]` is not tied to `:root`, so the watch covers `data-theme`, `class`
118
118
  and `style` on every ancestor from the host up to `<html>`, plus the `prefers-color-scheme` query
@@ -122,7 +122,7 @@ when the colour actually came out different, so an unrelated class landing on `<
122
122
  cheap read and nothing else.
123
123
 
124
124
  Whether an explicit `color` or `colors` follows the theme is up to how it is written. A literal
125
- stays put — `#5b8af2` is `#5b8af2` in either theme, which is what someone spelling out a brand
125
+ stays put - `#5b8af2` is `#5b8af2` in either theme, which is what someone spelling out a brand
126
126
  colour wants. An expression reaching for a token is resolved against the tree on every rebuild, so
127
127
  it moves with the theme on its own:
128
128
 
@@ -4,7 +4,7 @@ export type KptBadgeSize = 'sm' | 'md' | 'lg';
4
4
  export interface KptBadgeProps extends ComponentPropsWithRef<'span'> {
5
5
  value?: string | number | null;
6
6
  variant?: KptBadgeVariant;
7
- /** Rozmiar — `sm` mieści się w wierszu tekstu, `md` to domyślny licznik. */
7
+ /** Rozmiar - `sm` mieści się w wierszu tekstu, `md` to domyślny licznik. */
8
8
  size?: KptBadgeSize;
9
9
  /** Sama kropka statusu, bez liczby. */
10
10
  dot?: boolean;
@@ -13,7 +13,7 @@ export interface KptBadgeProps extends ComponentPropsWithRef<'span'> {
13
13
  /** Powyżej tej wartości licznik pokazuje `99+`. */
14
14
  max?: number;
15
15
  /**
16
- * Znaczenie plakietki dla czytnika ekranu, np. „3 nieprzeczytane”. Sama liczba („3”) albo kropka
16
+ * Znaczenie plakietki dla czytnika ekranu, np. "3 nieprzeczytane". Sama liczba ("3") albo kropka
17
17
  * nic nie mówią; z `label` widoczny tekst jest ukryty przed czytnikiem, a odczytywana jest etykieta.
18
18
  */
19
19
  label?: string;
@@ -22,7 +22,7 @@ export interface KptBadgeProps extends ComponentPropsWithRef<'span'> {
22
22
  children?: ReactNode;
23
23
  }
24
24
  /**
25
- * Znacznik (badge) — licznik lub kropka statusu. Samodzielny albo nałożony na treść (`overlay`).
25
+ * Znacznik (badge) - licznik lub kropka statusu. Samodzielny albo nałożony na treść (`overlay`).
26
26
  *
27
27
  * @example
28
28
  * <KptBadge value={3} variant="danger" />
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../internal/cn.js";
3
3
  /**
4
- * Znacznik (badge) — licznik lub kropka statusu. Samodzielny albo nałożony na treść (`overlay`).
4
+ * Znacznik (badge) - licznik lub kropka statusu. Samodzielny albo nałożony na treść (`overlay`).
5
5
  *
6
6
  * @example
7
7
  * <KptBadge value={3} variant="danger" />
@@ -1,25 +1,25 @@
1
1
  # KptBadge (@konce-pt/react)
2
2
 
3
- A badge — a counter or a status dot. Standalone, or laid over content (`overlay`).
3
+ A badge - a counter or a status dot. Standalone, or laid over content (`overlay`).
4
4
  Import: `import { KptBadge } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
7
  <span class="kpt-badge-host">
8
- …children…
8
+ ...children...
9
9
  <span class="kpt-badge kpt-badge--overlay" data-variant="danger" data-size="md">
10
10
  <span aria-hidden="true">8</span><span class="kpt-badge__label">8 unread</span>
11
11
  </span>
12
12
  </span>
13
13
 
14
14
  ## Props
15
- - `value`: string | number | null — the counter content
15
+ - `value`: string | number | null - the counter content
16
16
  - `variant`: 'neutral' | 'primary' | 'success' | 'danger' | 'warning' | 'info' (default 'primary')
17
- - `size`: 'sm' | 'md' | 'lg' (default 'md') — `sm` fits inside a line of text
18
- - `dot`: boolean — a bare status dot, no number
19
- - `overlay`: boolean — laid over the `children`
20
- - `max`: number (default 99) — above it the counter reads `99+`
21
- - `label`: string — the meaning for screen readers (“3 unread”, “online”); the visible text is then `aria-hidden`
22
- - `hideZero`: boolean — hides the badge when `value` is `0` or `null` (not with `dot`)
17
+ - `size`: 'sm' | 'md' | 'lg' (default 'md') - `sm` fits inside a line of text
18
+ - `dot`: boolean - a bare status dot, no number
19
+ - `overlay`: boolean - laid over the `children`
20
+ - `max`: number (default 99) - above it the counter reads `99+`
21
+ - `label`: string - the meaning for screen readers ("3 unread", "online"); the visible text is then `aria-hidden`
22
+ - `hideZero`: boolean - hides the badge when `value` is `0` or `null` (not with `dot`)
23
23
  - `className`, `ref` and every other `<span>` prop go to the host
24
24
 
25
25
  ## Overlay
@@ -34,10 +34,10 @@ it on the host rather than on the badge.
34
34
  <span>Notifications <KptBadge value={4} size="sm" variant="success" /></span>
35
35
 
36
36
  ## Tokens
37
- Background `--kpt-color-{primary,success,danger,warning,info}` with the text in the matching `*-contrast` token (`--kpt-color-on-primary` for `primary`) — the same pairs as `kpt-button`; `neutral` is `--kpt-color-muted` / `--kpt-color-on-muted`; the overlay ring comes from `--kpt-color-surface`.
37
+ Background `--kpt-color-{primary,success,danger,warning,info}` with the text in the matching `*-contrast` token (`--kpt-color-on-primary` for `primary`) - the same pairs as `kpt-button`; `neutral` is `--kpt-color-muted` / `--kpt-color-on-muted`; the overlay ring comes from `--kpt-color-surface`.
38
38
 
39
39
  ## Accessibility
40
- On its own a badge is just a number, and a `dot` is nothing. `label` gives it a meaning — a visually
40
+ On its own a badge is just a number, and a `dot` is nothing. `label` gives it a meaning - a visually
41
41
  hidden `.kpt-badge__label` that screen readers read instead of the visible text. Without `label`, put
42
42
  the meaning into the name of the control the badge sits on. Count changes are not announced. The
43
43
  `success`, `warning` and `info` variants draw the text in `--kpt-color-surface`; check the contrast
@@ -4,18 +4,23 @@ export interface KptBottomSheetProps extends ComponentPropsWithRef<'div'>, KptI1
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  header?: string;
7
+ /**
8
+ * Nazwa panelu bez `header` - okno dialogowe bez nazwy czytnik ogłasza jako samo "okno
9
+ * dialogowe" (WCAG 4.1.2). Z nagłówkiem nazwą jest nagłówek (`aria-labelledby`).
10
+ */
11
+ ariaLabel?: string;
7
12
  closeOnBackdrop?: boolean;
8
13
  children?: ReactNode;
9
14
  }
10
15
  /**
11
16
  * Arkusz wysuwany z dołu ekranu.
12
17
  *
13
- * Arkusz zostaje w DOM także zamknięty — chowa go `transform` i `visibility`, nigdy
18
+ * Arkusz zostaje w DOM także zamknięty - chowa go `transform` i `visibility`, nigdy
14
19
  * `display: none`, bo inaczej animacje wjazdu i zjazdu nie miałyby od czego wystartować.
15
20
  * `visibility` wyjmuje go przy tym z kolejności Tab i z drzewa dostępności bez `inert`,
16
21
  * i robi to już na pierwszej klatce.
17
22
  *
18
23
  * @example
19
- * <KptBottomSheet open={open} onOpenChange={setOpen} header="Udostępnij">…</KptBottomSheet>
24
+ * <KptBottomSheet open={open} onOpenChange={setOpen} header="Udostępnij">...</KptBottomSheet>
20
25
  */
21
- export declare function KptBottomSheet({ open, onOpenChange, header, closeOnBackdrop, locale, dictionary, className, children, ...rest }: Readonly<KptBottomSheetProps>): import("react").JSX.Element;
26
+ export declare function KptBottomSheet({ open, onOpenChange, header, ariaLabel, closeOnBackdrop, locale, dictionary, className, children, ...rest }: Readonly<KptBottomSheetProps>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useRef } from 'react';
3
4
  import { cn } from "../internal/cn.js";
@@ -7,21 +8,21 @@ import { useKptMessages } from "../i18n/i18n-context.js";
7
8
  /**
8
9
  * Arkusz wysuwany z dołu ekranu.
9
10
  *
10
- * Arkusz zostaje w DOM także zamknięty — chowa go `transform` i `visibility`, nigdy
11
+ * Arkusz zostaje w DOM także zamknięty - chowa go `transform` i `visibility`, nigdy
11
12
  * `display: none`, bo inaczej animacje wjazdu i zjazdu nie miałyby od czego wystartować.
12
13
  * `visibility` wyjmuje go przy tym z kolejności Tab i z drzewa dostępności bez `inert`,
13
14
  * i robi to już na pierwszej klatce.
14
15
  *
15
16
  * @example
16
- * <KptBottomSheet open={open} onOpenChange={setOpen} header="Udostępnij">…</KptBottomSheet>
17
+ * <KptBottomSheet open={open} onOpenChange={setOpen} header="Udostępnij">...</KptBottomSheet>
17
18
  */
18
- export function KptBottomSheet({ open, onOpenChange, header = '', closeOnBackdrop = true, locale, dictionary, className, children, ...rest }) {
19
+ export function KptBottomSheet({ open, onOpenChange, header = '', ariaLabel = '', closeOnBackdrop = true, locale, dictionary, className, children, ...rest }) {
19
20
  const { t } = useKptMessages({ locale, dictionary });
20
21
  const close = () => onOpenChange(false);
21
22
  const panelRef = useRef(null);
22
23
  const titleId = useKptId(undefined, 'kpt-bottom-sheet-title');
23
24
  useModalFocus(open, panelRef);
24
- return (_jsxs("div", { className: cn('kpt-bottom-sheet-host', className), ...rest, children: [_jsx("div", { className: cn('kpt-bottom-sheet__backdrop', open && 'is-open'), onClick: () => closeOnBackdrop && close() }), _jsxs("div", { ref: panelRef, className: cn('kpt-bottom-sheet__panel', open && 'is-open'), role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, tabIndex: -1, onKeyDown: (event) => {
25
+ return (_jsxs("div", { className: cn('kpt-bottom-sheet-host', className), ...rest, children: [_jsx("div", { className: cn('kpt-bottom-sheet__backdrop', open && 'is-open'), onClick: () => closeOnBackdrop && close() }), _jsxs("div", { ref: panelRef, className: cn('kpt-bottom-sheet__panel', open && 'is-open'), role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, "aria-label": header ? undefined : ariaLabel || undefined, tabIndex: -1, onKeyDown: (event) => {
25
26
  if (event.key === 'Escape')
26
27
  close();
27
28
  }, children: [_jsx("button", { type: "button", className: "kpt-bottom-sheet__handle", onClick: close, "aria-label": t('common.close') }), header ? (_jsx("div", { className: "kpt-bottom-sheet__header", id: titleId, children: header })) : null, _jsx("div", { className: "kpt-bottom-sheet__body", children: children })] })] }));
@@ -9,41 +9,44 @@ Import: `import { KptBottomSheet } from '@konce-pt/react';`
9
9
  <div class="kpt-bottom-sheet__panel is-open" role="dialog" aria-modal="true" tabindex="-1">
10
10
  <button class="kpt-bottom-sheet__handle"></button>
11
11
  <div class="kpt-bottom-sheet__header">Share</div>
12
- <div class="kpt-bottom-sheet__body">…</div>
12
+ <div class="kpt-bottom-sheet__body">...</div>
13
13
  </div>
14
14
  </div>
15
15
 
16
16
  ## Props
17
- - `open`, `onOpenChange` — controlled, like `KptDialog`
17
+ - `open`, `onOpenChange` - controlled, like `KptDialog`
18
18
  - `header`: string
19
19
  - `closeOnBackdrop`: boolean (default true)
20
- - `children` — the sheet's content
20
+ - `children` - the sheet's content
21
21
  - `className`, `ref` and every other `<div>` prop go to the host
22
22
 
23
23
  ## The closed sheet stays in the DOM
24
- It is hidden with `transform` and `visibility`, never `display: none` — the slide-in and slide-out
24
+ It is hidden with `transform` and `visibility`, never `display: none` - the slide-in and slide-out
25
25
  animations need something to run on. `visibility` also takes it out of the tab order and out of the
26
26
  accessibility tree without `inert`, and does so on the very first frame, with no JavaScript.
27
27
  `prefers-reduced-motion: reduce` drops the transitions.
28
28
 
29
29
  ## No portal
30
30
  The panel and the backdrop are `position: fixed` and the host is `display: contents`, so the sheet
31
- needs no portal — the same DOM as the Angular port. A transformed ancestor would break the fixed
31
+ needs no portal - the same DOM as the Angular port. A transformed ancestor would break the fixed
32
32
  positioning there too.
33
33
 
34
34
  ## Focus and keyboard
35
35
  Opening moves focus into the panel (its first focusable element, else the panel
36
- itself) and traps it there — `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises.
36
+ itself) and traps it there - `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises.
37
37
  Closing returns focus to the element that had it before. `Escape` closes the panel. The panel
38
38
  is named by its `header` through `aria-labelledby`. The shared helper is `internal/use-modal-focus.ts` (the Angular port has a twin on the CDK focus trap).
39
39
 
40
40
  ## Examples
41
41
  <KptButton onClick={() => setOpen(true)}>Share</KptButton>
42
- <KptBottomSheet open={open} onOpenChange={setOpen} header="Share">…</KptBottomSheet>
42
+ <KptBottomSheet open={open} onOpenChange={setOpen} header="Share">...</KptBottomSheet>
43
43
 
44
44
  ## Tokens
45
45
  The panel `--kpt-color-surface-raised`, the top radius `--kpt-radius-lg`, `--kpt-elevation-4`.
46
46
 
47
47
  ## Accessibility
48
48
  `role="dialog"`, `aria-modal` and `aria-labelledby` pointing at the header; the handle is a real button
49
- labelled from `common.close`. Focus handling — see "Focus and keyboard" above.
49
+ labelled from `common.close`. Focus handling - see "Focus and keyboard" above.
50
+
51
+ ## Name and scrolling
52
+ Without `header` give the sheet `ariaLabel` - a `role="dialog"` without a name is announced as a bare "dialog". An open sheet locks page scrolling underneath.
@@ -1,4 +1,5 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
+ import { type KptNavigateEvent } from '../shared/types.ts';
2
3
  import { type KptI18nOverrides } from '../i18n/i18n-context.tsx';
3
4
  export interface KptBreadcrumbItem {
4
5
  label: string;
@@ -6,14 +7,19 @@ export interface KptBreadcrumbItem {
6
7
  }
7
8
  export interface KptBreadcrumbProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>, KptI18nOverrides {
8
9
  items?: readonly KptBreadcrumbItem[];
10
+ /**
11
+ * Zwykły klik w odnośnik. Aplikacja z routerem woła `event.preventDefault()` i nawiguje sama -
12
+ * bez tego `<a href>` przeładowuje stronę.
13
+ */
14
+ onNavigate?: (event: KptNavigateEvent<KptBreadcrumbItem>) => void;
9
15
  }
10
16
  /**
11
17
  * Ścieżka nawigacji (breadcrumbs).
12
18
  *
13
- * Ostatnia pozycja nigdy nie jest odnośnikiem, nawet gdy ma `url` — to bieżąca strona, a link
19
+ * Ostatnia pozycja nigdy nie jest odnośnikiem, nawet gdy ma `url` - to bieżąca strona, a link
14
20
  * prowadzący w to samo miejsce, w którym już jesteś, tylko myli.
15
21
  *
16
22
  * @example
17
23
  * <KptBreadcrumb items={[{ label: 'Start', url: '/' }, { label: 'Ustawienia' }]} />
18
24
  */
19
- export declare function KptBreadcrumb({ items, locale, dictionary, className, ...rest }: Readonly<KptBreadcrumbProps>): import("react").JSX.Element;
25
+ export declare function KptBreadcrumb({ items, onNavigate, locale, dictionary, className, ...rest }: Readonly<KptBreadcrumbProps>): import("react").JSX.Element;
@@ -1,20 +1,28 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { kptIsPlainClick } from "../shared/types.js";
2
4
  import { cn } from "../internal/cn.js";
3
5
  import { useKptMessages } from "../i18n/i18n-context.js";
4
6
  import { KptIcon } from "../icon/icon.js";
5
7
  /**
6
8
  * Ścieżka nawigacji (breadcrumbs).
7
9
  *
8
- * Ostatnia pozycja nigdy nie jest odnośnikiem, nawet gdy ma `url` — to bieżąca strona, a link
10
+ * Ostatnia pozycja nigdy nie jest odnośnikiem, nawet gdy ma `url` - to bieżąca strona, a link
9
11
  * prowadzący w to samo miejsce, w którym już jesteś, tylko myli.
10
12
  *
11
13
  * @example
12
14
  * <KptBreadcrumb items={[{ label: 'Start', url: '/' }, { label: 'Ustawienia' }]} />
13
15
  */
14
- export function KptBreadcrumb({ items = [], locale, dictionary, className, ...rest }) {
16
+ export function KptBreadcrumb({ items = [], onNavigate, locale, dictionary, className, ...rest }) {
15
17
  const { t } = useKptMessages({ locale, dictionary });
18
+ /** Zwykły klik w odnośnik -> `onNavigate` (Ctrl/Cmd/Shift, środkowy przycisk i `_blank` zostają natywne). */
19
+ const linkClick = (event, item) => {
20
+ if (item.url && onNavigate && kptIsPlainClick(event, event.currentTarget.target)) {
21
+ onNavigate({ item, url: item.url, event: event.nativeEvent });
22
+ }
23
+ };
16
24
  return (_jsx("div", { className: cn('kpt-breadcrumb-host', className), ...rest, children: _jsx("nav", { className: "kpt-breadcrumb", "aria-label": t('breadcrumb.label'), children: _jsx("ol", { className: "kpt-breadcrumb__list", children: items.map((item, index) => {
17
25
  const last = index === items.length - 1;
18
- return (_jsxs("li", { className: "kpt-breadcrumb__item", children: [item.url && !last ? (_jsx("a", { className: "kpt-breadcrumb__link", href: item.url, children: item.label })) : (_jsx("span", { className: "kpt-breadcrumb__current", "aria-current": last ? 'page' : undefined, children: item.label })), last ? null : _jsx(KptIcon, { name: "chevron-right", className: "kpt-breadcrumb__sep" })] }, index));
26
+ return (_jsxs("li", { className: "kpt-breadcrumb__item", children: [item.url && !last ? (_jsx("a", { className: "kpt-breadcrumb__link", href: item.url, onClick: (event) => linkClick(event, item), children: item.label })) : (_jsx("span", { className: "kpt-breadcrumb__current", "aria-current": last ? 'page' : undefined, children: item.label })), last ? null : _jsx(KptIcon, { name: "chevron-right", className: "kpt-breadcrumb__sep" })] }, `${index}-${item.url ?? item.label}`));
19
27
  }) }) }) }));
20
28
  }
@@ -8,7 +8,7 @@ A breadcrumb trail. Import: `import { KptBreadcrumb } from '@konce-pt/react';`
8
8
  <ol class="kpt-breadcrumb__list">
9
9
  <li class="kpt-breadcrumb__item">
10
10
  <a class="kpt-breadcrumb__link" href="/">Home</a>
11
- <span class="kpt-icon-host kpt-breadcrumb__sep">…</span>
11
+ <span class="kpt-icon-host kpt-breadcrumb__sep">...</span>
12
12
  </li>
13
13
  <li class="kpt-breadcrumb__item">
14
14
  <span class="kpt-breadcrumb__current" aria-current="page">Showcase</span>
@@ -19,7 +19,7 @@ A breadcrumb trail. Import: `import { KptBreadcrumb } from '@konce-pt/react';`
19
19
 
20
20
  ## Props
21
21
  - `items`: `{ label, url? }[]`
22
- - `locale`, `dictionary` — i18n overrides for this component only
22
+ - `locale`, `dictionary` - i18n overrides for this component only
23
23
  - `className`, `ref` and every other `<div>` prop go to the host
24
24
 
25
25
  ## The last item is never a link
@@ -40,3 +40,11 @@ The nav label comes from `breadcrumb.label` in the dictionary.
40
40
  A `<nav>` landmark labelled from `breadcrumb.label`, holding an ordered list (`<ol>`/`<li>`), so a
41
41
  screen reader announces how many levels the trail has. The current page carries
42
42
  `aria-current="page"`; separators are icons hidden from assistive technology.
43
+
44
+ ## Router
45
+ Links are plain `<a href>`, so without a router a click reloads the page. `onNavigate` fires on a plain
46
+ click (left button, no Ctrl/Cmd/Shift, no `target="_blank"`) with `{ item, url, event }`: call
47
+ `event.preventDefault()` and navigate with your router. Modified clicks stay native (a new tab, a new
48
+ window). The library depends on no router.
49
+
50
+ <KptBreadcrumb items={items} onNavigate={({ event, url }) => { event.preventDefault(); navigate(url); }} />
@@ -13,7 +13,7 @@ export interface KptButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'h
13
13
  fullWidth?: boolean;
14
14
  /** Nazwa ikony wiodącej z rejestru (`KptIconRegistry`). */
15
15
  icon?: string;
16
- /** Nazwa ikony zamykającej — zwykle znacznik kierunku, nie akcja. */
16
+ /** Nazwa ikony zamykającej - zwykle znacznik kierunku, nie akcja. */
17
17
  iconEnd?: string;
18
18
  /** Klasa dokładana do ikony wiodącej; obok stałego haka `.kpt-button__icon`. */
19
19
  iconClassName?: string;
@@ -27,10 +27,10 @@ export interface KptButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'h
27
27
  }
28
28
  /**
29
29
  * Przycisk Koncept UI. Renderuje natywny `<button>` (semantyka + submit formularza)
30
- * albo `<a>`, gdy podasz `href` — w hoście `.kpt-button-host`, czyli dwa poziomy DOM,
30
+ * albo `<a>`, gdy podasz `href` - w hoście `.kpt-button-host`, czyli dwa poziomy DOM,
31
31
  * dokładnie jak w porcie Angulara, bo host niesie własne style.
32
32
  *
33
- * Ikonę można podać nazwą (`icon`/`iconEnd`) albo wstawić w `children` — oba sposoby
33
+ * Ikonę można podać nazwą (`icon`/`iconEnd`) albo wstawić w `children` - oba sposoby
34
34
  * dostają ten sam odstęp i tę samą skalę. Przy `loading` spinner zajmuje miejsce ikony wiodącej.
35
35
  *
36
36
  * @example
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { isValidElement } from 'react';
3
4
  import { cn } from "../internal/cn.js";
@@ -5,10 +6,10 @@ import { renderAsChild } from "../internal/slot.js";
5
6
  import { KptIcon } from "../icon/icon.js";
6
7
  /**
7
8
  * Przycisk Koncept UI. Renderuje natywny `<button>` (semantyka + submit formularza)
8
- * albo `<a>`, gdy podasz `href` — w hoście `.kpt-button-host`, czyli dwa poziomy DOM,
9
+ * albo `<a>`, gdy podasz `href` - w hoście `.kpt-button-host`, czyli dwa poziomy DOM,
9
10
  * dokładnie jak w porcie Angulara, bo host niesie własne style.
10
11
  *
11
- * Ikonę można podać nazwą (`icon`/`iconEnd`) albo wstawić w `children` — oba sposoby
12
+ * Ikonę można podać nazwą (`icon`/`iconEnd`) albo wstawić w `children` - oba sposoby
12
13
  * dostają ten sam odstęp i tę samą skalę. Przy `loading` spinner zajmuje miejsce ikony wiodącej.
13
14
  *
14
15
  * @example
@@ -21,14 +22,14 @@ import { KptIcon } from "../icon/icon.js";
21
22
  export function KptButton({ variant = 'filled', size = 'md', type = 'button', loading = false, fullWidth = false, disabled = false, asChild = false, icon, iconEnd, iconClassName, iconEndClassName, href, target, rel, hostProps, className, children, ...rest }) {
22
23
  const { className: hostClassName, ...hostRest } = hostProps ?? {};
23
24
  const isDisabled = disabled || loading;
24
- // Zawartość jest identyczna we wszystkich trybach — w `asChild` podmieniamy tylko element
25
+ // Zawartość jest identyczna we wszystkich trybach - w `asChild` podmieniamy tylko element
25
26
  // zewnętrzny, nie strukturę środka, żeby SCSS (`__spinner`, `__content`) dalej działał.
26
27
  const content = (_jsxs(_Fragment, { children: [loading ? (_jsx("span", { className: "kpt-button__spinner", "aria-hidden": "true" })) : icon ? (_jsx(KptIcon, { className: cn('kpt-button__icon', iconClassName), name: icon })) : null, _jsx("span", { className: "kpt-button__content", children: asChildContent(asChild, children) }), iconEnd ? (_jsx(KptIcon, { className: cn('kpt-button__icon', 'kpt-button__icon--end', iconEndClassName), name: iconEnd })) : null] }));
27
28
  const buttonProps = {
28
29
  className: cn('kpt-button', loading && 'kpt-button--loading', className),
29
30
  'data-variant': variant,
30
31
  'data-size': size,
31
- // React serializuje atrybuty aria-* z booleana na "true"/"false" — wynikowy DOM
32
+ // React serializuje atrybuty aria-* z booleana na "true"/"false" - wynikowy DOM
32
33
  // ma `aria-busy="true"`, tak jak port Angulara.
33
34
  'aria-busy': loading || undefined,
34
35
  ...rest,
@@ -36,7 +37,7 @@ export function KptButton({ variant = 'filled', size = 'md', type = 'button', lo
36
37
  return (_jsx("span", { className: cn('kpt-button-host', fullWidth && 'kpt-button-host--full', hostClassName), ...hostRest, children: renderInner({ asChild, children, buttonProps, content, href, target, rel, type, isDisabled }) }));
37
38
  }
38
39
  /**
39
- * Element wewnętrzny. `asChild` ma pierwszeństwo przed `href` — kto podstawia własny
40
+ * Element wewnętrzny. `asChild` ma pierwszeństwo przed `href` - kto podstawia własny
40
41
  * element, ten decyduje o znaczniku.
41
42
  */
42
43
  function renderInner(args) {
@@ -46,17 +47,17 @@ function renderInner(args) {
46
47
  }
47
48
  if (href !== undefined) {
48
49
  return (_jsx("a", {
49
- // Wyłączony odnośnik traci `href`, a nie tylko dostaje atrybut — inaczej dałoby się go
50
+ // Wyłączony odnośnik traci `href`, a nie tylko dostaje atrybut - inaczej dałoby się go
50
51
  // kliknąć i wejść na niego z klawiatury.
51
52
  href: isDisabled ? undefined : href, target: target,
52
- // `target="_blank"` bez `rel` to wektor na `window.opener` — dokładamy domyślne.
53
- rel: rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined), "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : undefined, ...buttonProps, children: content }));
53
+ // `target="_blank"` bez `rel` to wektor na `window.opener` - dokładamy domyślne.
54
+ rel: rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined), "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : undefined, ...(buttonProps), children: content }));
54
55
  }
55
56
  return (_jsx("button", { type: type, disabled: isDisabled, ...buttonProps, children: content }));
56
57
  }
57
58
  /**
58
59
  * Stan wyłączenia dla podstawionego elementu. Natywny `<button>` dostaje `disabled`
59
- * (SCSS stylizuje `:disabled`); każdy inny element — `aria-disabled`, bo `disabled`
60
+ * (SCSS stylizuje `:disabled`); każdy inny element - `aria-disabled`, bo `disabled`
60
61
  * nie ma tam znaczenia.
61
62
  */
62
63
  function disabledProps(child, isDisabled) {
@@ -1,15 +1,15 @@
1
1
  # KptButton (@konce-pt/react)
2
2
 
3
- The Koncept UI button. It renders a native `<button>` (semantics + form submit) — or an `<a>` when
4
- you pass `href` — inside a `.kpt-button-host` wrapper: two DOM levels, exactly like the Angular port,
3
+ The Koncept UI button. It renders a native `<button>` (semantics + form submit) - or an `<a>` when
4
+ you pass `href` - inside a `.kpt-button-host` wrapper: two DOM levels, exactly like the Angular port,
5
5
  because the host carries its own styles. Import: `import { KptButton } from '@konce-pt/react';`
6
6
 
7
7
  ## DOM
8
8
  <span class="kpt-button-host">
9
9
  <button class="kpt-button" type="button" data-variant="filled" data-size="md">
10
- <span class="kpt-button__icon kpt-icon-host">…</span>
11
- <span class="kpt-button__content">…</span>
12
- <span class="kpt-button__icon kpt-button__icon--end kpt-icon-host">…</span>
10
+ <span class="kpt-button__icon kpt-icon-host">...</span>
11
+ <span class="kpt-button__content">...</span>
12
+ <span class="kpt-button__icon kpt-button__icon--end kpt-icon-host">...</span>
13
13
  </button>
14
14
  </span>
15
15
 
@@ -18,39 +18,39 @@ because the host carries its own styles. Import: `import { KptButton } from '@ko
18
18
  - `size`: 'xs' | 'sm' | 'md' | 'lg' | 'xl' (default 'md')
19
19
  - `type`: 'button' | 'submit' | 'reset' (default 'button')
20
20
  - `disabled`: boolean
21
- - `loading`: boolean — a spinner + blocked interaction, sets `aria-busy`
22
- - `fullWidth`: boolean — the full width of the container
23
- - `icon` / `iconEnd`: string — a name from the icon registry
24
- - `iconClassName` / `iconEndClassName`: string — an extra class on that icon
25
- - `href`, `target`, `rel`: string — render an `<a>` instead of a `<button>`
26
- - `asChild`: boolean — render the single child instead of `<button>`, keeping every class
21
+ - `loading`: boolean - a spinner + blocked interaction, sets `aria-busy`
22
+ - `fullWidth`: boolean - the full width of the container
23
+ - `icon` / `iconEnd`: string - a name from the icon registry
24
+ - `iconClassName` / `iconEndClassName`: string - an extra class on that icon
25
+ - `href`, `target`, `rel`: string - render an `<a>` instead of a `<button>`
26
+ - `asChild`: boolean - render the single child instead of `<button>`, keeping every class
27
27
  - `hostProps`: props for the `.kpt-button-host` wrapper
28
28
  - `className`, `ref` and every other `<button>` prop go to the INNER element
29
29
 
30
30
  ## Events
31
- No events of its own — bind `onClick` and it lands on the native `<button>`.
31
+ No events of its own - bind `onClick` and it lands on the native `<button>`.
32
32
 
33
33
  ## Icons
34
34
  Two ways in, one result. `icon` and `iconEnd` take a name from the icon registry and the component
35
35
  renders it; anything put in `children` is laid out the same way. Both get the gap from
36
- `--kpt-button-gap` and a size that follows `size` (0.875rem at `xs` up to 1.5rem at `xl`) — the
36
+ `--kpt-button-gap` and a size that follows `size` (0.875rem at `xs` up to 1.5rem at `xl`) - the
37
37
  content box is a flex container, so an icon sits on the centre line rather than on the text baseline.
38
38
 
39
39
  `loading` replaces the leading icon with the spinner instead of standing next to it, and the
40
40
  spinner takes that icon's size, so the label does not jump when loading starts. The trailing icon
41
- stays put — it usually marks direction rather than the action.
41
+ stays put - it usually marks direction rather than the action.
42
42
 
43
43
  `iconClassName` / `iconEndClassName` add a class next to the permanent `.kpt-button__icon` hook, for
44
44
  the cases where one instance needs a different colour or a rotation.
45
45
 
46
46
  ## Link and the `link` variant
47
- Two different things. `variant="link"` only changes the looks — underline, transparent background,
47
+ Two different things. `variant="link"` only changes the looks - underline, transparent background,
48
48
  no side padding, so it sits inside a sentence. `href` changes the element: the component renders
49
49
  `<a class="kpt-button">` instead of `<button>`, and the two combine freely (a filled button can be
50
50
  a link, a `link` variant can be a plain button). `asChild` wins over `href`: whoever substitutes
51
51
  their own element decides the tag.
52
52
 
53
- A disabled link loses its `href` rather than just gaining an attribute — otherwise it would stay
53
+ A disabled link loses its `href` rather than just gaining an attribute - otherwise it would stay
54
54
  clickable and reachable with the keyboard; it also gets `aria-disabled="true"` and `tabindex="-1"`.
55
55
  `target="_blank"` without an explicit `rel` gets `rel="noopener noreferrer"`.
56
56
 
@@ -68,9 +68,17 @@ clickable and reachable with the keyboard; it also gets `aria-disabled="true"` a
68
68
  ## asChild
69
69
  The wrapper is still rendered; only the inner element is swapped. The content stays wrapped in
70
70
  `.kpt-button__content`, so the spinner and the layout keep working. A disabled substituted
71
- element gets `disabled` when it is a native `<button>`, and `aria-disabled` otherwise — an
71
+ element gets `disabled` when it is a native `<button>`, and `aria-disabled` otherwise - an
72
72
  element with no `:disabled` state therefore does not get the dimmed look.
73
73
 
74
+ ## Motion
75
+ Pressed, it squeezes slightly and springs back on release (shared mixin `styles/_press.scss`). Entering `loading` pops the spinner in where the leading icon was
76
+ and dims the label. `link` does not squeeze (text in a sentence would jitter): its colour and
77
+ underline change smoothly and it dims while pressed. `elevated` lifts on hover and is pressed down
78
+ (the shadow shrinks smoothly). A pressed button uses its own variant's hover colour - only `filled` has
79
+ a separate pressed colour. Pure CSS; durations follow `--kpt-motion-scale`, so `enabled: false` turns it off, and it drops out
80
+ under "reduce motion".
81
+
74
82
  ## Tokens (styling)
75
83
  `--kpt-button-radius`, `--kpt-button-font-weight`, `--kpt-button-gap`, and one group per variant:
76
84
  `--kpt-button-filled-{bg,fg,bg-hover,bg-active}`, `--kpt-button-elevated-{bg,fg,bg-hover}`,
@@ -80,13 +88,13 @@ element with no `:disabled` state therefore does not get the dimmed look.
80
88
  The elevated variant also reaches for `--kpt-shadow-sm` and `--kpt-shadow-md`.
81
89
 
82
90
  ## The state layer (hover / active)
83
- Hover and active feedback is carried by an `::after` pseudo-element (`opacity` 0 → 1), not by
91
+ Hover and active feedback is carried by an `::after` pseudo-element (`opacity` 0 -> 1), not by
84
92
  animating the button's own `background-color`. The CSS is shared with the Angular port, where
85
93
  the pattern was introduced to stop the variant flicker on first paint; here it simply comes
86
94
  along with the stylesheet.
87
95
 
88
96
  ## Accessibility
89
- - A native `<button>` — full keyboard and screen reader support.
97
+ - A native `<button>` - full keyboard and screen reader support.
90
98
  - `loading` sets `aria-busy="true"` and disables the button.
91
99
  - An `<a>` matches no `:disabled`, so the disabled look keys off `[aria-disabled='true']` as well.
92
100
  - The focus ring comes from `@konce-pt/styles` (`--kpt-color-focus-ring`).