@kjun-ui/react 0.21.0 → 0.23.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 (297) hide show
  1. package/README.md +19 -5
  2. package/dist/index.cjs +8795 -3753
  3. package/dist/index.js +9349 -4284
  4. package/dist/styles.css +2736 -480
  5. package/dist/types/packages/react/src/actions.d.cts +21 -16
  6. package/dist/types/packages/react/src/actions.d.ts +21 -16
  7. package/dist/types/packages/react/src/app-navigation.d.cts +14 -4
  8. package/dist/types/packages/react/src/app-navigation.d.ts +14 -4
  9. package/dist/types/packages/react/src/avatar-group.d.cts +36 -0
  10. package/dist/types/packages/react/src/avatar-group.d.ts +36 -0
  11. package/dist/types/packages/react/src/button.d.cts +15 -6
  12. package/dist/types/packages/react/src/button.d.ts +15 -6
  13. package/dist/types/packages/react/src/calendar.d.cts +6 -2
  14. package/dist/types/packages/react/src/calendar.d.ts +6 -2
  15. package/dist/types/packages/react/src/card.d.cts +10 -3
  16. package/dist/types/packages/react/src/card.d.ts +10 -3
  17. package/dist/types/packages/react/src/carousel.d.cts +8 -1
  18. package/dist/types/packages/react/src/carousel.d.ts +8 -1
  19. package/dist/types/packages/react/src/choice-controls.d.cts +99 -0
  20. package/dist/types/packages/react/src/choice-controls.d.ts +99 -0
  21. package/dist/types/packages/react/src/collapse.d.cts +4 -1
  22. package/dist/types/packages/react/src/collapse.d.ts +4 -1
  23. package/dist/types/packages/react/src/color-picker.d.cts +8 -1
  24. package/dist/types/packages/react/src/color-picker.d.ts +8 -1
  25. package/dist/types/packages/react/src/combobox.d.cts +18 -5
  26. package/dist/types/packages/react/src/combobox.d.ts +18 -5
  27. package/dist/types/packages/react/src/controls.d.cts +7 -74
  28. package/dist/types/packages/react/src/controls.d.ts +7 -74
  29. package/dist/types/packages/react/src/data-state.d.cts +19 -6
  30. package/dist/types/packages/react/src/data-state.d.ts +19 -6
  31. package/dist/types/packages/react/src/date-picker.d.cts +8 -2
  32. package/dist/types/packages/react/src/date-picker.d.ts +8 -2
  33. package/dist/types/packages/react/src/display.d.cts +33 -8
  34. package/dist/types/packages/react/src/display.d.ts +33 -8
  35. package/dist/types/packages/react/src/drawer.d.cts +11 -2
  36. package/dist/types/packages/react/src/drawer.d.ts +11 -2
  37. package/dist/types/packages/react/src/dropdown.d.cts +21 -6
  38. package/dist/types/packages/react/src/dropdown.d.ts +21 -6
  39. package/dist/types/packages/react/src/event-calendar.d.cts +47 -0
  40. package/dist/types/packages/react/src/event-calendar.d.ts +47 -0
  41. package/dist/types/packages/react/src/fab.d.cts +2 -0
  42. package/dist/types/packages/react/src/fab.d.ts +2 -0
  43. package/dist/types/packages/react/src/file-upload-row.d.cts +23 -0
  44. package/dist/types/packages/react/src/file-upload-row.d.ts +23 -0
  45. package/dist/types/packages/react/src/file-upload.d.cts +38 -0
  46. package/dist/types/packages/react/src/file-upload.d.ts +38 -0
  47. package/dist/types/packages/react/src/financial-display.d.cts +32 -11
  48. package/dist/types/packages/react/src/financial-display.d.ts +32 -11
  49. package/dist/types/packages/react/src/floating-panel.d.cts +6 -2
  50. package/dist/types/packages/react/src/floating-panel.d.ts +6 -2
  51. package/dist/types/packages/react/src/index.d.cts +12 -1
  52. package/dist/types/packages/react/src/index.d.ts +12 -1
  53. package/dist/types/packages/react/src/input.d.cts +27 -1
  54. package/dist/types/packages/react/src/input.d.ts +27 -1
  55. package/dist/types/packages/react/src/kpi-hero.d.cts +2 -0
  56. package/dist/types/packages/react/src/kpi-hero.d.ts +2 -0
  57. package/dist/types/packages/react/src/kpi-row.d.cts +5 -0
  58. package/dist/types/packages/react/src/kpi-row.d.ts +5 -0
  59. package/dist/types/packages/react/src/layout-primitives.d.cts +71 -139
  60. package/dist/types/packages/react/src/layout-primitives.d.ts +71 -139
  61. package/dist/types/packages/react/src/list-context.d.cts +2 -1
  62. package/dist/types/packages/react/src/list-context.d.ts +2 -1
  63. package/dist/types/packages/react/src/list.d.cts +49 -12
  64. package/dist/types/packages/react/src/list.d.ts +49 -12
  65. package/dist/types/packages/react/src/market-model.d.cts +15 -1
  66. package/dist/types/packages/react/src/market-model.d.ts +15 -1
  67. package/dist/types/packages/react/src/market-parts.d.cts +9 -0
  68. package/dist/types/packages/react/src/market-parts.d.ts +9 -0
  69. package/dist/types/packages/react/src/market-skeleton.d.cts +7 -1
  70. package/dist/types/packages/react/src/market-skeleton.d.ts +7 -1
  71. package/dist/types/packages/react/src/media.d.cts +6 -2
  72. package/dist/types/packages/react/src/media.d.ts +6 -2
  73. package/dist/types/packages/react/src/modal.d.cts +11 -2
  74. package/dist/types/packages/react/src/modal.d.ts +11 -2
  75. package/dist/types/packages/react/src/navigation.d.cts +34 -5
  76. package/dist/types/packages/react/src/navigation.d.ts +34 -5
  77. package/dist/types/packages/react/src/number-display.d.cts +8 -5
  78. package/dist/types/packages/react/src/number-display.d.ts +8 -5
  79. package/dist/types/packages/react/src/number-input.d.cts +28 -0
  80. package/dist/types/packages/react/src/number-input.d.ts +28 -0
  81. package/dist/types/packages/react/src/popover.d.cts +5 -2
  82. package/dist/types/packages/react/src/popover.d.ts +5 -2
  83. package/dist/types/packages/react/src/pressable.d.cts +17 -0
  84. package/dist/types/packages/react/src/pressable.d.ts +17 -0
  85. package/dist/types/packages/react/src/quantity-stepper.d.cts +3 -1
  86. package/dist/types/packages/react/src/quantity-stepper.d.ts +3 -1
  87. package/dist/types/packages/react/src/range-input.d.cts +15 -3
  88. package/dist/types/packages/react/src/range-input.d.ts +15 -3
  89. package/dist/types/packages/react/src/search-input.d.cts +6 -3
  90. package/dist/types/packages/react/src/search-input.d.ts +6 -3
  91. package/dist/types/packages/react/src/select-control.d.cts +7 -2
  92. package/dist/types/packages/react/src/select-control.d.ts +7 -2
  93. package/dist/types/packages/react/src/side-navigation-layout-spaces.d.cts +31 -0
  94. package/dist/types/packages/react/src/side-navigation-layout-spaces.d.ts +31 -0
  95. package/dist/types/packages/react/src/side-navigation-layout.d.cts +63 -0
  96. package/dist/types/packages/react/src/side-navigation-layout.d.ts +63 -0
  97. package/dist/types/packages/react/src/side-navigation.d.cts +74 -0
  98. package/dist/types/packages/react/src/side-navigation.d.ts +74 -0
  99. package/dist/types/packages/react/src/skeletons.d.cts +18 -3
  100. package/dist/types/packages/react/src/skeletons.d.ts +18 -3
  101. package/dist/types/packages/react/src/spinner-glyph.d.cts +8 -0
  102. package/dist/types/packages/react/src/spinner-glyph.d.ts +8 -0
  103. package/dist/types/packages/react/src/split-pane.d.cts +20 -5
  104. package/dist/types/packages/react/src/split-pane.d.ts +20 -5
  105. package/dist/types/packages/react/src/stacked-bar.d.cts +3 -1
  106. package/dist/types/packages/react/src/stacked-bar.d.ts +3 -1
  107. package/dist/types/packages/react/src/steps.d.cts +27 -0
  108. package/dist/types/packages/react/src/steps.d.ts +27 -0
  109. package/dist/types/packages/react/src/table-cards.d.cts +4 -12
  110. package/dist/types/packages/react/src/table-cards.d.ts +4 -12
  111. package/dist/types/packages/react/src/table-grid.d.cts +3 -7
  112. package/dist/types/packages/react/src/table-grid.d.ts +3 -7
  113. package/dist/types/packages/react/src/table-groups.d.cts +5 -0
  114. package/dist/types/packages/react/src/table-groups.d.ts +5 -0
  115. package/dist/types/packages/react/src/table-list.d.cts +2 -9
  116. package/dist/types/packages/react/src/table-list.d.ts +2 -9
  117. package/dist/types/packages/react/src/table-model.d.cts +6 -2
  118. package/dist/types/packages/react/src/table-model.d.ts +6 -2
  119. package/dist/types/packages/react/src/tabs.d.cts +3 -1
  120. package/dist/types/packages/react/src/tabs.d.ts +3 -1
  121. package/dist/types/packages/react/src/textarea.d.cts +6 -3
  122. package/dist/types/packages/react/src/textarea.d.ts +6 -3
  123. package/dist/types/packages/react/src/tiles.d.cts +18 -0
  124. package/dist/types/packages/react/src/tiles.d.ts +18 -0
  125. package/dist/types/packages/react/src/time-picker.d.cts +12 -2
  126. package/dist/types/packages/react/src/time-picker.d.ts +12 -2
  127. package/dist/types/packages/react/src/time-wheel.d.cts +18 -0
  128. package/dist/types/packages/react/src/time-wheel.d.ts +18 -0
  129. package/dist/types/packages/react/src/use-filter-scroll.d.cts +5 -0
  130. package/dist/types/packages/react/src/use-filter-scroll.d.ts +5 -0
  131. package/dist/types/shared/package-runtime/accordion-state.d.cts +2 -0
  132. package/dist/types/shared/package-runtime/accordion-state.d.ts +2 -0
  133. package/dist/types/shared/package-runtime/action-size.d.cts +4 -0
  134. package/dist/types/shared/package-runtime/action-size.d.ts +4 -0
  135. package/dist/types/shared/package-runtime/alert-actions.d.cts +7 -0
  136. package/dist/types/shared/package-runtime/alert-actions.d.ts +7 -0
  137. package/dist/types/shared/package-runtime/alert-exit.d.cts +6 -0
  138. package/dist/types/shared/package-runtime/alert-exit.d.ts +6 -0
  139. package/dist/types/shared/package-runtime/alert-live.d.cts +2 -0
  140. package/dist/types/shared/package-runtime/alert-live.d.ts +2 -0
  141. package/dist/types/shared/package-runtime/avatar-group.d.cts +18 -0
  142. package/dist/types/shared/package-runtime/avatar-group.d.ts +18 -0
  143. package/dist/types/shared/package-runtime/badge-tone.d.cts +8 -2
  144. package/dist/types/shared/package-runtime/badge-tone.d.ts +8 -2
  145. package/dist/types/shared/package-runtime/bottom-bar.d.cts +1 -1
  146. package/dist/types/shared/package-runtime/bottom-bar.d.ts +1 -1
  147. package/dist/types/shared/package-runtime/bottom-navigation.d.cts +10 -0
  148. package/dist/types/shared/package-runtime/bottom-navigation.d.ts +10 -0
  149. package/dist/types/shared/package-runtime/calendar.d.cts +21 -7
  150. package/dist/types/shared/package-runtime/calendar.d.ts +21 -7
  151. package/dist/types/shared/package-runtime/card-layout.d.cts +8 -0
  152. package/dist/types/shared/package-runtime/card-layout.d.ts +8 -0
  153. package/dist/types/shared/package-runtime/carousel-scroll.d.cts +2 -0
  154. package/dist/types/shared/package-runtime/carousel-scroll.d.ts +2 -0
  155. package/dist/types/shared/package-runtime/carousel.d.cts +12 -2
  156. package/dist/types/shared/package-runtime/carousel.d.ts +12 -2
  157. package/dist/types/shared/package-runtime/chart-skeleton.d.cts +1 -1
  158. package/dist/types/shared/package-runtime/chart-skeleton.d.ts +1 -1
  159. package/dist/types/shared/package-runtime/clipboard.d.cts +6 -0
  160. package/dist/types/shared/package-runtime/clipboard.d.ts +6 -0
  161. package/dist/types/shared/package-runtime/combobox-options.d.cts +13 -0
  162. package/dist/types/shared/package-runtime/combobox-options.d.ts +13 -0
  163. package/dist/types/shared/package-runtime/combobox.d.cts +3 -1
  164. package/dist/types/shared/package-runtime/combobox.d.ts +3 -1
  165. package/dist/types/shared/package-runtime/copy-button.d.cts +11 -0
  166. package/dist/types/shared/package-runtime/copy-button.d.ts +11 -0
  167. package/dist/types/shared/package-runtime/data-cells.d.cts +36 -0
  168. package/dist/types/shared/package-runtime/data-cells.d.ts +36 -0
  169. package/dist/types/shared/package-runtime/development.d.cts +4 -0
  170. package/dist/types/shared/package-runtime/development.d.ts +4 -0
  171. package/dist/types/shared/package-runtime/distribution.d.cts +36 -1
  172. package/dist/types/shared/package-runtime/distribution.d.ts +36 -1
  173. package/dist/types/shared/package-runtime/drawer-geometry.d.cts +7 -0
  174. package/dist/types/shared/package-runtime/drawer-geometry.d.ts +7 -0
  175. package/dist/types/shared/package-runtime/event-calendar.d.cts +81 -0
  176. package/dist/types/shared/package-runtime/event-calendar.d.ts +81 -0
  177. package/dist/types/shared/package-runtime/external-link.d.cts +4 -0
  178. package/dist/types/shared/package-runtime/external-link.d.ts +4 -0
  179. package/dist/types/shared/package-runtime/field-group.d.cts +17 -0
  180. package/dist/types/shared/package-runtime/field-group.d.ts +17 -0
  181. package/dist/types/shared/package-runtime/file-upload.d.cts +128 -0
  182. package/dist/types/shared/package-runtime/file-upload.d.ts +128 -0
  183. package/dist/types/shared/package-runtime/filter-scroll.d.cts +5 -0
  184. package/dist/types/shared/package-runtime/filter-scroll.d.ts +5 -0
  185. package/dist/types/shared/package-runtime/filter-value.d.cts +2 -0
  186. package/dist/types/shared/package-runtime/filter-value.d.ts +2 -0
  187. package/dist/types/shared/package-runtime/input-field.d.cts +23 -0
  188. package/dist/types/shared/package-runtime/input-field.d.ts +23 -0
  189. package/dist/types/shared/package-runtime/input-variant.d.cts +7 -0
  190. package/dist/types/shared/package-runtime/input-variant.d.ts +7 -0
  191. package/dist/types/shared/package-runtime/kpi.d.cts +13 -0
  192. package/dist/types/shared/package-runtime/kpi.d.ts +13 -0
  193. package/dist/types/shared/package-runtime/layout-primitives.d.cts +115 -6
  194. package/dist/types/shared/package-runtime/layout-primitives.d.ts +115 -6
  195. package/dist/types/shared/package-runtime/list-row.d.cts +71 -8
  196. package/dist/types/shared/package-runtime/list-row.d.ts +71 -8
  197. package/dist/types/shared/package-runtime/market-layout.d.cts +3 -1
  198. package/dist/types/shared/package-runtime/market-layout.d.ts +3 -1
  199. package/dist/types/shared/package-runtime/market-query.d.cts +6 -0
  200. package/dist/types/shared/package-runtime/market-query.d.ts +6 -0
  201. package/dist/types/shared/package-runtime/market-table.d.cts +32 -0
  202. package/dist/types/shared/package-runtime/market-table.d.ts +32 -0
  203. package/dist/types/shared/package-runtime/menu-button.d.cts +4 -0
  204. package/dist/types/shared/package-runtime/menu-button.d.ts +4 -0
  205. package/dist/types/shared/package-runtime/messages/ko.d.cts +77 -1
  206. package/dist/types/shared/package-runtime/messages/ko.d.ts +77 -1
  207. package/dist/types/shared/package-runtime/messages-context.d.cts +69 -1
  208. package/dist/types/shared/package-runtime/messages-context.d.ts +69 -1
  209. package/dist/types/shared/package-runtime/minimum-loading.d.cts +3 -0
  210. package/dist/types/shared/package-runtime/minimum-loading.d.ts +3 -0
  211. package/dist/types/shared/package-runtime/modal-geometry.d.cts +15 -0
  212. package/dist/types/shared/package-runtime/modal-geometry.d.ts +15 -0
  213. package/dist/types/shared/package-runtime/navigation.d.cts +9 -2
  214. package/dist/types/shared/package-runtime/navigation.d.ts +9 -2
  215. package/dist/types/shared/package-runtime/nested-controls.d.cts +7 -0
  216. package/dist/types/shared/package-runtime/nested-controls.d.ts +7 -0
  217. package/dist/types/shared/package-runtime/node-text.d.cts +1 -0
  218. package/dist/types/shared/package-runtime/node-text.d.ts +1 -0
  219. package/dist/types/shared/package-runtime/number-input.d.cts +73 -0
  220. package/dist/types/shared/package-runtime/number-input.d.ts +73 -0
  221. package/dist/types/shared/package-runtime/options.d.cts +25 -5
  222. package/dist/types/shared/package-runtime/options.d.ts +25 -5
  223. package/dist/types/shared/package-runtime/pagination.d.cts +12 -0
  224. package/dist/types/shared/package-runtime/pagination.d.ts +12 -0
  225. package/dist/types/shared/package-runtime/press-repeat.d.cts +13 -0
  226. package/dist/types/shared/package-runtime/press-repeat.d.ts +13 -0
  227. package/dist/types/shared/package-runtime/progress-circle.d.cts +5 -0
  228. package/dist/types/shared/package-runtime/progress-circle.d.ts +5 -0
  229. package/dist/types/shared/package-runtime/progress-marker.d.cts +7 -0
  230. package/dist/types/shared/package-runtime/progress-marker.d.ts +7 -0
  231. package/dist/types/shared/package-runtime/progress-tone.d.cts +6 -0
  232. package/dist/types/shared/package-runtime/progress-tone.d.ts +6 -0
  233. package/dist/types/shared/package-runtime/select-trigger.d.cts +23 -0
  234. package/dist/types/shared/package-runtime/select-trigger.d.ts +23 -0
  235. package/dist/types/shared/package-runtime/sheet-drag.d.cts +24 -0
  236. package/dist/types/shared/package-runtime/sheet-drag.d.ts +24 -0
  237. package/dist/types/shared/package-runtime/side-navigation-keys.d.cts +23 -0
  238. package/dist/types/shared/package-runtime/side-navigation-keys.d.ts +23 -0
  239. package/dist/types/shared/package-runtime/side-navigation-layout.d.cts +24 -0
  240. package/dist/types/shared/package-runtime/side-navigation-layout.d.ts +24 -0
  241. package/dist/types/shared/package-runtime/side-navigation-scroll.d.cts +7 -0
  242. package/dist/types/shared/package-runtime/side-navigation-scroll.d.ts +7 -0
  243. package/dist/types/shared/package-runtime/side-navigation.d.cts +277 -0
  244. package/dist/types/shared/package-runtime/side-navigation.d.ts +277 -0
  245. package/dist/types/shared/package-runtime/signed-number.d.cts +33 -0
  246. package/dist/types/shared/package-runtime/signed-number.d.ts +33 -0
  247. package/dist/types/shared/package-runtime/skeleton-text.d.cts +4 -0
  248. package/dist/types/shared/package-runtime/skeleton-text.d.ts +4 -0
  249. package/dist/types/shared/package-runtime/slider-view.d.cts +17 -2
  250. package/dist/types/shared/package-runtime/slider-view.d.ts +17 -2
  251. package/dist/types/shared/package-runtime/sparkline.d.cts +8 -4
  252. package/dist/types/shared/package-runtime/sparkline.d.ts +8 -4
  253. package/dist/types/shared/package-runtime/spinner-geometry.d.cts +14 -0
  254. package/dist/types/shared/package-runtime/spinner-geometry.d.ts +14 -0
  255. package/dist/types/shared/package-runtime/split-pane.d.cts +40 -1
  256. package/dist/types/shared/package-runtime/split-pane.d.ts +40 -1
  257. package/dist/types/shared/package-runtime/steps.d.cts +51 -0
  258. package/dist/types/shared/package-runtime/steps.d.ts +51 -0
  259. package/dist/types/shared/package-runtime/tab-keyboard.d.cts +6 -0
  260. package/dist/types/shared/package-runtime/tab-keyboard.d.ts +6 -0
  261. package/dist/types/shared/package-runtime/table-columns.d.cts +8 -0
  262. package/dist/types/shared/package-runtime/table-columns.d.ts +8 -0
  263. package/dist/types/shared/package-runtime/table-model.d.cts +23 -3
  264. package/dist/types/shared/package-runtime/table-model.d.ts +23 -3
  265. package/dist/types/shared/package-runtime/table-presentation.d.cts +12 -2
  266. package/dist/types/shared/package-runtime/table-presentation.d.ts +12 -2
  267. package/dist/types/shared/package-runtime/table.d.cts +17 -2
  268. package/dist/types/shared/package-runtime/table.d.ts +17 -2
  269. package/dist/types/shared/package-runtime/textarea.d.cts +6 -4
  270. package/dist/types/shared/package-runtime/textarea.d.ts +6 -4
  271. package/dist/types/shared/package-runtime/tiles-children.d.cts +7 -0
  272. package/dist/types/shared/package-runtime/tiles-children.d.ts +7 -0
  273. package/dist/types/shared/package-runtime/tiles.d.cts +18 -0
  274. package/dist/types/shared/package-runtime/tiles.d.ts +18 -0
  275. package/dist/types/shared/package-runtime/time-segments.d.cts +24 -0
  276. package/dist/types/shared/package-runtime/time-segments.d.ts +24 -0
  277. package/dist/types/shared/package-runtime/time-wheel.d.cts +54 -0
  278. package/dist/types/shared/package-runtime/time-wheel.d.ts +54 -0
  279. package/dist/types/shared/package-runtime/trailing-overflow.d.cts +1 -0
  280. package/dist/types/shared/package-runtime/trailing-overflow.d.ts +1 -0
  281. package/dist/types/shared/package-runtime/use-color-picker.d.cts +3 -0
  282. package/dist/types/shared/package-runtime/use-color-picker.d.ts +3 -0
  283. package/dist/types/shared/package-runtime/use-copy-feedback.d.cts +10 -0
  284. package/dist/types/shared/package-runtime/use-copy-feedback.d.ts +10 -0
  285. package/dist/types/shared/package-runtime/use-open-state.d.cts +5 -0
  286. package/dist/types/shared/package-runtime/use-open-state.d.ts +5 -0
  287. package/dist/types/shared/package-runtime/use-pending-action.d.cts +6 -0
  288. package/dist/types/shared/package-runtime/use-pending-action.d.ts +6 -0
  289. package/dist/types/shared/package-runtime/use-side-navigation-state.d.cts +25 -0
  290. package/dist/types/shared/package-runtime/use-side-navigation-state.d.ts +25 -0
  291. package/dist/types/shared/package-runtime/use-slide.d.cts +3 -0
  292. package/dist/types/shared/package-runtime/use-slide.d.ts +3 -0
  293. package/package.json +3 -3
  294. package/dist/types/packages/react/src/compound-control.d.cts +0 -1
  295. package/dist/types/packages/react/src/compound-control.d.ts +0 -1
  296. package/dist/types/shared/package-runtime/center-option.d.cts +0 -1
  297. package/dist/types/shared/package-runtime/center-option.d.ts +0 -1
