@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,31 +1,31 @@
1
1
  # KptDialog (@konce-pt/react)
2
2
 
3
- A modal window on a native `<dialog>` — the focus trap, Escape and the backdrop come from the
3
+ A modal window on a native `<dialog>` - the focus trap, Escape and the backdrop come from the
4
4
  platform, not from our code. Import: `import { KptDialog } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
7
  <dialog class="kpt-dialog">
8
8
  <div class="kpt-dialog__header">
9
9
  <h2 class="kpt-dialog__title">Delete record?</h2>
10
- <button class="kpt-dialog__close" type="button" aria-label="Close">…</button>
10
+ <button class="kpt-dialog__close" type="button" aria-label="Close">...</button>
11
11
  </div>
12
- <div class="kpt-dialog__body">…children…</div>
13
- <div kptdialogfooter="">…footer…</div>
12
+ <div class="kpt-dialog__body">...children...</div>
13
+ <div kptdialogfooter="">...footer...</div>
14
14
  </dialog>
15
15
 
16
16
  ## Props
17
- - `open`: boolean, `onOpenChange(open)` — the dialog is always controlled; the browser can close it
17
+ - `open`: boolean, `onOpenChange(open)` - the dialog is always controlled; the browser can close it
18
18
  on its own (Escape, the `close` event), and the state has to follow
19
- - `header`: string — the title; with no header there is no header row and no × button
20
- - `dismissible`: boolean (default true) — allows Escape and shows ×
19
+ - `header`: string - the title; with no header there is no header row and no x button
20
+ - `dismissible`: boolean (default true) - allows Escape and shows x
21
21
  - `className`, `ref` and every other `<dialog>` prop go to the dialog
22
22
 
23
23
  ## Sub-components
24
- - `KptDialog.Footer` — lifted below the body; carries the `kptdialogfooter` attribute the shared
24
+ - `KptDialog.Footer` - lifted below the body; carries the `kptdialogfooter` attribute the shared
25
25
  SCSS targets.
26
26
 
27
27
  ## An overlay inside a modal
28
- `showModal()` lifts the dialog into the browser's TOP LAYER, which sits above the whole document —
28
+ `showModal()` lifts the dialog into the browser's TOP LAYER, which sits above the whole document -
29
29
  no `z-index` beats it. A `KptSelect` or `KptMenu` panel portalled to `document.body` would open
30
30
  INVISIBLE, hidden behind the modal backdrop. While it is open, `KptDialog` therefore makes itself
31
31
  the overlay container (through `KptOverlayContainerContext`), so those panels portal INSIDE the
@@ -47,7 +47,10 @@ dialog; the mechanism differs, the result does not.
47
47
 
48
48
  ## Accessibility
49
49
  A native `<dialog>` opened with `showModal()`: focus moves inside and is trapped, the rest of the
50
- page becomes inert, and Escape closes it — all from the browser. With `dismissible={false}` the
50
+ page becomes inert, and Escape closes it - all from the browser. With `dismissible={false}` the
51
51
  `cancel` event is prevented, so Escape stops working; give the user another way out.
52
52
  With `header` the dialog is named by its title (`aria-labelledby`); without one pass `aria-label`.
53
53
  `role="alertdialog"` and `aria-describedby` go straight through as `<dialog>` props.
54
+
55
+ ## Scrolling and non-dismissible windows
56
+ An open window locks page scrolling underneath (a shared counter with drawers and bottom sheets, so nested windows do not release each other). With `dismissible` off the window gets `closedby="none"`, and if a browser still closes it on a gesture (Chromium lets the second Escape in a row through `cancel`), it is reopened - only code can close it.
@@ -4,6 +4,11 @@ export interface KptDividerProps extends Omit<ComponentPropsWithRef<'div'>, 'chi
4
4
  orientation?: KptDividerOrientation;
5
5
  /** Wcięcie (odstęp od krawędzi kontenera). */
6
6
  inset?: boolean;
7
+ /**
8
+ * Linia czysto ozdobna (np. między kartami, które i tak są osobnymi regionami) - bez
9
+ * `role="separator"`, ukryta przed czytnikiem. Domyślnie separator jest ogłaszany.
10
+ */
11
+ decorative?: boolean;
7
12
  }
8
13
  /**
9
14
  * Separator (linia pozioma lub pionowa). Kolor z `--kpt-color-border`.
@@ -12,5 +17,6 @@ export interface KptDividerProps extends Omit<ComponentPropsWithRef<'div'>, 'chi
12
17
  * <KptDivider />
13
18
  * <KptDivider orientation="vertical" />
14
19
  * <KptDivider inset />
20
+ * <KptDivider decorative />
15
21
  */
16
- export declare function KptDivider({ orientation, inset, className, ...rest }: Readonly<KptDividerProps>): import("react").JSX.Element;
22
+ export declare function KptDivider({ orientation, inset, decorative, className, ...rest }: Readonly<KptDividerProps>): import("react").JSX.Element;
@@ -7,7 +7,8 @@ import { cn } from "../internal/cn.js";
7
7
  * <KptDivider />
8
8
  * <KptDivider orientation="vertical" />
9
9
  * <KptDivider inset />
10
+ * <KptDivider decorative />
10
11
  */
11
- export function KptDivider({ orientation = 'horizontal', inset = false, className, ...rest }) {
12
- return (_jsx("div", { className: cn('kpt-divider', inset && 'kpt-divider--inset', className), role: "separator", "aria-orientation": orientation, "data-orientation": orientation, ...rest }));
12
+ export function KptDivider({ orientation = 'horizontal', inset = false, decorative = false, className, ...rest }) {
13
+ return (_jsx("div", { className: cn('kpt-divider', inset && 'kpt-divider--inset', className), role: decorative ? 'none' : 'separator', "aria-orientation": decorative ? undefined : orientation, "aria-hidden": decorative || undefined, "data-orientation": orientation, ...rest }));
13
14
  }
@@ -1,6 +1,6 @@
1
1
  # KptDivider (@konce-pt/react)
2
2
 
3
- A separator — a horizontal or vertical line. Colour from `--kpt-color-border`.
3
+ A separator - a horizontal or vertical line. Colour from `--kpt-color-border`.
4
4
  Import: `import { KptDivider } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
@@ -8,12 +8,13 @@ Import: `import { KptDivider } from '@konce-pt/react';`
8
8
 
9
9
  ## Props
10
10
  - `orientation`: 'horizontal' | 'vertical' (default 'horizontal')
11
- - `inset`: boolean — an indent from the container edges
11
+ - `inset`: boolean - an indent from the container edges
12
+ - `decorative`: boolean - a purely ornamental line: no `role="separator"`, hidden from screen readers
12
13
  - `className`, `ref` and every other `<div>` prop go to the divider
13
14
 
14
15
  ## Vertical needs a flex parent
15
16
  The vertical variant stretches to the height of its container, so it only makes sense inside a
16
- flex row — on its own it has nothing to measure against and collapses to nothing.
17
+ flex row - on its own it has nothing to measure against and collapses to nothing.
17
18
 
18
19
  ## Examples
19
20
  <KptDivider />
@@ -6,7 +6,12 @@ export interface KptDrawerProps extends Omit<ComponentPropsWithRef<'div'>, 'onCh
6
6
  onOpenChange: (open: boolean) => void;
7
7
  position?: KptDrawerPosition;
8
8
  header?: string;
9
- /** Pokazuje przycisk × i pozwala zamknąć klawiszem Escape. */
9
+ /**
10
+ * Nazwa panelu bez `header` - okno dialogowe bez nazwy czytnik ogłasza jako samo "okno
11
+ * dialogowe" (WCAG 4.1.2). Z nagłówkiem nazwą jest nagłówek (`aria-labelledby`).
12
+ */
13
+ ariaLabel?: string;
14
+ /** Pokazuje przycisk x i pozwala zamknąć klawiszem Escape. */
10
15
  dismissible?: boolean;
11
16
  closeOnBackdrop?: boolean;
12
17
  children?: ReactNode;
@@ -14,12 +19,12 @@ export interface KptDrawerProps extends Omit<ComponentPropsWithRef<'div'>, 'onCh
14
19
  /**
15
20
  * Panel wysuwany (drawer / off-canvas), niezależny od app-shell.
16
21
  *
17
- * Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` — dzięki temu
22
+ * Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` - dzięki temu
18
23
  * wysunięcie i schowanie da się animować, tak samo jak w porcie Angulara.
19
24
  *
20
25
  * @example
21
26
  * <KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filtry">
22
- * Treść panelu…
27
+ * Treść panelu...
23
28
  * </KptDrawer>
24
29
  */
25
- export declare function KptDrawer({ open, onOpenChange, position, header, dismissible, closeOnBackdrop, locale, dictionary, className, children, ...rest }: Readonly<KptDrawerProps>): import("react").JSX.Element;
30
+ export declare function KptDrawer({ open, onOpenChange, position, header, ariaLabel, dismissible, closeOnBackdrop, locale, dictionary, className, children, ...rest }: Readonly<KptDrawerProps>): 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 { useCallback, useRef } from 'react';
3
4
  import { cn } from "../internal/cn.js";