@@ -0,0 +1,99 @@
1
+ import { type InputSize } from "@kjun-ui/tokens";
2
+ import { type ReactNode, type Ref } from "react";
3
+ export type ChoiceValue = string | number | boolean | null;
4
+ export interface ChoiceOption<T = ChoiceValue> {
5
+ value: T;
6
+ label: string;
7
+ disabled?: boolean;
8
+ icon?: string;
9
+ /** ButtonGroup only: show the icon alone in a square segment; label becomes the accessible name and tooltip. */
10
+ iconOnly?: boolean;
11
+ /** FilterGroup only: a count after the label ("진행 중 12"), joined to the label in the accessible name. A string is shown as given. */
12
+ count?: number | string;
13
+ dot?: string;
14
+ }
15
+ export interface KjunCheckboxProps<T = ChoiceValue> {
16
+ value: boolean | T[];
17
+ /** Mixed selection display; value and change callbacks keep their boolean/array shape. */
18
+ indeterminate?: boolean;
19
+ val?: T;
20
+ label?: string;
21
+ ariaLabel?: string;
22
+ disabled?: boolean;
23
+ size?: InputSize;
24
+ /** Supporting text under the label; it also describes the checkbox to screen readers. */
25
+ description?: string;
26
+ children?: ReactNode;
27
+ /** Submits with a form under this name while checked. */
28
+ name?: string;
29
+ /** The value a form submits while checked (default "on"). */
30
+ formValue?: string;
31
+ /** The checkbox input's id, e.g. to reach it from an outside <label for>. */
32
+ id?: string;
33
+ /** The checkbox's input, e.g. to move focus to the first box of a group that failed validation. */
34
+ inputRef?: Ref<HTMLInputElement>;
35
+ onValueChange?: (value: boolean | T[]) => void;
36
+ onChange?: (value: boolean | T[]) => void;
37
+ }
38
+ export declare function KjunCheckbox<T = ChoiceValue>({ value, indeterminate, val, label, ariaLabel, disabled, size, description, children, name, formValue, id, inputRef, onValueChange, onChange, }: KjunCheckboxProps<T>): import("react/jsx-runtime").JSX.Element;
39
+ export interface KjunSwitchProps {
40
+ value: boolean;
41
+ label?: string;
42
+ ariaLabel?: string;
43
+ disabled?: boolean;
44
+ size?: InputSize;
45
+ /** Supporting text under the label; it also describes the switch to screen readers. */
46
+ description?: string;
47
+ /** Saving: a spinner turns in the thumb and presses are ignored, without dimming the switch like disabled. */
48
+ loading?: boolean;
49
+ children?: ReactNode;
50
+ /** Submits with a form under this name while the switch is on. */
51
+ name?: string;
52
+ /** The value a form submits while on (default "on"). */
53
+ formValue?: string;
54
+ id?: string;
55
+ autoFocus?: boolean;
56
+ onFocus?: () => void;
57
+ onBlur?: () => void;
58
+ /** The switch's input, e.g. to move focus back after a failed save. */
59
+ inputRef?: Ref<HTMLInputElement>;
60
+ onValueChange?: (value: boolean) => void;
61
+ onChange?: (value: boolean) => void;
62
+ }
63
+ export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, loading, children, name, formValue, id, autoFocus, onFocus, onBlur, inputRef, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
64
+ export interface KjunRadioProps {
65
+ value?: ChoiceValue;
66
+ val: ChoiceValue;
67
+ label?: string;
68
+ disabled?: boolean;
69
+ name?: string;
70
+ ariaLabel?: string;
71
+ /** Inside a RadioGroup the group's size applies unless this is set. */
72
+ size?: InputSize;
73
+ /** Supporting text under the label; it also describes the radio to screen readers. */
74
+ description?: string;
75
+ children?: ReactNode;
76
+ /** The radio input's id, e.g. to reach it from an outside <label for>. */
77
+ id?: string;
78
+ /** The radio's input, e.g. to move focus to it from code. */
79
+ inputRef?: Ref<HTMLInputElement>;
80
+ onValueChange?: (value: ChoiceValue) => void;
81
+ onChange?: (value: ChoiceValue) => void;
82
+ }
83
+ export declare function KjunRadio({ value, val, label, disabled, name, ariaLabel, size, description, children, id, inputRef, onValueChange, onChange, }: KjunRadioProps): import("react/jsx-runtime").JSX.Element;
84
+ export interface KjunRadioGroupProps {
85
+ value: ChoiceValue;
86
+ options?: ChoiceOption[];
87
+ direction?: "horizontal" | "vertical";
88
+ ariaLabel?: string;
89
+ /** Size of every radio in the group. */
90
+ size?: InputSize;
91
+ /** Disables every radio in the group. */
92
+ disabled?: boolean;
93
+ /** The form field name the chosen radio submits under (default: a generated name). */
94
+ name?: string;
95
+ children?: ReactNode;
96
+ onValueChange?: (value: ChoiceValue) => void;
97
+ onChange?: (value: ChoiceValue) => void;
98
+ }
99
+ export declare function KjunRadioGroup({ value, options, direction, ariaLabel, size, disabled, name, children, onValueChange, onChange, }: KjunRadioGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,99 @@
1
+ import { type InputSize } from "@kjun-ui/tokens";
2
+ import { type ReactNode, type Ref } from "react";
3
+ export type ChoiceValue = string | number | boolean | null;
4
+ export interface ChoiceOption<T = ChoiceValue> {
5
+ value: T;
6
+ label: string;
7
+ disabled?: boolean;
8
+ icon?: string;
9
+ /** ButtonGroup only: show the icon alone in a square segment; label becomes the accessible name and tooltip. */
10
+ iconOnly?: boolean;
11
+ /** FilterGroup only: a count after the label ("진행 중 12"), joined to the label in the accessible name. A string is shown as given. */
12
+ count?: number | string;
13
+ dot?: string;
14
+ }
15
+ export interface KjunCheckboxProps<T = ChoiceValue> {
16
+ value: boolean | T[];
17
+ /** Mixed selection display; value and change callbacks keep their boolean/array shape. */
18
+ indeterminate?: boolean;
19
+ val?: T;
20
+ label?: string;
21
+ ariaLabel?: string;
22
+ disabled?: boolean;
23
+ size?: InputSize;
24
+ /** Supporting text under the label; it also describes the checkbox to screen readers. */
25
+ description?: string;
26
+ children?: ReactNode;
27
+ /** Submits with a form under this name while checked. */
28
+ name?: string;
29
+ /** The value a form submits while checked (default "on"). */
30
+ formValue?: string;
31
+ /** The checkbox input's id, e.g. to reach it from an outside <label for>. */
32
+ id?: string;
33
+ /** The checkbox's input, e.g. to move focus to the first box of a group that failed validation. */
34
+ inputRef?: Ref<HTMLInputElement>;
35
+ onValueChange?: (value: boolean | T[]) => void;
36
+ onChange?: (value: boolean | T[]) => void;
37
+ }
38
+ export declare function KjunCheckbox<T = ChoiceValue>({ value, indeterminate, val, label, ariaLabel, disabled, size, description, children, name, formValue, id, inputRef, onValueChange, onChange, }: KjunCheckboxProps<T>): import("react/jsx-runtime").JSX.Element;
39
+ export interface KjunSwitchProps {
40
+ value: boolean;
41
+ label?: string;
42
+ ariaLabel?: string;
43
+ disabled?: boolean;
44
+ size?: InputSize;
45
+ /** Supporting text under the label; it also describes the switch to screen readers. */
46
+ description?: string;
47
+ /** Saving: a spinner turns in the thumb and presses are ignored, without dimming the switch like disabled. */
48
+ loading?: boolean;
49
+ children?: ReactNode;
50
+ /** Submits with a form under this name while the switch is on. */
51
+ name?: string;
52
+ /** The value a form submits while on (default "on"). */
53
+ formValue?: string;
54
+ id?: string;
55
+ autoFocus?: boolean;
56
+ onFocus?: () => void;
57
+ onBlur?: () => void;
58
+ /** The switch's input, e.g. to move focus back after a failed save. */
59
+ inputRef?: Ref<HTMLInputElement>;
60
+ onValueChange?: (value: boolean) => void;
61
+ onChange?: (value: boolean) => void;
62
+ }
63
+ export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, loading, children, name, formValue, id, autoFocus, onFocus, onBlur, inputRef, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
64
+ export interface KjunRadioProps {
65
+ value?: ChoiceValue;
66
+ val: ChoiceValue;
67
+ label?: string;
68
+ disabled?: boolean;
69
+ name?: string;
70
+ ariaLabel?: string;
71
+ /** Inside a RadioGroup the group's size applies unless this is set. */
72
+ size?: InputSize;
73
+ /** Supporting text under the label; it also describes the radio to screen readers. */
74
+ description?: string;
75
+ children?: ReactNode;
76
+ /** The radio input's id, e.g. to reach it from an outside <label for>. */
77
+ id?: string;
78
+ /** The radio's input, e.g. to move focus to it from code. */
79
+ inputRef?: Ref<HTMLInputElement>;
80
+ onValueChange?: (value: ChoiceValue) => void;
81
+ onChange?: (value: ChoiceValue) => void;
82
+ }
83
+ export declare function KjunRadio({ value, val, label, disabled, name, ariaLabel, size, description, children, id, inputRef, onValueChange, onChange, }: KjunRadioProps): import("react/jsx-runtime").JSX.Element;
84
+ export interface KjunRadioGroupProps {
85
+ value: ChoiceValue;
86
+ options?: ChoiceOption[];
87
+ direction?: "horizontal" | "vertical";
88
+ ariaLabel?: string;
89
+ /** Size of every radio in the group. */
90
+ size?: InputSize;
91
+ /** Disables every radio in the group. */
92
+ disabled?: boolean;
93
+ /** The form field name the chosen radio submits under (default: a generated name). */
94
+ name?: string;
95
+ children?: ReactNode;
96
+ onValueChange?: (value: ChoiceValue) => void;
97
+ onChange?: (value: ChoiceValue) => void;
98
+ }
99
+ export declare function KjunRadioGroup({ value, options, direction, ariaLabel, size, disabled, name, children, onValueChange, onChange, }: KjunRadioGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
2
  /** keepMounted: once opened, the body stays mounted (inert, hidden from assistive technology) while closed. */
3
- export declare function Collapse({ open, keepMounted, children }: {
3
+ /** onSettled reports a finished change of state (opened or closed), once its height motion has ended; not the first render,
4
+ * a change that was reversed before it finished, or the body resizing while open. */
5
+ export declare function Collapse({ open, keepMounted, onSettled, children }: {
4
6
  open: boolean;
5
7
  keepMounted?: boolean;
8
+ onSettled?: (open: boolean) => void;
6
9
  children: ReactNode;
7
10
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
2
  /** keepMounted: once opened, the body stays mounted (inert, hidden from assistive technology) while closed. */
3
- export declare function Collapse({ open, keepMounted, children }: {
3
+ /** onSettled reports a finished change of state (opened or closed), once its height motion has ended; not the first render,
4
+ * a change that was reversed before it finished, or the body resizing while open. */
5
+ export declare function Collapse({ open, keepMounted, onSettled, children }: {
4
6
  open: boolean;
5
7
  keepMounted?: boolean;
8
+ onSettled?: (open: boolean) => void;
6
9
  children: ReactNode;
7
10
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -40,6 +40,13 @@ export interface KjunColorPickerProps {
40
40
  id?: string;
41
41
  /** Submits the value with a form through a hidden input. */
42
42
  name?: string;
43
+ /** Draws the panel in the page flow, without a trigger: a filled 240px block for settings screens. open, size, placeholder,
44
+ * variant and renderTrigger do not apply. Recent colors move after each finished pick that did not come from the recent row. */
45
+ inline?: boolean;
46
+ /** "swatch" draws a square color button as tall as the field (for toolbars) instead of the field trigger. */
47
+ variant?: "field" | "swatch";
48
+ /** With variant="swatch": an icon over a bar of the color, on a clear button (a text-color tool). */
49
+ icon?: string;
43
50
  /** Draws the trigger's content; the trigger button and its accessibility stay KJUN's. */
44
51
  renderTrigger?: (state: {
45
52
  value: string | null;
@@ -48,4 +55,4 @@ export interface KjunColorPickerProps {
48
55
  className?: string;
49
56
  style?: CSSProperties;
50
57
  }
51
- export declare function KjunColorPicker({ value, defaultValue, onValueChange, onChangeCommit, swatches: rawSwatches, custom, alpha, input, clearable, recentColors, onRecentColorsChange, eyeDropper, open: openGiven, defaultOpen, onOpenChange, size, placeholder, ariaLabel, error, disabled, readOnly, id, name, renderTrigger, className, style, }: KjunColorPickerProps): import("react/jsx-runtime").JSX.Element;
58
+ export declare function KjunColorPicker({ value, defaultValue, onValueChange, onChangeCommit, swatches: rawSwatches, custom, alpha, input, clearable, recentColors, onRecentColorsChange, eyeDropper, open: openGiven, defaultOpen, onOpenChange, size, placeholder, ariaLabel, error, disabled, readOnly, id, name, inline, variant, icon, renderTrigger, className, style, }: KjunColorPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -40,6 +40,13 @@ export interface KjunColorPickerProps {
40
40
  id?: string;
41
41
  /** Submits the value with a form through a hidden input. */
42
42
  name?: string;
43
+ /** Draws the panel in the page flow, without a trigger: a filled 240px block for settings screens. open, size, placeholder,
44
+ * variant and renderTrigger do not apply. Recent colors move after each finished pick that did not come from the recent row. */
45
+ inline?: boolean;
46
+ /** "swatch" draws a square color button as tall as the field (for toolbars) instead of the field trigger. */
47
+ variant?: "field" | "swatch";
48
+ /** With variant="swatch": an icon over a bar of the color, on a clear button (a text-color tool). */
49
+ icon?: string;
43
50
  /** Draws the trigger's content; the trigger button and its accessibility stay KJUN's. */
44
51
  renderTrigger?: (state: {
45
52
  value: string | null;
@@ -48,4 +55,4 @@ export interface KjunColorPickerProps {
48
55
  className?: string;
49
56
  style?: CSSProperties;
50
57
  }
51
- export declare function KjunColorPicker({ value, defaultValue, onValueChange, onChangeCommit, swatches: rawSwatches, custom, alpha, input, clearable, recentColors, onRecentColorsChange, eyeDropper, open: openGiven, defaultOpen, onOpenChange, size, placeholder, ariaLabel, error, disabled, readOnly, id, name, renderTrigger, className, style, }: KjunColorPickerProps): import("react/jsx-runtime").JSX.Element;
58
+ export declare function KjunColorPicker({ value, defaultValue, onValueChange, onChangeCommit, swatches: rawSwatches, custom, alpha, input, clearable, recentColors, onRecentColorsChange, eyeDropper, open: openGiven, defaultOpen, onOpenChange, size, placeholder, ariaLabel, error, disabled, readOnly, id, name, inline, variant, icon, renderTrigger, className, style, }: KjunColorPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { type InputSize } from "@kjun-ui/tokens";
2
- import { type ReactNode } from "react";
2
+ import { type ReactNode, type Ref } from "react";
3
+ import { type KjunInputProps } from "./input.cjs";
3
4
  import { type FocusReturn } from "./floating-panel.cjs";
4
5
  import { OptionValue, SelectOption } from "./select-options.cjs";
5
6
  export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
@@ -9,13 +10,18 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
9
10
  ariaLabel?: string;
10
11
  labelKey?: string;
11
12
  valueKey?: string;
13
+ /** Replaces the default ranked label/searchKeys match; results keep the original order. */
12
14
  filterFn?: (option: T, query: string) => boolean;
15
+ /** Option fields searched besides the label; matches rank after label matches. */
16
+ searchKeys?: string[];
13
17
  size?: InputSize;
14
18
  disabled?: boolean;
15
19
  error?: boolean;
16
20
  clearable?: boolean;
17
21
  emptyText?: string;
18
- renderOption?: (option: T) => ReactNode;
22
+ /** Candidates are being fetched: the list shows a searching row and options cannot be chosen. */
23
+ loading?: boolean;
24
+ renderOption?: (option: T, selected: boolean) => ReactNode;
19
25
  onValueChange?: (v: OptionValue | null) => void;
20
26
  onChange?: (v: OptionValue | null) => void;
21
27
  onSearch?: (v: string) => void;
@@ -23,7 +29,7 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
23
29
  /** Where focus goes after choosing an option or Escape. Closing while typing keeps focus in the input. Web only. */
24
30
  returnFocus?: FocusReturn;
25
31
  }
26
- export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
32
+ export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, searchKeys, size, disabled, error, clearable, emptyText, loading, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
27
33
  export interface SearchFieldProps<T extends SelectOption> {
28
34
  value: string;
29
35
  size: InputSize;
@@ -42,11 +48,18 @@ export interface SearchFieldProps<T extends SelectOption> {
42
48
  /** A failed request; shown instead of the empty text so the two never look alike. */
43
49
  failed?: boolean;
44
50
  errorText?: string;
45
- renderOption?: (o: T) => ReactNode;
51
+ /** The field's chosen option: checked in the list and highlighted when the list opens. */
52
+ isSelected?: (o: T) => boolean;
53
+ renderOption?: (o: T, selected: boolean) => ReactNode;
46
54
  onValueChange: (v: string) => void;
47
55
  onSelect: (o: T) => void;
48
56
  onClear?: () => void;
49
57
  onEnter?: () => void;
50
58
  returnFocus?: () => HTMLElement | null;
59
+ /** SearchInput's own input attributes (id, name, className, autoFocus, focus handlers) and its ref. */
60
+ inputProps?: SearchFieldInputProps;
61
+ inputRef?: Ref<HTMLInputElement>;
51
62
  }
52
- export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
63
+ /** Input attributes a search field passes through; the field owns value, typing, keys and the popup wiring. */
64
+ export type SearchFieldInputProps = Omit<KjunInputProps, "value" | "size" | "placeholder" | "ariaLabel" | "disabled" | "error" | "clearable" | "prefixIcon" | "role" | "onValueChange" | "onClear" | "onEnter" | "onChange" | "onKeyDown" | "onClick" | "onCompositionStart" | "onCompositionEnd">;
65
+ export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, isSelected, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, inputProps, inputRef, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { type InputSize } from "@kjun-ui/tokens";
2
- import { type ReactNode } from "react";
2
+ import { type ReactNode, type Ref } from "react";
3
+ import { type KjunInputProps } from "./input.js";
3
4
  import { type FocusReturn } from "./floating-panel.js";
4
5
  import { OptionValue, SelectOption } from "./select-options.js";
5
6
  export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
@@ -9,13 +10,18 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
9
10
  ariaLabel?: string;
10
11
  labelKey?: string;
11
12
  valueKey?: string;
13
+ /** Replaces the default ranked label/searchKeys match; results keep the original order. */
12
14
  filterFn?: (option: T, query: string) => boolean;
15
+ /** Option fields searched besides the label; matches rank after label matches. */
16
+ searchKeys?: string[];
13
17
  size?: InputSize;
14
18
  disabled?: boolean;
15
19
  error?: boolean;
16
20
  clearable?: boolean;
17
21
  emptyText?: string;
18
- renderOption?: (option: T) => ReactNode;
22
+ /** Candidates are being fetched: the list shows a searching row and options cannot be chosen. */
23
+ loading?: boolean;
24
+ renderOption?: (option: T, selected: boolean) => ReactNode;
19
25
  onValueChange?: (v: OptionValue | null) => void;
20
26
  onChange?: (v: OptionValue | null) => void;
21
27
  onSearch?: (v: string) => void;
@@ -23,7 +29,7 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
23
29
  /** Where focus goes after choosing an option or Escape. Closing while typing keeps focus in the input. Web only. */
24
30
  returnFocus?: FocusReturn;
25
31
  }
26
- export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
32
+ export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, searchKeys, size, disabled, error, clearable, emptyText, loading, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
27
33
  export interface SearchFieldProps<T extends SelectOption> {
28
34
  value: string;
29
35
  size: InputSize;
@@ -42,11 +48,18 @@ export interface SearchFieldProps<T extends SelectOption> {
42
48
  /** A failed request; shown instead of the empty text so the two never look alike. */
43
49
  failed?: boolean;
44
50
  errorText?: string;
45
- renderOption?: (o: T) => ReactNode;
51
+ /** The field's chosen option: checked in the list and highlighted when the list opens. */
52
+ isSelected?: (o: T) => boolean;
53
+ renderOption?: (o: T, selected: boolean) => ReactNode;
46
54
  onValueChange: (v: string) => void;
47
55
  onSelect: (o: T) => void;
48
56
  onClear?: () => void;
49
57
  onEnter?: () => void;
50
58
  returnFocus?: () => HTMLElement | null;
59
+ /** SearchInput's own input attributes (id, name, className, autoFocus, focus handlers) and its ref. */
60
+ inputProps?: SearchFieldInputProps;
61
+ inputRef?: Ref<HTMLInputElement>;
51
62
  }
52
- export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
63
+ /** Input attributes a search field passes through; the field owns value, typing, keys and the popup wiring. */
64
+ export type SearchFieldInputProps = Omit<KjunInputProps, "value" | "size" | "placeholder" | "ariaLabel" | "disabled" | "error" | "clearable" | "prefixIcon" | "role" | "onValueChange" | "onClear" | "onEnter" | "onChange" | "onKeyDown" | "onClick" | "onCompositionStart" | "onCompositionEnd">;
65
+ export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, isSelected, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, inputProps, inputRef, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,75 +1,7 @@
1
- import { type ButtonSize, type InputSize } from "@kjun-ui/tokens";
2
- import { type ReactNode, type Ref } from "react";
1
+ import { type ButtonSize } from "@kjun-ui/tokens";
3
2
  import { groupKeydown } from "../../../shared/package-runtime/group-keyboard.cjs";
4
- export type ChoiceValue = string | number | boolean | null;
5
- export interface ChoiceOption<T = ChoiceValue> {
6
- value: T;
7
- label: string;
8
- disabled?: boolean;
9
- icon?: string;
10
- dot?: string;
11
- }
12
- export interface KjunCheckboxProps<T = ChoiceValue> {
13
- value: boolean | T[];
14
- /** Mixed selection display; value and change callbacks keep their boolean/array shape. */
15
- indeterminate?: boolean;
16
- val?: T;
17
- label?: string;
18
- ariaLabel?: string;
19
- disabled?: boolean;
20
- size?: InputSize;
21
- children?: ReactNode;
22
- onValueChange?: (value: boolean | T[]) => void;
23
- onChange?: (value: boolean | T[]) => void;
24
- }
25
- export declare function KjunCheckbox<T = ChoiceValue>({ value, indeterminate, val, label, ariaLabel, disabled, size, children, onValueChange, onChange, }: KjunCheckboxProps<T>): import("react/jsx-runtime").JSX.Element;
26
- export interface KjunSwitchProps {
27
- value: boolean;
28
- label?: string;
29
- ariaLabel?: string;
30
- disabled?: boolean;
31
- size?: InputSize;
32
- /** Supporting text under the label; it also describes the switch to screen readers. */
33
- description?: string;
34
- /** Saving: a spinner turns in the thumb and presses are ignored, without dimming the switch like disabled. */
35
- loading?: boolean;
36
- children?: ReactNode;
37
- /** Submits with a form under this name while the switch is on. */
38
- name?: string;
39
- /** The value a form submits while on (default "on"). */
40
- formValue?: string;
41
- id?: string;
42
- autoFocus?: boolean;
43
- onFocus?: () => void;
44
- onBlur?: () => void;
45
- /** The switch's input, e.g. to move focus back after a failed save. */
46
- inputRef?: Ref<HTMLInputElement>;
47
- onValueChange?: (value: boolean) => void;
48
- onChange?: (value: boolean) => void;
49
- }
50
- export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, loading, children, name, formValue, id, autoFocus, onFocus, onBlur, inputRef, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
51
- export interface KjunRadioProps {
52
- value?: ChoiceValue;
53
- val: ChoiceValue;
54
- label?: string;
55
- disabled?: boolean;
56
- name?: string;
57
- ariaLabel?: string;
58
- children?: ReactNode;
59
- onValueChange?: (value: ChoiceValue) => void;
60
- onChange?: (value: ChoiceValue) => void;
61
- }
62
- export declare function KjunRadio({ value, val, label, disabled, name, ariaLabel, children, onValueChange, onChange, }: KjunRadioProps): import("react/jsx-runtime").JSX.Element;
63
- export interface KjunRadioGroupProps {
64
- value: ChoiceValue;
65
- options?: ChoiceOption[];
66
- direction?: "horizontal" | "vertical";
67
- ariaLabel?: string;
68
- children?: ReactNode;
69
- onValueChange?: (value: ChoiceValue) => void;
70
- onChange?: (value: ChoiceValue) => void;
71
- }
72
- export declare function KjunRadioGroup({ value, options, direction, ariaLabel, children, onValueChange, onChange, }: KjunRadioGroupProps): import("react/jsx-runtime").JSX.Element;
3
+ export * from "./choice-controls.cjs";
4
+ import type { ChoiceOption, ChoiceValue } from "./choice-controls.cjs";
73
5
  export { KjunTextarea } from "./textarea.cjs";
74
6
  export type { KjunTextareaProps } from "./textarea.cjs";
75
7
  export { groupKeydown };
@@ -77,7 +9,6 @@ export interface KjunButtonGroupProps {
77
9
  value: ChoiceValue;
78
10
  options: ChoiceOption[];
79
11
  size?: ButtonSize;
80
- variant?: "primary" | "secondary" | "ghost";
81
12
  disabled?: boolean;
82
13
  fullWidth?: boolean;
83
14
  ariaLabel?: string;
@@ -85,11 +16,13 @@ export interface KjunButtonGroupProps {
85
16
  onChange?: (value: ChoiceValue) => void;
86
17
  }
87
18
  export declare function KjunButtonGroup({ value, options, size, disabled, fullWidth, ariaLabel, onValueChange, onChange, }: KjunButtonGroupProps): import("react/jsx-runtime").JSX.Element;
88
- export interface KjunFilterGroupProps extends Omit<KjunButtonGroupProps, "value" | "onValueChange" | "onChange" | "fullWidth" | "variant"> {
19
+ export interface KjunFilterGroupProps extends Omit<KjunButtonGroupProps, "value" | "onValueChange" | "onChange" | "fullWidth"> {
89
20
  value: ChoiceValue | ChoiceValue[];
90
21
  multiple?: boolean;
91
22
  scroll?: boolean;
23
+ /** Extra class on the group root, for placement in the page layout. */
24
+ className?: string;
92
25
  onValueChange?: (value: ChoiceValue | ChoiceValue[]) => void;
93
26
  onChange?: (value: ChoiceValue | ChoiceValue[]) => void;
94
27
  }
95
- export declare function KjunFilterGroup({ value, options, size, disabled, multiple, scroll, ariaLabel, onValueChange, onChange, }: KjunFilterGroupProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function KjunFilterGroup({ value, options, size, disabled, multiple, scroll, ariaLabel, className, onValueChange, onChange, }: KjunFilterGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -1,75 +1,7 @@
1
- import { type ButtonSize, type InputSize } from "@kjun-ui/tokens";
2
- import { type ReactNode, type Ref } from "react";
1
+ import { type ButtonSize } from "@kjun-ui/tokens";
3
2
  import { groupKeydown } from "../../../shared/package-runtime/group-keyboard.js";
4
- export type ChoiceValue = string | number | boolean | null;
5
- export interface ChoiceOption<T = ChoiceValue> {
6
- value: T;
7
- label: string;
8
- disabled?: boolean;
9
- icon?: string;
10
- dot?: string;
11
- }
12
- export interface KjunCheckboxProps<T = ChoiceValue> {
13
- value: boolean | T[];
14
- /** Mixed selection display; value and change callbacks keep their boolean/array shape. */
15
- indeterminate?: boolean;
16
- val?: T;
17
- label?: string;
18
- ariaLabel?: string;
19
- disabled?: boolean;
20
- size?: InputSize;
21
- children?: ReactNode;
22
- onValueChange?: (value: boolean | T[]) => void;
23
- onChange?: (value: boolean | T[]) => void;
24
- }
25
- export declare function KjunCheckbox<T = ChoiceValue>({ value, indeterminate, val, label, ariaLabel, disabled, size, children, onValueChange, onChange, }: KjunCheckboxProps<T>): import("react/jsx-runtime").JSX.Element;
26
- export interface KjunSwitchProps {
27
- value: boolean;
28
- label?: string;
29
- ariaLabel?: string;
30
- disabled?: boolean;
31
- size?: InputSize;
32
- /** Supporting text under the label; it also describes the switch to screen readers. */
33
- description?: string;
34
- /** Saving: a spinner turns in the thumb and presses are ignored, without dimming the switch like disabled. */
35
- loading?: boolean;
36
- children?: ReactNode;
37
- /** Submits with a form under this name while the switch is on. */
38
- name?: string;
39
- /** The value a form submits while on (default "on"). */
40
- formValue?: string;
41
- id?: string;
42
- autoFocus?: boolean;
43
- onFocus?: () => void;
44
- onBlur?: () => void;
45
- /** The switch's input, e.g. to move focus back after a failed save. */
46
- inputRef?: Ref<HTMLInputElement>;
47
- onValueChange?: (value: boolean) => void;
48
- onChange?: (value: boolean) => void;
49
- }
50
- export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, loading, children, name, formValue, id, autoFocus, onFocus, onBlur, inputRef, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
51
- export interface KjunRadioProps {
52
- value?: ChoiceValue;
53
- val: ChoiceValue;
54
- label?: string;
55
- disabled?: boolean;
56
- name?: string;
57
- ariaLabel?: string;
58
- children?: ReactNode;
59
- onValueChange?: (value: ChoiceValue) => void;
60
- onChange?: (value: ChoiceValue) => void;
61
- }
62
- export declare function KjunRadio({ value, val, label, disabled, name, ariaLabel, children, onValueChange, onChange, }: KjunRadioProps): import("react/jsx-runtime").JSX.Element;
63
- export interface KjunRadioGroupProps {
64
- value: ChoiceValue;
65
- options?: ChoiceOption[];
66
- direction?: "horizontal" | "vertical";
67
- ariaLabel?: string;
68
- children?: ReactNode;
69
- onValueChange?: (value: ChoiceValue) => void;
70
- onChange?: (value: ChoiceValue) => void;
71
- }
72
- export declare function KjunRadioGroup({ value, options, direction, ariaLabel, children, onValueChange, onChange, }: KjunRadioGroupProps): import("react/jsx-runtime").JSX.Element;
3
+ export * from "./choice-controls.js";
4
+ import type { ChoiceOption, ChoiceValue } from "./choice-controls.js";
73
5
  export { KjunTextarea } from "./textarea.js";
74
6
  export type { KjunTextareaProps } from "./textarea.js";
75
7
  export { groupKeydown };
@@ -77,7 +9,6 @@ export interface KjunButtonGroupProps {
77
9
  value: ChoiceValue;
78
10
  options: ChoiceOption[];
79
11
  size?: ButtonSize;
80
- variant?: "primary" | "secondary" | "ghost";
81
12
  disabled?: boolean;
82
13
  fullWidth?: boolean;
83
14
  ariaLabel?: string;
@@ -85,11 +16,13 @@ export interface KjunButtonGroupProps {
85
16
  onChange?: (value: ChoiceValue) => void;
86
17
  }
87
18
  export declare function KjunButtonGroup({ value, options, size, disabled, fullWidth, ariaLabel, onValueChange, onChange, }: KjunButtonGroupProps): import("react/jsx-runtime").JSX.Element;
88
- export interface KjunFilterGroupProps extends Omit<KjunButtonGroupProps, "value" | "onValueChange" | "onChange" | "fullWidth" | "variant"> {
19
+ export interface KjunFilterGroupProps extends Omit<KjunButtonGroupProps, "value" | "onValueChange" | "onChange" | "fullWidth"> {
89
20
  value: ChoiceValue | ChoiceValue[];
90
21
  multiple?: boolean;
91
22
  scroll?: boolean;
23
+ /** Extra class on the group root, for placement in the page layout. */
24
+ className?: string;
92
25
  onValueChange?: (value: ChoiceValue | ChoiceValue[]) => void;
93
26
  onChange?: (value: ChoiceValue | ChoiceValue[]) => void;
94
27
  }
95
- export declare function KjunFilterGroup({ value, options, size, disabled, multiple, scroll, ariaLabel, onValueChange, onChange, }: KjunFilterGroupProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function KjunFilterGroup({ value, options, size, disabled, multiple, scroll, ariaLabel, className, onValueChange, onChange, }: KjunFilterGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -16,6 +16,8 @@ export interface KjunDataStateProps extends QueryDisplayProps {
16
16
  loadingPadding?: "default" | "none";
17
17
  empty?: boolean;
18
18
  emptyText?: string;
19
+ /** Why it is empty and what to do next, under the title. */
20
+ emptyDescription?: string;
19
21
  emptyIcon?: string;
20
22
  emptyActionText?: string;
21
23
  loadingText?: string;
@@ -33,26 +35,37 @@ export interface KjunDataStateProps extends QueryDisplayProps {
33
35
  onRetry?: () => void;
34
36
  onEmptyAction?: () => void;
35
37
  }
36
- export declare function KjunDataState({ preserveContent, refreshing, refreshError, refreshingText, loadingPadding, empty, emptyText, emptyIcon, emptyActionText, loadingText, loadingDelay, retryText, size, skeleton, skeletonType, skeletonCount, children, loadingContent, emptyContent, errorContent, onRetry, onEmptyAction, ...query }: KjunDataStateProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function KjunDataState({ preserveContent, refreshing, refreshError, refreshingText, loadingPadding, empty, emptyText, emptyDescription, emptyIcon, emptyActionText, loadingText, loadingDelay, retryText, size, skeleton, skeletonType, skeletonCount, children, loadingContent, emptyContent, errorContent, onRetry, onEmptyAction, ...query }: KjunDataStateProps): import("react/jsx-runtime").JSX.Element;
37
39
  export interface KjunErrorBoundaryProps {
38
40
  children: ReactNode;
39
41
  fallbackMessage?: string;
40
42
  /** The default fallback's padding and minimum height, like KjunDataState: md for pages and panels, sm for cards, lg for full pages. */
41
43
  size?: "sm" | "md" | "lg";
42
- fallback?: ReactNode;
44
+ /** Replaces the default fallback; a function receives the caught error and reset, like Vue's fallback slot. */
45
+ fallback?: ReactNode | ((props: KjunErrorFallbackProps) => ReactNode);
46
+ /** A change in any of these values (a route, a query) resets a failed boundary, like pressing retry. */
47
+ resetKeys?: readonly unknown[];
43
48
  onError?: (error: Error, info: ErrorInfo) => void;
49
+ /** Called after the boundary resets, from retry, a fallback's reset or a resetKeys change. */
44
50
  onReset?: () => void;
45
51
  }
52
+ export interface KjunErrorFallbackProps {
53
+ error: Error;
54
+ reset: () => void;
55
+ }
46
56
  export declare class KjunErrorBoundary extends Component<KjunErrorBoundaryProps, {
47
- error: boolean;
57
+ error: Error | null;
48
58
  }> {
49
59
  state: {
50
- error: boolean;
60
+ error: Error | null;
51
61
  };
52
- static getDerivedStateFromError(): {
53
- error: boolean;
62
+ static getDerivedStateFromError(error: unknown): {
63
+ error: Error;
54
64
  };
55
65
  componentDidCatch(error: Error, info: ErrorInfo): void;
66
+ componentDidUpdate(previous: KjunErrorBoundaryProps, state: {
67
+ error: Error | null;
68
+ }): void;
56
69
  reset: () => void;
57
70
  render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
58
71
  }