@@ -8,15 +9,15 @@ import { KptIcon } from "../icon/icon.js";
8
9
  /**
9
10
  * Panel wysuwany (drawer / off-canvas), niezależny od app-shell.
10
11
  *
11
- * Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` — dzięki temu
12
+ * Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` - dzięki temu
12
13
  * wysunięcie i schowanie da się animować, tak samo jak w porcie Angulara.
13
14
  *
14
15
  * @example
15
16
  * <KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filtry">
16
- * Treść panelu…
17
+ * Treść panelu...
17
18
  * </KptDrawer>
18
19
  */
19
- export function KptDrawer({ open, onOpenChange, position = 'left', header = '', dismissible = true, closeOnBackdrop = true, locale, dictionary, className, children, ...rest }) {
20
+ export function KptDrawer({ open, onOpenChange, position = 'left', header = '', ariaLabel = '', dismissible = true, closeOnBackdrop = true, locale, dictionary, className, children, ...rest }) {
20
21
  const { t } = useKptMessages({ locale, dictionary });
21
22
  const close = useCallback(() => onOpenChange(false), [onOpenChange]);
22
23
  const panelRef = useRef(null);
@@ -26,5 +27,5 @@ export function KptDrawer({ open, onOpenChange, position = 'left', header = '',
26
27
  if (event.key === 'Escape' && dismissible)
27
28
  close();
28
29
  };
29
- return (_jsxs("div", { className: cn('kpt-drawer-host', className), ...rest, children: [_jsx("div", { className: cn('kpt-drawer__backdrop', open && 'is-open'), onClick: () => closeOnBackdrop && close() }), _jsxs("aside", { ref: panelRef, className: cn('kpt-drawer__panel', open && 'is-open'), "data-position": position, role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, tabIndex: -1, onKeyDown: onKeyDown, children: [header || dismissible ? (_jsxs("div", { className: "kpt-drawer__header", children: [_jsx("span", { className: "kpt-drawer__title", id: titleId, children: header }), dismissible ? (_jsx("button", { type: "button", className: "kpt-drawer__close", onClick: close, "aria-label": t('common.close'), children: _jsx(KptIcon, { name: "x" }) })) : null] })) : null, _jsx("div", { className: "kpt-drawer__body", children: children })] })] }));
30
+ return (_jsxs("div", { className: cn('kpt-drawer-host', className), ...rest, children: [_jsx("div", { className: cn('kpt-drawer__backdrop', open && 'is-open'), onClick: () => closeOnBackdrop && close() }), _jsxs("aside", { ref: panelRef, className: cn('kpt-drawer__panel', open && 'is-open'), "data-position": position, role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, "aria-label": header ? undefined : ariaLabel || undefined, tabIndex: -1, onKeyDown: onKeyDown, children: [header || dismissible ? (_jsxs("div", { className: "kpt-drawer__header", children: [_jsx("span", { className: "kpt-drawer__title", id: titleId, children: header }), dismissible ? (_jsx("button", { type: "button", className: "kpt-drawer__close", onClick: close, "aria-label": t('common.close'), children: _jsx(KptIcon, { name: "x" }) })) : null] })) : null, _jsx("div", { className: "kpt-drawer__body", children: children })] })] }));
30
31
  }
@@ -9,38 +9,38 @@ Import: `import { KptDrawer } from '@konce-pt/react';`
9
9
  <aside class="kpt-drawer__panel is-open" data-position="right" role="dialog" aria-modal="true" tabindex="-1">
10
10
  <div class="kpt-drawer__header">
11
11
  <span class="kpt-drawer__title">Filters</span>
12
- <button class="kpt-drawer__close" type="button" aria-label="Close">…</button>
12
+ <button class="kpt-drawer__close" type="button" aria-label="Close">...</button>
13
13
  </div>
14
- <div class="kpt-drawer__body">…children…</div>
14
+ <div class="kpt-drawer__body">...children...</div>
15
15
  </aside>
16
16
  </div>
17
17
 
18
18
  ## Props
19
- - `open`: boolean, `onOpenChange(open)` — controlled
19
+ - `open`: boolean, `onOpenChange(open)` - controlled
20
20
  - `position`: 'left' | 'right' | 'top' | 'bottom' (default 'left')
21
21
  - `header`: string
22
- - `dismissible`: boolean (default true) — shows × and lets Escape close it
22
+ - `dismissible`: boolean (default true) - shows x and lets Escape close it
23
23
  - `closeOnBackdrop`: boolean (default true)
24
24
  - `className`, `ref` and every other `<div>` prop go to the host
25
25
 
26
26
  ## Always in the DOM
27
27
  The panel and the backdrop are always rendered; only the `is-open` class decides what is visible.
28
- That is what makes the slide animatable — mounting the panel on open would give the transition
28
+ That is what makes the slide animatable - mounting the panel on open would give the transition
29
29
  nothing to animate from.
30
30
 
31
31
  ## Not a native modal
32
32
  Unlike `KptDialog` this is a plain `<aside role="dialog" aria-modal="true">`, not a native
33
- `<dialog>` — the focus handling below is done by the component, not by the browser.
33
+ `<dialog>` - the focus handling below is done by the component, not by the browser.
34
34
 
35
35
  ## Focus and keyboard
36
36
  Opening moves focus into the panel (its first focusable element, else the panel
37
- itself) and traps it there — `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises.
38
- Closing returns focus to the element that had it before. `Escape` closes the panel — only when `dismissible`, like the `×` button. The panel
37
+ itself) and traps it there - `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises.
38
+ Closing returns focus to the element that had it before. `Escape` closes the panel - only when `dismissible`, like the `x` button. The panel
39
39
  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).
40
40
 
41
41
  ## Examples
42
42
  <KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filters">
43
- Panel content…
43
+ Panel content...
44
44
  </KptDrawer>
45
45
 
46
46
  ## Tokens
@@ -49,4 +49,7 @@ is named by its `header` through `aria-labelledby`. The shared helper is `intern
49
49
 
50
50
  ## Accessibility
51
51
  `role="dialog"`, `aria-modal="true"` and `aria-labelledby` pointing at the title; the close button gets
52
- its label from `common.close`. Focus handling — see "Focus and keyboard" above.
52
+ its label from `common.close`. Focus handling - see "Focus and keyboard" above.
53
+
54
+ ## Name and scrolling
55
+ Without `header` give the panel `ariaLabel` - a `role="dialog"` without a name is announced as a bare "dialog". An open drawer locks page scrolling underneath.
@@ -6,14 +6,14 @@ export interface KptEmptyProps extends Omit<ComponentPropsWithRef<'div'>, 'title
6
6
  description?: string;
7
7
  /**
8
8
  * Robi z tytułu nagłówek strony (`role="heading"` z `aria-level`), żeby pusty stan pojawił się
9
- * w strukturze dokumentu — np. gdy zastępuje całą sekcję. Bez tego tytuł to sam tekst.
9
+ * w strukturze dokumentu - np. gdy zastępuje całą sekcję. Bez tego tytuł to sam tekst.
10
10
  */
11
11
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
12
12
  /** Akcje pod opisem. */
13
13
  children?: ReactNode;
14
14
  }
15
15
  /**
16
- * Stan pusty (empty state) — ikona, tytuł, opis i opcjonalne akcje.
16
+ * Stan pusty (empty state) - ikona, tytuł, opis i opcjonalne akcje.
17
17
  *
18
18
  * @example
19
19
  * <KptEmpty icon="search" title="Brak wyników" description="Zmień kryteria wyszukiwania.">
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../internal/cn.js";
3
3
  import { KptIcon } from "../icon/icon.js";
4
4
  /**
5
- * Stan pusty (empty state) — ikona, tytuł, opis i opcjonalne akcje.
5
+ * Stan pusty (empty state) - ikona, tytuł, opis i opcjonalne akcje.
6
6
  *
7
7
  * @example
8
8
  * <KptEmpty icon="search" title="Brak wyników" description="Zmień kryteria wyszukiwania.">
@@ -1,23 +1,23 @@
1
1
  # KptEmpty (@konce-pt/react)
2
2
 
3
- An empty state — an icon, a title, a description and optional actions.
3
+ An empty state - an icon, a title, a description and optional actions.
4
4
  Import: `import { KptEmpty } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
7
  <div class="kpt-empty-host">
8
8
  <div class="kpt-empty">
9
- <div class="kpt-empty__icon">…icon…</div>
9
+ <div class="kpt-empty__icon">...icon...</div>
10
10
  <p class="kpt-empty__title">No results</p>
11
11
  <p class="kpt-empty__desc">Adjust your search criteria.</p>
12
- <div class="kpt-empty__actions">…children…</div>
12
+ <div class="kpt-empty__actions">...children...</div>
13
13
  </div>
14
14
  </div>
15
15
 
16
16
  ## Props
17
- - `icon`: string | null (default 'info-circle') — a registry icon name; `null` hides it
18
- - `title`: string, `description`: string — each row disappears when its text is empty
19
- - `headingLevel`: 1–6 | null (default null) — makes the title a heading (`role="heading"` + `aria-level`)
20
- - `children` — the actions under the description
17
+ - `icon`: string | null (default 'info-circle') - a registry icon name; `null` hides it
18
+ - `title`: string, `description`: string - each row disappears when its text is empty
19
+ - `headingLevel`: 1-6 | null (default null) - makes the title a heading (`role="heading"` + `aria-level`)
20
+ - `children` - the actions under the description
21
21
  - `className`, `ref` and every other `<div>` prop go to the host
22
22
 
23
23
  ## Examples
@@ -31,6 +31,6 @@ Import: `import { KptEmpty } from '@konce-pt/react';`
31
31
  `--kpt-color-on-surface-muted` (the description), `--kpt-space-*`.
32
32
 
33
33
  ## Accessibility
34
- The icon is decorative. The title is a styled paragraph unless `headingLevel` makes it a heading —
34
+ The icon is decorative. The title is a styled paragraph unless `headingLevel` makes it a heading -
35
35
  use that when the empty state stands in for a whole section. Replacing results with an empty state
36
- is not announced; report “0 results” in a live region of your own.
36
+ is not announced; report "0 results" in a live region of your own.
package/dist/fab/fab.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface KptFabProps extends ComponentPropsWithRef<'button'> {
9
9
  hostProps?: KptHostProps<'span'>;
10
10
  }
11
11
  /**
12
- * Floating Action Button — okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
12
+ * Floating Action Button - okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
13
13
  * z tekstem.
14
14
  *
15
15
  * W wariancie okrągłym `aria-label` jest niezbędny, bo przycisk nie ma tekstu; w `extended`
package/dist/fab/fab.js CHANGED
@@ -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
- * Floating Action Button — okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
4
+ * Floating Action Button - okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
5
5
  * z tekstem.
6
6
  *
7
7
  * W wariancie okrągłym `aria-label` jest niezbędny, bo przycisk nie ma tekstu; w `extended`
package/dist/fab/llms.txt CHANGED
@@ -1,27 +1,27 @@
1
1
  # KptFab (@konce-pt/react)
2
2
 
3
- A floating action button — round and raised. `extended` turns it into a pill with text.
3
+ A floating action button - round and raised. `extended` turns it into a pill with text.
4
4
  Import: `import { KptFab } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
7
  <span class="kpt-fab-host">
8
- <button class="kpt-fab" type="button" data-variant="filled" data-size="md" aria-label="Add">…icon…</button>
8
+ <button class="kpt-fab" type="button" data-variant="filled" data-size="md" aria-label="Add">...icon...</button>
9
9
  </span>
10
10
 
11
11
  ## Props
12
12
  - `variant`: 'filled' | 'tonal' (default 'filled')
13
13
  - `size`: 'md' | 'mini' (default 'md')
14
- - `extended`: boolean — a pill with text next to the icon
15
- - `hostProps` — props for the `.kpt-fab-host` wrapper
14
+ - `extended`: boolean - a pill with text next to the icon
15
+ - `hostProps` - props for the `.kpt-fab-host` wrapper
16
16
  - `className`, `ref` and every other `<button>` prop go to the inner `<button>`
17
17
 
18
18
  ## The label depends on the variant
19
- In the round variant `aria-label` is essential — the button has no text. In `extended` the content
19
+ In the round variant `aria-label` is essential - the button has no text. In `extended` the content
20
20
  already is the label, so `aria-label` is dropped there rather than passed through: two names on one
21
21
  control make a screen reader announce the wrong one.
22
22
 
23
23
  ## Placement is yours
24
- The component does not position itself. It is a button, not a layout — put it in a container that
24
+ The component does not position itself. It is a button, not a layout - put it in a container that
25
25
  pins it wherever the design wants (usually `position: fixed` in a corner).
26
26
 
27
27
  ## Examples
@@ -29,6 +29,10 @@ pins it wherever the design wants (usually `position: fixed` in a corner).
29
29
  <KptFab extended><KptIcon name="plus" /> New</KptFab>
30
30
  <KptFab variant="tonal" size="mini" aria-label="Edit"><KptIcon name="copy" /></KptFab>
31
31
 
32
+ ## Motion
33
+ Pressed, it squeezes slightly and springs back on release (shared mixin `styles/_press.scss`). Pure CSS; durations follow `--kpt-motion-scale`, so `enabled: false` turns it off, and it drops out
34
+ under "reduce motion".
35
+
32
36
  ## Tokens
33
37
  `--kpt-color-primary` / `--kpt-color-on-primary` (filled), `--kpt-color-muted` /
34
38
  `--kpt-color-on-muted` (tonal), `--kpt-elevation-3` (`--kpt-elevation-4` on hover); shape
@@ -1,6 +1,13 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { type KptCollapseMotion } from '@konce-pt/motion';
3
+ export type KptFieldsetVariant = 'outlined' | 'filled';
2
4
  export interface KptFieldsetProps extends ComponentPropsWithRef<'div'> {
3
5
  legend?: string;
6
+ /**
7
+ * `outlined` (domyślny) - sama ramka na tle rodzica; `filled` - grupa na kolorze powierzchni,
8
+ * np. sekcje w szarym panelu. Legenda w obu bierze tło grupy, więc nie dzieli się na dwa kolory.
9
+ */
10
+ variant?: KptFieldsetVariant;
4
11
  /** Legenda staje się przyciskiem zwijającym zawartość. */
5
12
  toggleable?: boolean;
6
13
  collapsed?: boolean;
@@ -8,15 +15,22 @@ export interface KptFieldsetProps extends ComponentPropsWithRef<'div'> {
8
15
  onCollapsedChange?: (collapsed: boolean) => void;
9
16
  animated?: boolean;
10
17
  animationDuration?: number;
18
+ /**
19
+ * Ruch zwijania: `spring` - wysokość na sprężynie, treść wjeżdża i wyostrza się, przy zwijaniu
20
+ * najpierw gaśnie; `fade` - treść się przenika; `none` - bez ruchu. Bez wartości bierze `collapse`
21
+ * z `KptMotionProvider` (domyślnie `spring`); `animated={false}`, `enabled={false}` i systemowe
22
+ * "ogranicz ruch" wyłączają go zawsze.
23
+ */
24
+ collapseMotion?: KptCollapseMotion;
11
25
  children?: ReactNode;
12
26
  }
13
27
  /**
14
28
  * Grupa pól z legendą (`<fieldset>` + `<legend>`), opcjonalnie zwijana.
15
29
  *
16
- * Zwijanie idzie przez `grid-template-rows: 0fr → 1fr`, więc animuje się do naturalnej wysokości
17
- * treści — bez mierzenia czegokolwiek w JS.
30
+ * Zwijanie idzie przez `grid-template-rows: 0fr -> 1fr`, więc animuje się do naturalnej wysokości
31
+ * treści - bez mierzenia czegokolwiek w JS.
18
32
  *
19
33
  * @example
20
- * <KptFieldset legend="Dane osobowe" toggleable>…</KptFieldset>
34
+ * <KptFieldset legend="Dane osobowe" toggleable>...</KptFieldset>
21
35
  */
22
- export declare function KptFieldset({ legend, toggleable, collapsed, defaultCollapsed, onCollapsedChange, animated, animationDuration, className, style, children, ...rest }: Readonly<KptFieldsetProps>): import("react").JSX.Element;
36
+ export declare function KptFieldset({ legend, variant, toggleable, collapsed, defaultCollapsed, onCollapsedChange, animated, animationDuration, collapseMotion, className, style, children, ...rest }: Readonly<KptFieldsetProps>): import("react").JSX.Element;
@@ -1,24 +1,30 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cn } from "../internal/cn.js";
3
4
  import { useControllableState } from "../internal/use-controllable-state.js";
5
+ import { useKptId } from "../internal/use-id.js";
4
6
  import { KptIcon } from "../icon/icon.js";
7
+ import { resolveCollapseMotion } from '@konce-pt/motion';
8
+ import { useKptMotion } from "../motion/motion-context.js";
5
9
  /**
6
10
  * Grupa pól z legendą (`<fieldset>` + `<legend>`), opcjonalnie zwijana.
7
11
  *
8
- * Zwijanie idzie przez `grid-template-rows: 0fr → 1fr`, więc animuje się do naturalnej wysokości
9
- * treści — bez mierzenia czegokolwiek w JS.
12
+ * Zwijanie idzie przez `grid-template-rows: 0fr -> 1fr`, więc animuje się do naturalnej wysokości
13
+ * treści - bez mierzenia czegokolwiek w JS.
10
14
  *
11
15
  * @example
12
- * <KptFieldset legend="Dane osobowe" toggleable>…</KptFieldset>
16
+ * <KptFieldset legend="Dane osobowe" toggleable>...</KptFieldset>
13
17
  */
14
- export function KptFieldset({ legend = '', toggleable = false, collapsed, defaultCollapsed = false, onCollapsedChange, animated = true, animationDuration = 500, className, style, children, ...rest }) {
18
+ export function KptFieldset({ legend = '', variant = 'outlined', toggleable = false, collapsed, defaultCollapsed = false, onCollapsedChange, animated = true, animationDuration = 500, collapseMotion, className, style, children, ...rest }) {
19
+ const bodyId = useKptId(undefined, 'kpt-fieldset-body');
20
+ const motion = resolveCollapseMotion(collapseMotion, useKptMotion(), animated);
15
21
  const [isCollapsed, setCollapsed] = useControllableState({
16
22
  value: collapsed,
17
23
  defaultValue: defaultCollapsed,
18
24
  onChange: onCollapsedChange,
19
25
  });
20
- return (_jsx("div", { className: cn('kpt-fieldset-host', className), style: {
26
+ return (_jsx("div", { className: cn('kpt-fieldset-host', className), "data-variant": variant, style: {
21
27
  ['--kpt-anim-duration']: `${animated ? animationDuration : 0}ms`,
22
28
  ...style,
23
- }, ...rest, children: _jsxs("fieldset", { className: "kpt-fieldset", children: [_jsx("legend", { className: "kpt-fieldset__legend", children: toggleable ? (_jsxs("button", { type: "button", className: "kpt-fieldset__toggle", "aria-expanded": !isCollapsed, onClick: () => setCollapsed(!isCollapsed), children: [_jsx(KptIcon, { name: isCollapsed ? 'chevron-down' : 'chevron-up' }), _jsx("span", { children: legend })] })) : (_jsx("span", { children: legend })) }), _jsx("div", { className: cn('kpt-fieldset__collapse', !isCollapsed && 'is-open'), inert: isCollapsed, "aria-hidden": isCollapsed, children: _jsx("div", { className: "kpt-fieldset__collapse-inner", children: _jsx("div", { className: "kpt-fieldset__body", children: children }) }) })] }) }));
29
+ }, ...rest, children: _jsxs("fieldset", { className: "kpt-fieldset", "data-motion": motion, children: [_jsx("legend", { className: "kpt-fieldset__legend", children: toggleable ? (_jsxs("button", { type: "button", className: "kpt-fieldset__toggle", "aria-expanded": !isCollapsed, "aria-controls": bodyId, onClick: () => setCollapsed(!isCollapsed), children: [_jsx(KptIcon, { name: "chevron-down", className: cn('kpt-fieldset__chevron', !isCollapsed && 'is-open') }), _jsx("span", { children: legend })] })) : (_jsx("span", { children: legend })) }), _jsx("div", { id: bodyId, className: cn('kpt-fieldset__collapse', !isCollapsed && 'is-open'), inert: isCollapsed, children: _jsx("div", { className: "kpt-fieldset__collapse-inner", children: _jsx("div", { className: "kpt-fieldset__body", children: children }) }) })] }) }));
24
30
  }
@@ -4,27 +4,31 @@ A group of fields with a legend, optionally collapsible.
4
4
  Import: `import { KptFieldset } from '@konce-pt/react';`
5
5
 
6
6
  ## DOM
7
- <div class="kpt-fieldset-host" style="--kpt-anim-duration:500ms">
7
+ <div class="kpt-fieldset-host" data-variant="outlined" style="--kpt-anim-duration:500ms">
8
8
  <fieldset class="kpt-fieldset">
9
9
  <legend class="kpt-fieldset__legend">
10
- <button class="kpt-fieldset__toggle" aria-expanded="true">…<span>Personal data</span></button>
10
+ <button class="kpt-fieldset__toggle" aria-expanded="true">...<span>Personal data</span></button>
11
11
  </legend>
12
12
  <div class="kpt-fieldset__collapse is-open">
13
- <div class="kpt-fieldset__collapse-inner"><div class="kpt-fieldset__body">…</div></div>
13
+ <div class="kpt-fieldset__collapse-inner"><div class="kpt-fieldset__body">...</div></div>
14
14
  </div>
15
15
  </fieldset>
16
16
  </div>
17
17
 
18
18
  ## Props
19
19
  - `legend`: string
20
- - `toggleable`: boolean — turns the legend into a collapse button
20
+ - `variant`: `'outlined'` (default, a frame on the parent's background) | `'filled'` (the group on
21
+ `--kpt-color-surface`, e.g. sections inside a grey panel); the legend takes the group's background
22
+ with rounded ends in both, so it never splits into two colours
23
+ - `toggleable`: boolean - turns the legend into a collapse button
21
24
  - `collapsed` / `defaultCollapsed` / `onCollapsedChange`
22
25
  - `animated`: boolean (default true), `animationDuration`: ms (default 500)
26
+ - `collapseMotion`: `'spring' | 'fade' | 'none'` (default from `KptMotionProvider`, else `spring`) - see "Collapse motion"
23
27
  - `className`, `ref` and every other `<div>` prop go to the host
24
28
 
25
29
  ## Collapsing without measuring
26
- The transition runs on `grid-template-rows: 0fr → 1fr`, so it animates to the content's natural
27
- height with no JS measurement and no height cached at mount — content that grows later still
30
+ The transition runs on `grid-template-rows: 0fr -> 1fr`, so it animates to the content's natural
31
+ height with no JS measurement and no height cached at mount - content that grows later still
28
32
  collapses correctly.
29
33
 
30
34
  ## The real fieldset stays
@@ -32,11 +36,24 @@ The markup is a native `<fieldset>` + `<legend>`, so the grouping is real for as
32
36
  the collapse only wraps the body, never the legend.
33
37
 
34
38
  ## Examples
35
- <KptFieldset legend="Personal data" toggleable>…</KptFieldset>
36
- <KptFieldset legend="Advanced" toggleable collapsed={closed} onCollapsedChange={setClosed}>…</KptFieldset>
39
+ <KptFieldset legend="Personal data" toggleable>...</KptFieldset>
40
+ <KptFieldset legend="Scrolling" variant="filled">...</KptFieldset>
41
+ <KptFieldset legend="Advanced" toggleable collapsed={closed} onCollapsedChange={setClosed}>...</KptFieldset>
42
+
43
+ ## Collapse motion
44
+ - `spring` - the height opens on a soft spring, the content slides in from above and sharpens out
45
+ of a blur; when collapsing, the content fades first and only then the section closes. The chevron
46
+ turns on a spring.
47
+ - `fade` - the height on the standard curve, the content cross-fades.
48
+ - `none` - the state changes without motion.
49
+
50
+ With no value it takes `collapse` from `KptMotionProvider` (default `spring`). `animated={false}`, `enabled: false`
51
+ in the config and the system "reduce motion" setting always turn it off. `animationDuration` sets
52
+ the time of every kind. Pure CSS: the kind sits in `data-motion` on the component root.
37
53
 
38
54
  ## Tokens
39
- Border `--kpt-color-border`, radius `--kpt-radius-md`, padding `--kpt-space-4`.
55
+ Border `--kpt-color-border`, radius `--kpt-radius-md`, padding `--kpt-space-4`; `filled` background
56
+ `--kpt-color-surface`, legend corners `--kpt-radius-full`.
40
57
 
41
58
  ## Accessibility
42
59
  The toggle carries `aria-expanded`; the collapsed body gets `inert` and `aria-hidden`, so it is
@@ -8,6 +8,12 @@ export interface KptFileUploadProps extends Omit<ComponentPropsWithRef<'div'>, '
8
8
  accept?: string;
9
9
  multiple?: boolean;
10
10
  disabled?: boolean;
11
+ /** Tylko do odczytu - listę plików widać, nie da się jej zmienić. */
12
+ readOnly?: boolean;
13
+ /** Id strefy; bez niego generowane, w `KptFormField` - z wrappera. */
14
+ id?: string;
15
+ /** Nazwa dostępna, gdy strefy nie opisuje etykieta (`KptFormField`). */
16
+ ariaLabel?: string | null;
11
17
  invalid?: boolean;
12
18
  touched?: boolean;
13
19
  onTouch?: () => void;
@@ -17,11 +23,11 @@ export interface KptFileUploadProps extends Omit<ComponentPropsWithRef<'div'>, '
17
23
  * Wartością jest tablica `File`.
18
24
  *
19
25
  * Strefa to `role="button"` z jednym przystankiem Tab: `Enter` i spacja otwierają okno wyboru,
20
- * tak jak kliknięcie — natywne pole pliku jest ukryte, więc bez tego klawiatura nie miałaby
26
+ * tak jak kliknięcie - natywne pole pliku jest ukryte, więc bez tego klawiatura nie miałaby
21
27
  * jak wybrać pliku. `disabled` wyjmuje strefę z kolejności Tab. Stan błędu: `invalid`
22
28
  * i `touched` (pominięty `touched` = błąd widać od razu, jak w `KptInput`).
23
29
  *
24
30
  * @example
25
31
  * <KptFileUpload value={files} onValueChange={setFiles} accept="image/*" multiple />
26
32
  */
27
- export declare function KptFileUpload({ value, defaultValue, onValueChange, accept, multiple, disabled, invalid, touched, onTouch, locale, dictionary, className, ...rest }: Readonly<KptFileUploadProps>): import("react").JSX.Element;
33
+ export declare function KptFileUpload({ value, defaultValue, onValueChange, accept, multiple, disabled, readOnly, id, ariaLabel, invalid, touched, onTouch, locale, dictionary, className, ...rest }: Readonly<KptFileUploadProps>): import("react").JSX.Element;