@choice-ui/react 1.4.2 → 1.4.5

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 (462) hide show
  1. package/dist/components/alert-dialog/dist/index.d.ts +20 -41
  2. package/dist/components/alert-dialog/dist/index.js +497 -0
  3. package/dist/components/alert-dialog/src/alert-dialog.js +1 -1
  4. package/dist/components/alert-dialog/src/hooks/use-alert-dialog.d.ts +1 -1
  5. package/dist/components/alert-dialog/src/index.d.ts +4 -5
  6. package/dist/components/alert-dialog/src/types.d.ts +11 -11
  7. package/dist/components/avatar/dist/index.js +4 -4
  8. package/dist/components/avatar/src/avatar.js +4 -4
  9. package/dist/components/badge/src/badge.js +2 -2
  10. package/dist/components/badge/src/index.d.ts +2 -1
  11. package/dist/components/button/dist/index.js +4 -4
  12. package/dist/components/button/src/button.js +4 -4
  13. package/dist/components/calendar/dist/index.d.ts +296 -296
  14. package/dist/components/calendar/dist/index.js +57 -56
  15. package/dist/components/calendar/src/date-range-input/date-range-input.d.ts +5 -5
  16. package/dist/components/calendar/src/time-calendar/time-calendar.d.ts +3 -3
  17. package/dist/components/calendar/src/time-calendar/time-calendar.js +2 -2
  18. package/dist/components/calendar/src/time-input/time-input.d.ts +9 -9
  19. package/dist/components/calendar/src/time-input/time-input.js +4 -4
  20. package/dist/components/calendar/src/types.d.ts +165 -165
  21. package/dist/components/calendar/src/utils/constants.js +32 -31
  22. package/dist/components/calendar/src/utils/date-comparisons.d.ts +34 -34
  23. package/dist/components/calendar/src/utils/locale.d.ts +12 -12
  24. package/dist/components/calendar/src/utils/month.d.ts +3 -3
  25. package/dist/components/calendar/src/utils/month.js +1 -1
  26. package/dist/components/calendar/src/utils/parsers/month-names.js +3 -3
  27. package/dist/components/calendar/src/utils/parsers/numeric-utils.d.ts +20 -20
  28. package/dist/components/calendar/src/utils/parsers/numeric-utils.js +8 -8
  29. package/dist/components/calendar/src/utils/parsers/parsers.d.ts +17 -17
  30. package/dist/components/calendar/src/utils/parsers/parsers.js +2 -2
  31. package/dist/components/calendar/src/utils/parsers/prediction.d.ts +7 -7
  32. package/dist/components/calendar/src/utils/parsers/relative-dates.js +6 -6
  33. package/dist/components/calendar/src/utils/quarter.d.ts +13 -13
  34. package/dist/components/calendar/src/utils/quarter.js +6 -6
  35. package/dist/components/calendar/src/utils/time.d.ts +8 -8
  36. package/dist/components/calendar/src/utils/year.d.ts +3 -3
  37. package/dist/components/calendar/src/utils/year.js +3 -3
  38. package/dist/components/checkbox/dist/index.d.ts +1 -12
  39. package/dist/components/checkbox/dist/index.js +9 -9
  40. package/dist/components/checkbox/src/checkbox-label.js +2 -2
  41. package/dist/components/checkbox/src/checkbox.js +6 -5
  42. package/dist/components/checkbox/src/context.js +1 -1
  43. package/dist/components/checkbox/src/index.d.ts +0 -3
  44. package/dist/components/chip/dist/index.js +6 -6
  45. package/dist/components/chip/src/chip.js +6 -6
  46. package/dist/components/chip/src/index.d.ts +2 -1
  47. package/dist/components/chips-input/dist/index.js +270 -0
  48. package/dist/components/chips-input/src/index.d.ts +2 -1
  49. package/dist/components/code-block/dist/index.d.ts +14 -32
  50. package/dist/components/code-block/dist/index.js +211 -147
  51. package/dist/components/code-block/src/code-block.d.ts +8 -1
  52. package/dist/components/code-block/src/code-block.js +14 -3
  53. package/dist/components/code-block/src/components/code-block-code.js +31 -5
  54. package/dist/components/code-block/src/components/code-block-header.js +45 -10
  55. package/dist/components/code-block/src/index.d.ts +3 -9
  56. package/dist/components/combobox/dist/index.d.ts +21 -2
  57. package/dist/components/combobox/dist/index.js +16 -13
  58. package/dist/components/combobox/src/combobox-trigger.d.ts +1 -1
  59. package/dist/components/combobox/src/combobox-trigger.js +7 -4
  60. package/dist/components/combobox/src/combobox.d.ts +20 -1
  61. package/dist/components/combobox/src/combobox.js +10 -10
  62. package/dist/components/command/dist/index.d.ts +67 -6
  63. package/dist/components/command/src/command.js +6 -5
  64. package/dist/components/command/src/components/command-divider.d.ts +4 -1
  65. package/dist/components/command/src/components/command-group.d.ts +16 -1
  66. package/dist/components/command/src/components/command-group.js +56 -54
  67. package/dist/components/command/src/components/command-input.d.ts +2 -2
  68. package/dist/components/command/src/components/command-input.js +32 -31
  69. package/dist/components/command/src/components/command-item.d.ts +1 -1
  70. package/dist/components/command/src/components/command-item.js +117 -115
  71. package/dist/components/command/src/components/command-loading.d.ts +8 -0
  72. package/dist/components/command/src/components/command-loading.js +1 -1
  73. package/dist/components/command/src/context/create-command-context.js +1 -1
  74. package/dist/components/command/src/hooks/use-schedule-layout-effect.d.ts +1 -1
  75. package/dist/components/command/src/hooks/use-value.js +2 -2
  76. package/dist/components/command/src/index.d.ts +16 -8
  77. package/dist/components/command/src/tv.d.ts +33 -12
  78. package/dist/components/command/src/tv.js +13 -6
  79. package/dist/components/command/src/types.d.ts +8 -0
  80. package/dist/components/command/src/utils/constants.d.ts +1 -1
  81. package/dist/components/command/src/utils/constants.js +1 -1
  82. package/dist/components/command/src/utils/helpers.d.ts +0 -1
  83. package/dist/components/command/src/utils/helpers.js +1 -3
  84. package/dist/components/command/src/utils/index.d.ts +1 -0
  85. package/dist/components/comments/src/comment-input/components/comment-input-mention-popover.js +4 -2
  86. package/dist/components/comments/src/comment-item/tv.d.ts +3 -3
  87. package/dist/components/comments/src/comments.js +1 -1
  88. package/dist/components/context-input/dist/index.d.ts +15 -340
  89. package/dist/components/context-input/src/components/mention-menu.d.ts +5 -4
  90. package/dist/components/context-input/src/components/mention-menu.js +19 -4
  91. package/dist/components/context-input/src/components/mention.d.ts +2 -2
  92. package/dist/components/context-input/src/components/slate-editor.js +4 -2
  93. package/dist/components/context-input/src/context-input.js +31 -16
  94. package/dist/components/context-input/src/extensions/with-mentions.d.ts +1 -1
  95. package/dist/components/context-input/src/extensions/with-mentions.js +10 -9
  96. package/dist/components/context-input/src/hooks/use-context-input.js +87 -46
  97. package/dist/components/context-input/src/hooks/use-mentions.d.ts +11 -10
  98. package/dist/components/context-input/src/hooks/use-mentions.js +147 -128
  99. package/dist/components/context-input/src/index.d.ts +2 -5
  100. package/dist/components/context-input/src/types.d.ts +12 -12
  101. package/dist/components/context-input/src/utils/mention-spacing.d.ts +16 -16
  102. package/dist/components/context-input/src/utils/mention-spacing.js +1 -27
  103. package/dist/components/context-input/src/utils/slate-converters.d.ts +6 -6
  104. package/dist/components/context-input/src/utils/slate-converters.js +3 -69
  105. package/dist/components/context-input/src/utils/text-extraction.js +7 -1
  106. package/dist/components/context-menu/src/context-menu.js +10 -4
  107. package/dist/components/dialog/dist/index.js +1 -2
  108. package/dist/components/dialog/src/dialog.js +0 -1
  109. package/dist/components/dialog/src/hooks/use-floating-dialog.js +1 -1
  110. package/dist/components/dialog/src/index.d.ts +3 -2
  111. package/dist/components/dropdown/dist/index.d.ts +1 -2
  112. package/dist/components/dropdown/dist/index.js +23 -8
  113. package/dist/components/dropdown/src/dropdown.d.ts +1 -2
  114. package/dist/components/dropdown/src/dropdown.js +23 -8
  115. package/dist/components/emoji-picker/dist/index.d.ts +33 -1
  116. package/dist/components/emoji-picker/dist/index.js +3 -1
  117. package/dist/components/emoji-picker/src/emoji-picker.d.ts +1 -1
  118. package/dist/components/emoji-picker/src/emoji-picker.js +3 -1
  119. package/dist/components/emoji-picker/src/index.d.ts +3 -1
  120. package/dist/components/form/dist/index.d.ts +93 -98
  121. package/dist/components/form/src/adapters/base-adapter.d.ts +3 -3
  122. package/dist/components/form/src/adapters/checkbox-adapter.d.ts +1 -1
  123. package/dist/components/form/src/adapters/chips-input-adapter.d.ts +9 -0
  124. package/dist/components/form/src/adapters/chips-input-adapter.js +38 -0
  125. package/dist/components/form/src/adapters/index.d.ts +8 -7
  126. package/dist/components/form/src/adapters/input-adapter.d.ts +1 -1
  127. package/dist/components/form/src/adapters/multi-select-adapter.d.ts +1 -1
  128. package/dist/components/form/src/adapters/numeric-input-adapter.d.ts +1 -1
  129. package/dist/components/form/src/adapters/raido-group-adapter.d.ts +1 -7
  130. package/dist/components/form/src/adapters/range-adapter.d.ts +1 -7
  131. package/dist/components/form/src/adapters/segmented-adapter.d.ts +1 -7
  132. package/dist/components/form/src/adapters/select-adapter.d.ts +1 -1
  133. package/dist/components/form/src/adapters/switch-adapter.d.ts +1 -1
  134. package/dist/components/form/src/adapters/textarea-adapter.d.ts +1 -1
  135. package/dist/components/form/src/index.d.ts +18 -16
  136. package/dist/components/form/src/index.js +16 -13
  137. package/dist/components/form/src/types.d.ts +58 -51
  138. package/dist/components/hint/dist/index.d.ts +10 -54
  139. package/dist/components/hint/src/components/info-content.d.ts +3 -5
  140. package/dist/components/hint/src/components/info-content.js +14 -6
  141. package/dist/components/hint/src/components/info-trigger.d.ts +2 -3
  142. package/dist/components/hint/src/components/info-trigger.js +4 -2
  143. package/dist/components/hint/src/context/hint-context.d.ts +2 -0
  144. package/dist/components/hint/src/context/hint-context.js +1 -1
  145. package/dist/components/hint/src/hint.d.ts +7 -7
  146. package/dist/components/hint/src/hint.js +24 -29
  147. package/dist/components/hint/src/hooks/use-hint.d.ts +4 -2
  148. package/dist/components/hint/src/hooks/use-hint.js +12 -4
  149. package/dist/components/hint/src/index.d.ts +3 -3
  150. package/dist/components/hint/src/tv.d.ts +33 -0
  151. package/dist/components/hint/src/tv.js +11 -0
  152. package/dist/components/icon-button/dist/index.js +2 -2
  153. package/dist/components/icon-button/src/icon-button.js +2 -2
  154. package/dist/components/index.d.ts +3 -0
  155. package/dist/components/input/dist/index.js +4 -4
  156. package/dist/components/input/src/input.js +3 -3
  157. package/dist/components/input/src/tv.js +1 -1
  158. package/dist/components/kbd/dist/index.js +4 -4
  159. package/dist/components/kbd/src/kbd.js +4 -4
  160. package/dist/components/label/dist/index.js +3 -3
  161. package/dist/components/label/src/tv.js +3 -3
  162. package/dist/components/link-button/dist/index.js +3 -3
  163. package/dist/components/link-button/src/link-button.js +3 -3
  164. package/dist/components/list/src/components/list-content.js +2 -2
  165. package/dist/components/list/src/components/list-divider.js +3 -3
  166. package/dist/components/list/src/components/list-item.js +5 -5
  167. package/dist/components/list/src/components/list-label.js +2 -2
  168. package/dist/components/list/src/components/list-sub-trigger.js +4 -4
  169. package/dist/components/list/src/list.js +2 -2
  170. package/dist/components/md-input/dist/index.d.ts +8 -104
  171. package/dist/components/md-input/src/components/extensions/md-input-mention.d.ts +6 -4
  172. package/dist/components/md-input/src/components/extensions/md-input-mention.js +23 -6
  173. package/dist/components/md-input/src/components/md-input-container.js +1 -0
  174. package/dist/components/md-input/src/components/md-input-editor.js +4 -1
  175. package/dist/components/md-input/src/components/md-input-footer.js +5 -1
  176. package/dist/components/md-input/src/components/toolbar/default-actions.d.ts +2 -2
  177. package/dist/components/md-input/src/components/toolbar/toolbar-button.d.ts +1 -0
  178. package/dist/components/md-input/src/components/toolbar/toolbar-button.js +1 -7
  179. package/dist/components/md-input/src/components/toolbar/toolbar.d.ts +2 -2
  180. package/dist/components/md-input/src/hooks/use-markdown-mentions.d.ts +5 -4
  181. package/dist/components/md-input/src/hooks/use-markdown-mentions.js +31 -4
  182. package/dist/components/md-input/src/index.d.ts +1 -4
  183. package/dist/components/md-input/src/md-input.js +18 -14
  184. package/dist/components/md-input/src/tv.d.ts +3 -0
  185. package/dist/components/md-input/src/tv.js +2 -1
  186. package/dist/components/md-input/src/types.d.ts +18 -16
  187. package/dist/components/md-render/dist/index.d.ts +1 -4
  188. package/dist/components/md-render/dist/index.js +8 -9
  189. package/dist/components/md-render/src/components/markdown-components.js +3 -3
  190. package/dist/components/md-render/src/index.d.ts +0 -1
  191. package/dist/components/md-render/src/md-render.js +5 -4
  192. package/dist/components/md-render/src/tv.js +1 -1
  193. package/dist/components/menubar/dist/index.d.ts +50 -0
  194. package/dist/components/menubar/src/components/index.d.ts +3 -0
  195. package/dist/components/menubar/src/components/menubar-divider.d.ts +8 -0
  196. package/dist/components/menubar/src/components/menubar-divider.js +24 -0
  197. package/dist/components/menubar/src/components/menubar-item.d.ts +8 -0
  198. package/dist/components/menubar/src/components/menubar-item.js +195 -0
  199. package/dist/components/menubar/src/components/menubar-trigger.d.ts +8 -0
  200. package/dist/components/menubar/src/components/menubar-trigger.js +45 -0
  201. package/dist/components/menubar/src/context/index.d.ts +1 -0
  202. package/dist/components/menubar/src/context/menubar-context.d.ts +34 -0
  203. package/dist/components/menubar/src/context/menubar-context.js +13 -0
  204. package/dist/components/menubar/src/index.d.ts +3 -0
  205. package/dist/components/menubar/src/menubar.d.ts +22 -0
  206. package/dist/components/menubar/src/menubar.js +177 -0
  207. package/dist/components/menubar/src/tv.d.ts +108 -0
  208. package/dist/components/menubar/src/tv.js +72 -0
  209. package/dist/components/menubar/tsup.config.d.ts +2 -0
  210. package/dist/components/menus/dist/index.d.ts +144 -143
  211. package/dist/components/menus/dist/index.js +50 -49
  212. package/dist/components/menus/src/components/menu-button.js +2 -2
  213. package/dist/components/menus/src/components/menu-checkbox.d.ts +1 -2
  214. package/dist/components/menus/src/components/menu-checkbox.js +2 -2
  215. package/dist/components/menus/src/components/menu-divider.js +3 -3
  216. package/dist/components/menus/src/components/menu-item.js +5 -5
  217. package/dist/components/menus/src/components/menu-label.js +2 -2
  218. package/dist/components/menus/src/components/menu-scroll-arrow.d.ts +2 -2
  219. package/dist/components/menus/src/components/menu-scroll-arrow.js +13 -3
  220. package/dist/components/menus/src/components/menu-search.js +3 -3
  221. package/dist/components/menus/src/components/menu-trigger.js +4 -4
  222. package/dist/components/menus/src/context/menu-context-item.d.ts +6 -6
  223. package/dist/components/menus/src/context/menu-context-item.js +2 -2
  224. package/dist/components/menus/src/context/menu-context-sub-trigger.js +4 -19
  225. package/dist/components/menus/src/context/menu-context.d.ts +2 -2
  226. package/dist/components/menus/src/hooks/use-menu-base-refs.d.ts +12 -12
  227. package/dist/components/menus/src/hooks/use-menu-children.d.ts +16 -16
  228. package/dist/components/menus/src/hooks/use-menu-floating.d.ts +22 -22
  229. package/dist/components/menus/src/hooks/use-menu-refs.d.ts +8 -8
  230. package/dist/components/menus/src/hooks/use-menu-refs.js +2 -2
  231. package/dist/components/menus/src/hooks/use-menu-scroll-height.d.ts +11 -11
  232. package/dist/components/menus/src/hooks/use-menu-scroll.d.ts +18 -18
  233. package/dist/components/menus/src/hooks/use-menu-selection.d.ts +21 -21
  234. package/dist/components/menus/src/hooks/use-menu-state.d.ts +11 -11
  235. package/dist/components/menus/src/hooks/use-menu-state.js +4 -4
  236. package/dist/components/menus/src/hooks/use-menu-touch.d.ts +11 -11
  237. package/dist/components/menus/src/hooks/use-menu-tree.d.ts +15 -15
  238. package/dist/components/menus/src/index.d.ts +5 -0
  239. package/dist/components/menus/src/menus.js +2 -2
  240. package/dist/components/menus/src/tv.d.ts +15 -0
  241. package/dist/components/menus/src/tv.js +8 -2
  242. package/dist/components/modal/dist/index.d.ts +3 -1
  243. package/dist/components/modal/dist/index.js +18 -11
  244. package/dist/components/modal/src/components/modal-content.js +2 -2
  245. package/dist/components/modal/src/components/modal-footer.js +2 -2
  246. package/dist/components/modal/src/components/modal-header.d.ts +3 -1
  247. package/dist/components/modal/src/components/modal-header.js +12 -5
  248. package/dist/components/modal/src/modal.js +2 -2
  249. package/dist/components/multi-select/dist/index.js +13 -11
  250. package/dist/components/multi-select/src/components/multi-select-trigger.js +8 -8
  251. package/dist/components/multi-select/src/multi-select.js +5 -3
  252. package/dist/components/numeric-input/dist/index.d.ts +10 -117
  253. package/dist/components/numeric-input/dist/index.js +18 -24
  254. package/dist/components/numeric-input/src/components/numeric-input-element.js +2 -2
  255. package/dist/components/numeric-input/src/components/numeric-input-menu-trigger.d.ts +1 -1
  256. package/dist/components/numeric-input/src/components/numeric-input-menu-trigger.js +2 -2
  257. package/dist/components/numeric-input/src/components/numeric-input-variable.d.ts +1 -2
  258. package/dist/components/numeric-input/src/components/numeric-input-variable.js +3 -3
  259. package/dist/components/numeric-input/src/hooks/use-input-interactions.d.ts +3 -3
  260. package/dist/components/numeric-input/src/hooks/use-numeric-input.d.ts +3 -3
  261. package/dist/components/numeric-input/src/hooks/use-numeric-value-processing.d.ts +3 -3
  262. package/dist/components/numeric-input/src/hooks/use-step-calculation.d.ts +6 -6
  263. package/dist/components/numeric-input/src/index.d.ts +5 -4
  264. package/dist/components/numeric-input/src/numeric-input.js +9 -9
  265. package/dist/components/numeric-input/src/utils/error-handler.d.ts +8 -8
  266. package/dist/components/numeric-input/src/utils/expression-evaluator.d.ts +11 -11
  267. package/dist/components/numeric-input/src/utils/input-parser.d.ts +8 -8
  268. package/dist/components/numeric-input/src/utils/numeric-value-processor.d.ts +6 -6
  269. package/dist/components/numeric-input/src/utils/pattern-parser.d.ts +7 -7
  270. package/dist/components/numeric-input/src/utils/value-comparator.d.ts +16 -16
  271. package/dist/components/numeric-input/src/utils/value-processor.d.ts +14 -14
  272. package/dist/components/pagination/src/components/pagination-items-per-page.js +1 -1
  273. package/dist/components/pagination/src/components/pagination-navigation.js +5 -5
  274. package/dist/components/pagination/src/components/pagination-root.js +3 -3
  275. package/dist/components/pagination/src/components/pagination-spinner.js +20 -19
  276. package/dist/components/pagination/src/context/index.d.ts +1 -0
  277. package/dist/components/popover/dist/index.d.ts +3 -8
  278. package/dist/components/popover/dist/index.js +22 -16
  279. package/dist/components/popover/src/components/popover-header.js +1 -1
  280. package/dist/components/popover/src/hooks/use-drag.d.ts +3 -3
  281. package/dist/components/popover/src/hooks/use-floating-popover.d.ts +4 -3
  282. package/dist/components/popover/src/hooks/use-floating-popover.js +19 -10
  283. package/dist/components/popover/src/index.d.ts +2 -1
  284. package/dist/components/popover/src/popover.d.ts +2 -6
  285. package/dist/components/popover/src/popover.js +6 -8
  286. package/dist/components/progress/src/index.d.ts +4 -2
  287. package/dist/components/radio/dist/index.d.ts +1 -17
  288. package/dist/components/radio/dist/index.js +7 -10
  289. package/dist/components/radio/src/context.js +1 -1
  290. package/dist/components/radio/src/index.d.ts +0 -4
  291. package/dist/components/radio/src/radio-label.js +2 -2
  292. package/dist/components/radio/src/radio.js +4 -4
  293. package/dist/components/range/dist/index.js +16 -16
  294. package/dist/components/range/src/index.d.ts +4 -2
  295. package/dist/components/range/src/range-tuple.js +10 -10
  296. package/dist/components/range/src/range.js +6 -6
  297. package/dist/components/rich-input/dist/index.d.ts +12 -366
  298. package/dist/components/rich-input/src/components/rich-input-editable-component.d.ts +2 -2
  299. package/dist/components/rich-input/src/components/rich-input-viewport.d.ts +2 -2
  300. package/dist/components/rich-input/src/hooks/use-editor-config.d.ts +1 -1
  301. package/dist/components/rich-input/src/hooks/use-editor-effects.js +3 -0
  302. package/dist/components/rich-input/src/hooks/use-floating-ui.js +1 -1
  303. package/dist/components/rich-input/src/hooks/use-keyboard-shortcuts.d.ts +9 -9
  304. package/dist/components/rich-input/src/hooks/use-rich-input.d.ts +2 -2
  305. package/dist/components/rich-input/src/hooks/use-rich-input.js +40 -17
  306. package/dist/components/rich-input/src/hooks/use-selection-events.js +1 -2
  307. package/dist/components/rich-input/src/index.d.ts +3 -5
  308. package/dist/components/rich-input/src/rich-input-base.js +1 -1
  309. package/dist/components/rich-input/src/utils/custom-options.js +1 -1
  310. package/dist/components/rich-input/src/utils/editor-utils.js +1 -1
  311. package/dist/components/rich-input/src/utils/markdown-to-slate.d.ts +2 -2
  312. package/dist/components/rich-input/src/utils/slate-to-markdown.d.ts +1 -1
  313. package/dist/components/rich-input/src/utils/slate-to-markdown.js +9 -0
  314. package/dist/components/scroll-area/dist/index.d.ts +19 -19
  315. package/dist/components/scroll-area/dist/index.js +24 -24
  316. package/dist/components/scroll-area/src/components/scroll-area-corner.js +2 -2
  317. package/dist/components/scroll-area/src/components/scroll-area-root.js +3 -3
  318. package/dist/components/scroll-area/src/components/scroll-area-scrollbar.js +2 -2
  319. package/dist/components/scroll-area/src/components/scroll-area-thumb.js +2 -2
  320. package/dist/components/scroll-area/src/hooks/use-scroll-performance-monitor.d.ts +6 -6
  321. package/dist/components/scroll-area/src/hooks/use-scroll-performance-monitor.js +3 -3
  322. package/dist/components/scroll-area/src/hooks/use-scroll-state-and-visibility.d.ts +1 -1
  323. package/dist/components/scroll-area/src/hooks/use-scroll-state-and-visibility.js +3 -3
  324. package/dist/components/scroll-area/src/hooks/use-scrollbar.d.ts +2 -2
  325. package/dist/components/scroll-area/src/hooks/use-thumb.d.ts +2 -2
  326. package/dist/components/scroll-area/src/tv.d.ts +18 -18
  327. package/dist/components/scroll-area/src/tv.js +12 -12
  328. package/dist/components/scroll-area/src/types.d.ts +8 -8
  329. package/dist/components/scroll-area/src/utils/index.d.ts +3 -3
  330. package/dist/components/search-input/dist/index.js +3 -3
  331. package/dist/components/search-input/src/index.d.ts +2 -1
  332. package/dist/components/search-input/src/search-input.js +3 -3
  333. package/dist/components/segmented/dist/index.js +5 -5
  334. package/dist/components/segmented/src/segmented-item.js +3 -3
  335. package/dist/components/segmented/src/segmented.js +2 -2
  336. package/dist/components/select/dist/index.js +4 -4
  337. package/dist/components/select/src/select.js +4 -4
  338. package/dist/components/separator/dist/index.d.ts +26 -0
  339. package/dist/components/separator/src/index.d.ts +2 -0
  340. package/dist/components/separator/src/separator.d.ts +22 -0
  341. package/dist/components/separator/src/separator.js +33 -0
  342. package/dist/components/separator/src/tv.d.ts +76 -0
  343. package/dist/components/separator/src/tv.js +25 -0
  344. package/dist/components/separator/tsup.config.d.ts +2 -0
  345. package/dist/components/skeleton/dist/index.d.ts +1 -28
  346. package/dist/components/skeleton/src/context/skeleton-context.js +1 -1
  347. package/dist/components/skeleton/src/hooks/use-skeleton.d.ts +1 -2
  348. package/dist/components/skeleton/src/hooks/use-skeleton.js +1 -1
  349. package/dist/components/skeleton/src/index.d.ts +1 -3
  350. package/dist/components/skeleton/src/skeleton.d.ts +0 -13
  351. package/dist/components/skeleton/src/skeleton.js +4 -6
  352. package/dist/components/skeleton/src/tv.d.ts +18 -12
  353. package/dist/components/skeleton/src/tv.js +10 -6
  354. package/dist/components/slot/dist/index.d.ts +10 -10
  355. package/dist/components/slot/dist/index.js +4 -2
  356. package/dist/components/slot/src/slot.d.ts +12 -12
  357. package/dist/components/slot/src/slot.js +6 -3
  358. package/dist/components/stackflow/src/context.js +1 -1
  359. package/dist/components/stackflow/src/index.d.ts +2 -1
  360. package/dist/components/switch/dist/index.d.ts +2 -2
  361. package/dist/components/switch/dist/index.js +6 -7
  362. package/dist/components/switch/src/index.d.ts +2 -1
  363. package/dist/components/switch/src/switch.js +6 -6
  364. package/dist/components/table/dist/index.d.ts +679 -0
  365. package/dist/components/table/index.d.ts +1 -0
  366. package/dist/components/table/src/components/column-resizer.d.ts +8 -0
  367. package/dist/components/table/src/components/column-resizer.js +58 -0
  368. package/dist/components/table/src/components/drag-guide.d.ts +6 -0
  369. package/dist/components/table/src/components/drag-guide.js +64 -0
  370. package/dist/components/table/src/components/index.d.ts +12 -0
  371. package/dist/components/table/src/components/resize-guide.d.ts +5 -0
  372. package/dist/components/table/src/components/resize-guide.js +25 -0
  373. package/dist/components/table/src/components/table-body.d.ts +6 -0
  374. package/dist/components/table/src/components/table-body.js +335 -0
  375. package/dist/components/table/src/components/table-cell.d.ts +6 -0
  376. package/dist/components/table/src/components/table-cell.js +89 -0
  377. package/dist/components/table/src/components/table-column.d.ts +5 -0
  378. package/dist/components/table/src/components/table-column.js +269 -0
  379. package/dist/components/table/src/components/table-empty.d.ts +8 -0
  380. package/dist/components/table/src/components/table-empty.js +10 -0
  381. package/dist/components/table/src/components/table-footer.d.ts +7 -0
  382. package/dist/components/table/src/components/table-footer.js +15 -0
  383. package/dist/components/table/src/components/table-header.d.ts +3 -0
  384. package/dist/components/table/src/components/table-header.js +88 -0
  385. package/dist/components/table/src/components/table-root.d.ts +3 -0
  386. package/dist/components/table/src/components/table-root.js +317 -0
  387. package/dist/components/table/src/components/table-row.d.ts +23 -0
  388. package/dist/components/table/src/components/table-row.js +166 -0
  389. package/dist/components/table/src/components/table-value.d.ts +6 -0
  390. package/dist/components/table/src/components/table-value.js +8 -0
  391. package/dist/components/table/src/context.d.ts +121 -0
  392. package/dist/components/table/src/context.js +63 -0
  393. package/dist/components/table/src/hooks/index.d.ts +4 -0
  394. package/dist/components/table/src/hooks/use-column-order.d.ts +26 -0
  395. package/dist/components/table/src/hooks/use-column-order.js +95 -0
  396. package/dist/components/table/src/hooks/use-column-resize.d.ts +17 -0
  397. package/dist/components/table/src/hooks/use-column-resize.js +75 -0
  398. package/dist/components/table/src/hooks/use-consecutive-selection-style.d.ts +12 -0
  399. package/dist/components/table/src/hooks/use-consecutive-selection-style.js +28 -0
  400. package/dist/components/table/src/hooks/use-table.d.ts +35 -0
  401. package/dist/components/table/src/hooks/use-table.js +245 -0
  402. package/dist/components/table/src/index.d.ts +4 -0
  403. package/dist/components/table/src/table.d.ts +88 -0
  404. package/dist/components/table/src/table.js +24 -0
  405. package/dist/components/table/src/tv.d.ts +176 -0
  406. package/dist/components/table/src/tv.js +97 -0
  407. package/dist/components/table/src/types.d.ts +292 -0
  408. package/dist/components/table/tsup.config.d.ts +2 -0
  409. package/dist/components/tabs/dist/index.js +4 -3
  410. package/dist/components/tabs/src/tabs.d.ts +2 -2
  411. package/dist/components/tabs/src/tabs.js +5 -4
  412. package/dist/components/text-field/dist/index.d.ts +1 -1
  413. package/dist/components/text-field/dist/index.js +10 -10
  414. package/dist/components/text-field/src/components/field-addon.d.ts +1 -2
  415. package/dist/components/text-field/src/index.d.ts +3 -1
  416. package/dist/components/text-field/src/text-field.js +10 -10
  417. package/dist/components/textarea/dist/index.d.ts +33 -5
  418. package/dist/components/textarea/dist/index.js +32 -7
  419. package/dist/components/textarea/src/components/autosize/index.d.ts +6 -1
  420. package/dist/components/textarea/src/components/autosize/index.js +31 -6
  421. package/dist/components/textarea/src/textarea.js +1 -1
  422. package/dist/components/textarea/src/types.d.ts +33 -5
  423. package/dist/components/toggle-button/dist/index.d.ts +26 -2
  424. package/dist/components/toggle-button/src/context.d.ts +11 -0
  425. package/dist/components/toggle-button/src/context.js +13 -0
  426. package/dist/components/toggle-button/src/index.d.ts +2 -0
  427. package/dist/components/toggle-button/src/toggle-button.js +4 -4
  428. package/dist/components/toggle-button/src/toggle-group.d.ts +26 -0
  429. package/dist/components/toggle-button/src/toggle-group.js +156 -0
  430. package/dist/components/toggle-button/src/tv.d.ts +67 -3
  431. package/dist/components/toggle-button/src/tv.js +45 -14
  432. package/dist/components/tooltip/dist/index.d.ts +10 -43
  433. package/dist/components/tooltip/dist/index.js +35 -33
  434. package/dist/components/tooltip/src/components/tooltip-arrow.js +1 -1
  435. package/dist/components/tooltip/src/components/tooltip-content.js +5 -4
  436. package/dist/components/tooltip/src/context/index.d.ts +1 -0
  437. package/dist/components/tooltip/src/hooks/use-tooltip.js +3 -3
  438. package/dist/components/tooltip/src/index.d.ts +2 -4
  439. package/dist/components/tooltip/src/tooltip.d.ts +7 -1
  440. package/dist/components/tooltip/src/tooltip.js +6 -1
  441. package/dist/components/tooltip/src/tv.js +1 -1
  442. package/dist/components/virtualized-grid/dist/index.d.ts +2 -2
  443. package/dist/components/virtualized-grid/src/use-item-pool.js +14 -26
  444. package/dist/components/virtualized-grid/src/use-virtualized-grid.d.ts +1 -1
  445. package/dist/components/virtualized-grid/src/use-virtualized-grid.js +14 -8
  446. package/dist/components/virtualized-grid/src/utility.d.ts +1 -1
  447. package/dist/components/virtualized-grid/src/utility.js +37 -31
  448. package/dist/components/virtualized-grid/src/virtualized-grid.js +27 -17
  449. package/dist/context/choice-ui-provider.d.ts +35 -0
  450. package/dist/context/choice-ui-provider.js +14 -0
  451. package/dist/context/index.d.ts +2 -0
  452. package/dist/index.d.ts +1 -0
  453. package/dist/index.js +50 -195
  454. package/package.json +1 -1
  455. package/dist/components/code-block/src/index.js +0 -15
  456. package/dist/components/rich-input/src/hooks/use-mouse-events.js +0 -113
  457. package/dist/components/rich-input/src/hooks/use-validation.js +0 -80
  458. package/dist/components/rich-input/src/utils/markdown-to-slate.js +0 -219
  459. /package/dist/components/command/src/{command-score.d.ts → utils/command-score.d.ts} +0 -0
  460. /package/dist/components/command/src/{command-score.js → utils/command-score.js} +0 -0
  461. /package/dist/components/pagination/src/{components → context}/pagination-context.d.ts +0 -0
  462. /package/dist/components/pagination/src/{components → context}/pagination-context.js +0 -0
@@ -8,7 +8,7 @@ const NumericInputElement = memo(
8
8
  const { type = "handler", className, position, children } = props;
9
9
  const context = useNumericInputContext();
10
10
  const handlerProps = context.handlerProps;
11
- const elementClassName = NumericInputElementTv({
11
+ const tv = NumericInputElementTv({
12
12
  type,
13
13
  position,
14
14
  disabled: context.disabled,
@@ -22,7 +22,7 @@ const NumericInputElement = memo(
22
22
  "div",
23
23
  {
24
24
  ref,
25
- className: tcx(elementClassName, className),
25
+ className: tcx(tv, className),
26
26
  "data-element-position": position,
27
27
  "data-element-type": type,
28
28
  ...elementProps,
@@ -1,6 +1,6 @@
1
1
  import { IconButtonProps } from '../../../icon-button/src';
2
2
  import { HTMLProps } from 'react';
3
- interface NumericInputMenuTriggerProps extends IconButtonProps {
3
+ export interface NumericInputMenuTriggerProps extends IconButtonProps {
4
4
  className?: string;
5
5
  type?: "menu" | "action";
6
6
  }
@@ -9,7 +9,7 @@ const NumericInputMenuTrigger = forwardRef(
9
9
  (props, ref) => {
10
10
  const { className, type = "menu", ...rest } = props;
11
11
  const context = useNumericInputContext();
12
- const style = NumericInputMenuTriggerTv({
12
+ const tv = NumericInputMenuTriggerTv({
13
13
  type,
14
14
  disabled: context.disabled,
15
15
  variant: context.variant
@@ -19,7 +19,7 @@ const NumericInputMenuTrigger = forwardRef(
19
19
  {
20
20
  ref,
21
21
  variant: type === "menu" ? context.disabled ? "ghost" : "solid" : void 0,
22
- className: tcx(style, className),
22
+ className: tcx(tv, className),
23
23
  disabled: context.disabled,
24
24
  ...rest,
25
25
  children: /* @__PURE__ */ jsx(ChevronDownSmall, {})
@@ -1,8 +1,7 @@
1
- interface NumericInputVariableProps {
1
+ export interface NumericInputVariableProps {
2
2
  className?: string;
3
3
  hasPrefixElement?: boolean;
4
4
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
5
5
  value?: number | null;
6
6
  }
7
7
  export declare const NumericInputVariable: import('react').ForwardRefExoticComponent<NumericInputVariableProps & import('react').RefAttributes<HTMLDivElement>>;
8
- export {};
@@ -8,17 +8,17 @@ const NumericInputVariable = forwardRef(
8
8
  (props, ref) => {
9
9
  const { onClick, className, hasPrefixElement, value } = props;
10
10
  const context = useNumericInputContext();
11
- const styles = NumericInputVariableTv({
11
+ const tv = NumericInputVariableTv({
12
12
  prefixElement: hasPrefixElement,
13
13
  variant: context.variant,
14
14
  disabled: context.disabled,
15
15
  selected: context.selected
16
16
  });
17
- return /* @__PURE__ */ jsx("div", { className: tcx(styles.root(), className), children: /* @__PURE__ */ jsx(
17
+ return /* @__PURE__ */ jsx("div", { className: tcx(tv.root(), className), children: /* @__PURE__ */ jsx(
18
18
  Chip,
19
19
  {
20
20
  as: "button",
21
- className: styles.chip(),
21
+ className: tv.chip(),
22
22
  ref,
23
23
  onClick: (e) => {
24
24
  e.stopPropagation();
@@ -21,9 +21,9 @@ interface UseInputInteractionsProps<T extends NumericInputValue> {
21
21
  value?: T;
22
22
  }
23
23
  /**
24
- * 处理输入框交互的钩子
25
- * @param props 输入交互配置
26
- * @returns 输入处理器和初始值引用
24
+ * Hook to handle input box interactions
25
+ * @param props Input interaction configuration
26
+ * @returns Input handlers and initial value reference
27
27
  */
28
28
  export declare function useInputInteractions<T extends NumericInputValue>({ inputRef, displayValue, setDisplayValue, isFocused, setIsFocused, expression, min, max, decimal, disabled, readOnly, innerValue, setValue, updateValue, getCurrentStep, onChange, onEmpty, value, }: UseInputInteractionsProps<T>): {
29
29
  inputHandlers: {
@@ -20,9 +20,9 @@ interface UseNumericInputProps<T extends NumericInputValue> extends Omit<HTMLPro
20
20
  value?: T;
21
21
  }
22
22
  /**
23
- * 数值输入控件的主钩子,整合各种交互功能
24
- * @param props 配置选项
25
- * @returns 处理状态和事件处理器
23
+ * Main hook for numeric input component, integrating various interaction features
24
+ * @param props Configuration options
25
+ * @returns State management and event handlers
26
26
  */
27
27
  export declare function useNumericInput<T extends NumericInputValue>(props: UseNumericInputProps<T>): {
28
28
  handlerPressed: boolean;
@@ -8,9 +8,9 @@ interface UseNumericValueProcessingProps<T extends NumericInputValue> {
8
8
  value?: T;
9
9
  }
10
10
  /**
11
- * 处理数值输入和转换的钩子
12
- * @param props 数值处理配置
13
- * @returns 处理后的值和表达式引用
11
+ * Hook to handle numeric input and conversion
12
+ * @param props Numeric processing configuration
13
+ * @returns Processed value and expression reference
14
14
  */
15
15
  export declare function useNumericValueProcessing<T extends NumericInputValue>({ value, defaultValue, expression, min, max, decimal, }: UseNumericValueProcessingProps<T>): {
16
16
  valuePre: import('../../..').NumberResult | undefined;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * 计算数值步进大小的钩子
3
- * @param shiftPressed Shift键是否按下
4
- * @param metaPressed Meta/Alt键是否按下
5
- * @param shiftStep Shift按下时的步进值
6
- * @param step 正常步进值
7
- * @returns 计算步进值的函数
2
+ * Hook to calculate the step size of numeric input
3
+ * @param shiftPressed Whether Shift key is pressed
4
+ * @param metaPressed Whether Meta/Alt key is pressed
5
+ * @param shiftStep Step size when Shift key is pressed
6
+ * @param step Normal step size
7
+ * @returns Function to calculate step size
8
8
  */
9
9
  export declare function useStepCalculation(shiftPressed: boolean, metaPressed: boolean, shiftStep: number, step: number): () => number;
@@ -1,4 +1,5 @@
1
- export * from './components';
2
- export * from './hooks';
3
- export * from './numeric-input';
4
- export type { NumberResult, NumericInputValue } from './types';
1
+ export { NumericInput } from './numeric-input';
2
+ export { NumericInputElement, NumericInputMenuTrigger, NumericInputVariable } from './components';
3
+ export type { NumericInputProps } from './numeric-input';
4
+ export type { NumericInputElementProps, NumericInputMenuTriggerProps, NumericInputVariableProps, } from './components';
5
+ export type { NumberResult, NumericChangeDetail, NumericInputValue } from './types';
@@ -3,9 +3,9 @@ import { Tooltip } from "../../tooltip/dist/index.js";
3
3
  import { forwardRef, useRef, useState, useMemo, cloneElement, Children, isValidElement } from "react";
4
4
  import { useEventCallback } from "usehooks-ts";
5
5
  import { NumericInputTv } from "./tv.js";
6
+ import { NumericInputMenuTrigger, NumericInputMenuActionPrompt } from "./components/numeric-input-menu-trigger.js";
6
7
  import { useNumericInput } from "./hooks/use-numeric-input.js";
7
8
  import { NumericInputContext } from "./context/numeric-input-context.js";
8
- import { NumericInputMenuTrigger, NumericInputMenuActionPrompt } from "./components/numeric-input-menu-trigger.js";
9
9
  import { NumericInputVariable } from "./components/numeric-input-variable.js";
10
10
  import { NumericInputElement } from "./components/numeric-input-element.js";
11
11
  import { mergeRefs } from "../../../shared/utils/merge-refs/merge-refs.js";
@@ -79,7 +79,7 @@ const NumericInputBase = forwardRef((props, ref) => {
79
79
  const contextValue = useMemo(
80
80
  () => ({
81
81
  variant,
82
- // 状态
82
+ // State
83
83
  value,
84
84
  defaultValue,
85
85
  disabled,
@@ -87,20 +87,20 @@ const NumericInputBase = forwardRef((props, ref) => {
87
87
  selected,
88
88
  focused,
89
89
  handlerPressed,
90
- // 配置
90
+ // Configuration
91
91
  min,
92
92
  max,
93
93
  step,
94
94
  shiftStep,
95
95
  decimal,
96
96
  expression,
97
- // 事件处理方法
97
+ // Event handling methods
98
98
  onChange,
99
99
  onEmpty,
100
100
  onPressStart,
101
101
  onPressEnd,
102
102
  onIsEditingChange,
103
- // 处理程序
103
+ // Handler props
104
104
  handlerProps
105
105
  }),
106
106
  [
@@ -158,7 +158,7 @@ const NumericInputBase = forwardRef((props, ref) => {
158
158
  const suffixNode = suffix[0] || null;
159
159
  const variableNode = variable[0] || null;
160
160
  const actionPromptNode = actionPrompt[0] || null;
161
- const styles = NumericInputTv({
161
+ const tv = NumericInputTv({
162
162
  variant,
163
163
  selected: selected || handlerPressed,
164
164
  focused,
@@ -171,7 +171,7 @@ const NumericInputBase = forwardRef((props, ref) => {
171
171
  "div",
172
172
  {
173
173
  ref: triggerRef,
174
- className: tcx(styles.container(), classNames == null ? void 0 : classNames.container, className),
174
+ className: tcx(tv.container(), classNames == null ? void 0 : classNames.container, className),
175
175
  onMouseDown: (e) => {
176
176
  e.stopPropagation();
177
177
  },
@@ -192,7 +192,7 @@ const NumericInputBase = forwardRef((props, ref) => {
192
192
  autoComplete: "off",
193
193
  spellCheck: false,
194
194
  required,
195
- className: tcx("[grid-area:input]", styles.input(), classNames == null ? void 0 : classNames.input),
195
+ className: tcx("[grid-area:input]", tv.input(), classNames == null ? void 0 : classNames.input),
196
196
  disabled,
197
197
  "aria-label": ariaLabel,
198
198
  "aria-describedby": ariaDescribedby,
@@ -208,7 +208,7 @@ const NumericInputBase = forwardRef((props, ref) => {
208
208
  "span",
209
209
  {
210
210
  tabIndex: -1,
211
- className: styles.tooltip(),
211
+ className: tv.tooltip(),
212
212
  onFocusCapture: () => {
213
213
  if (inputRef.current) {
214
214
  inputRef.current.focus();
@@ -1,32 +1,32 @@
1
1
  /**
2
- * 自定义错误类型
2
+ * Custom error type
3
3
  */
4
4
  export declare class NumericInputError extends Error {
5
5
  code: string;
6
6
  constructor(message: string, code?: string);
7
7
  }
8
8
  /**
9
- * 表达式解析错误
9
+ * Expression parsing error
10
10
  */
11
11
  export declare class ExpressionParseError extends NumericInputError {
12
12
  constructor(expression: string, details?: string);
13
13
  }
14
14
  /**
15
- * 模式解析错误
15
+ * Pattern parsing error
16
16
  */
17
17
  export declare class PatternParseError extends NumericInputError {
18
18
  constructor(pattern: string, details?: string);
19
19
  }
20
20
  /**
21
- * 输入值类型错误
21
+ * Input value type error
22
22
  */
23
23
  export declare class InvalidInputTypeError extends NumericInputError {
24
24
  constructor(input: any, expectedType?: string);
25
25
  }
26
26
  /**
27
- * 安全的错误处理封装
28
- * @param fn 要执行的函数
29
- * @param fallback 出错时的默认返回值
30
- * @returns 函数执行结果或默认值
27
+ * Safe error handling wrapper
28
+ * @param fn Function to execute
29
+ * @param fallback Default return value when error occurs
30
+ * @returns Function execution result or default value
31
31
  */
32
32
  export declare function safeExecute<T, R>(fn: (arg: T) => R, arg: T, fallback: R): R;
@@ -1,25 +1,25 @@
1
1
  import { Operation } from '../types';
2
2
  /**
3
- * 执行二元操作
3
+ * Execute binary operation
4
4
  * @param op 操作符
5
- * @param b 右操作数
6
- * @param a 左操作数
7
- * @returns 计算结果
5
+ * @param b Right operand
6
+ * @param a Left operand
7
+ * @returns Calculation result
8
8
  */
9
9
  export declare const applyOperation: (op: Operation, b: number, a: number) => number;
10
10
  /**
11
- * 评估数学表达式并返回计算结果
12
- * @param expression 数学表达式字符串
13
- * @returns 表达式的计算结果
11
+ * Evaluate mathematical expression and return calculation result
12
+ * @param expression Mathematical expression string
13
+ * @returns Calculation result of the expression
14
14
  */
15
15
  export declare const evaluate: (expression: string) => number;
16
16
  /**
17
- * 记忆化包装函数,用于缓存表达式计算结果
18
- * @param fn 原始函数
19
- * @returns 具有缓存功能的函数
17
+ * Memoized wrapper function, used to cache expression calculation results
18
+ * @param fn Original function
19
+ * @returns Function with caching functionality
20
20
  */
21
21
  export declare function memoize<T extends string, R>(fn: (arg: T) => R): (arg: T) => R;
22
22
  /**
23
- * 记忆化的表达式计算函数
23
+ * Memoized expression calculation function
24
24
  */
25
25
  export declare const memoizedEvaluate: (arg: string) => number;
@@ -1,8 +1,8 @@
1
1
  import { NumericInputValue } from '../types';
2
2
  /**
3
- * 解析输入值,支持字符串、数字、数组和对象类型
4
- * @param input 输入值
5
- * @returns 解析后的数字数组
3
+ * Parse input value, support string, number, array and object types
4
+ * @param input Input value
5
+ * @returns Parsed number array
6
6
  */
7
7
  export declare function parseInputValue(input: NumericInputValue): {
8
8
  values: number[];
@@ -10,10 +10,10 @@ export declare function parseInputValue(input: NumericInputValue): {
10
10
  isObjectNumber: boolean;
11
11
  };
12
12
  /**
13
- * 从输入字符串中提取变量值
14
- * @param input 输入字符串
15
- * @param regex 匹配正则表达式
16
- * @param keys 变量键数组
17
- * @returns 提取的变量值
13
+ * Extract variable values from input string
14
+ * @param input Input string
15
+ * @param regex Matching regular expression
16
+ * @param keys Variable key array
17
+ * @returns Extracted variable values
18
18
  */
19
19
  export declare function extractValuesFromString(input: string, regex: RegExp, keys: string[]): Record<string, number> | null;
@@ -1,13 +1,13 @@
1
1
  import { DealWithNumericValueOptions, NumberResult } from '../types';
2
2
  /**
3
- * 安全处理数值输入,捕获异常并返回undefined
4
- * @param options 输入选项
5
- * @returns 处理结果或undefined(出错时)
3
+ * Safe handling of numeric input, capture exceptions and return undefined
4
+ * @param options Input options
5
+ * @returns Processing result or undefined (when error occurs)
6
6
  */
7
7
  export declare const dealWithNumericValueCatch: (options: DealWithNumericValueOptions) => NumberResult | undefined;
8
8
  /**
9
- * 主处理函数:处理各种类型的数值输入并应用约束
10
- * @param options 输入选项
11
- * @returns 处理结果对象
9
+ * Main processing function: process various types of numeric input and apply constraints
10
+ * @param options Input options
11
+ * @returns Processing result object
12
12
  */
13
13
  export declare const dealWithNumericInputValue: ({ input, pattern, call, max, min, decimal, }: DealWithNumericValueOptions) => NumberResult;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 解析模式字符串,提取变量键
3
- * @param pattern 模式字符串(如 "{value}px"
4
- * @returns 解析结果,包含变量键和正则表达式
2
+ * Parse pattern string, extract variable keys
3
+ * @param pattern Pattern string (e.g. "{value}px")
4
+ * @returns Parsed result, containing variable keys and regular expression
5
5
  */
6
6
  export declare function parsePattern(pattern: string): {
7
7
  keys: string[];
@@ -9,9 +9,9 @@ export declare function parsePattern(pattern: string): {
9
9
  regexPattern: string;
10
10
  };
11
11
  /**
12
- * 格式化结果,将变量值应用到模式字符串中
13
- * @param pattern 模式字符串
14
- * @param result 变量值对象
15
- * @returns 格式化后的字符串
12
+ * Format result, apply variable values to pattern string
13
+ * @param pattern Pattern string
14
+ * @param result Variable value object
15
+ * @returns Formatted string
16
16
  */
17
17
  export declare function formatResult(pattern: string, result: Record<string, number>): string;
@@ -1,29 +1,29 @@
1
1
  import { NumberResult } from '../types';
2
2
  /**
3
- * 比较两个数值数组是否相同
4
- * @param array1 第一个数组
5
- * @param array2 第二个数组
6
- * @returns 是否相同
3
+ * Compare two numeric arrays whether they are the same
4
+ * @param array1 First array
5
+ * @param array2 Second array
6
+ * @returns Whether they are the same
7
7
  */
8
8
  export declare function compareNumericArrays(array1: number[] | undefined, array2: number[] | undefined): boolean;
9
9
  /**
10
- * 比较两个对象是否相同
11
- * @param object1 第一个对象
12
- * @param object2 第二个对象
13
- * @returns 是否相同
10
+ * Compare two objects whether they are the same
11
+ * @param object1 First object
12
+ * @param object2 Second object
13
+ * @returns Whether they are the same
14
14
  */
15
15
  export declare function compareNumericObjects(object1: Record<string, number> | undefined, object2: Record<string, number> | undefined): boolean;
16
16
  /**
17
- * 比较两个 NumberResult 是否相同
18
- * @param result1 第一个结果
19
- * @param result2 第二个结果
20
- * @returns 是否相同
17
+ * Compare two NumberResult whether they are the same
18
+ * @param result1 First result
19
+ * @param result2 Second result
20
+ * @returns Whether they are the same
21
21
  */
22
22
  export declare function compareNumberResults(result1: NumberResult | undefined, result2: NumberResult | undefined): boolean;
23
23
  /**
24
- * 检查是否为表达式输入
25
- * @param displayValue 显示值
26
- * @param processedValue 处理后的值
27
- * @returns 是否为表达式输入
24
+ * Check whether it is an expression input
25
+ * @param displayValue Display value
26
+ * @param processedValue Processed value
27
+ * @returns Whether it is an expression input
28
28
  */
29
29
  export declare function isExpressionInput(displayValue: string, processedValue: NumberResult): boolean;
@@ -1,23 +1,23 @@
1
1
  /**
2
- * 应用数值约束(最小值、最大值、小数位数)
3
- * @param value 原始数值
4
- * @param min 最小值
5
- * @param max 最大值
6
- * @param decimal 小数位数
7
- * @returns 处理后的数值
2
+ * Apply numeric constraints (minimum value, maximum value, decimal places)
3
+ * @param value Original value
4
+ * @param min Minimum value
5
+ * @param max Maximum value
6
+ * @param decimal Decimal places
7
+ * @returns Processed value
8
8
  */
9
9
  export declare function applyConstraints(value: number, min?: number, max?: number, decimal?: number): number;
10
10
  /**
11
- * 批量应用约束到多个值
12
- * @param values 值对象
13
- * @param min 最小值
14
- * @param max 最大值
15
- * @param decimal 小数位数
11
+ * Batch apply constraints to multiple values
12
+ * @param values Value object
13
+ * @param min Minimum value
14
+ * @param max Maximum value
15
+ * @param decimal Decimal places
16
16
  */
17
17
  export declare function applyConstraintsToValues(values: Record<string, number>, min?: number, max?: number, decimal?: number): void;
18
18
  /**
19
- * 应用自定义转换函数到值
20
- * @param values 值对象
21
- * @param transformFn 转换函数
19
+ * Apply custom transformation function to values
20
+ * @param values Value object
21
+ * @param transformFn Transformation function
22
22
  */
23
23
  export declare function applyTransform(values: Record<string, number>, transformFn?: (value: number) => number): void;
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Segmented } from "../../../segmented/dist/index.js";
3
3
  import { forwardRef } from "react";
4
- import { usePaginationContext } from "./pagination-context.js";
4
+ import { usePaginationContext } from "../context/pagination-context.js";
5
5
  import { tcx } from "../../../../shared/utils/tcx/tcx.js";
6
6
  const PaginationItemsPerPage = forwardRef(
7
7
  (props, ref) => {
@@ -3,25 +3,25 @@ import { Button } from "../../../button/dist/index.js";
3
3
  import { EllipsisSmall } from "@choiceform/icons-react";
4
4
  import { forwardRef } from "react";
5
5
  import { paginationTv } from "../tv.js";
6
- import { usePaginationContext } from "./pagination-context.js";
6
+ import { usePaginationContext } from "../context/pagination-context.js";
7
7
  import { tcx } from "../../../../shared/utils/tcx/tcx.js";
8
8
  const PaginationNavigation = forwardRef(
9
9
  (props, ref) => {
10
10
  const { className, variant = (isActive) => isActive ? "solid" : "ghost", ...rest } = props;
11
11
  const { currentPage, pageNumbers, handlePageChange, labels, disabled, loading } = usePaginationContext();
12
- const styles = paginationTv();
12
+ const tv = paginationTv();
13
13
  return /* @__PURE__ */ jsx(
14
14
  "div",
15
15
  {
16
16
  ref,
17
- className: tcx(styles.pages(), className),
17
+ className: tcx(tv.pages(), className),
18
18
  ...rest,
19
19
  children: pageNumbers.map((pageNumber, index) => {
20
20
  if (pageNumber === "ellipsis") {
21
21
  return /* @__PURE__ */ jsx(
22
22
  "div",
23
23
  {
24
- className: styles.ellipsis(),
24
+ className: tv.ellipsis(),
25
25
  children: /* @__PURE__ */ jsx(EllipsisSmall, {})
26
26
  },
27
27
  `ellipsis-${index}`
@@ -37,7 +37,7 @@ const PaginationNavigation = forwardRef(
37
37
  onClick: () => handlePageChange(pageNumber),
38
38
  "aria-label": `${labels.page} ${pageNumber}`,
39
39
  "aria-current": isActive ? "page" : void 0,
40
- className: styles.pageButton({ active: isActive }),
40
+ className: tv.pageButton({ active: isActive }),
41
41
  children: pageNumber
42
42
  },
43
43
  pageNumber
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { paginationTv } from "../tv.js";
4
- import { PaginationContext } from "./pagination-context.js";
5
4
  import { getDefaultLabels } from "../utils/pagination-helpers.js";
6
5
  import { usePagination } from "../hooks/use-pagination.js";
6
+ import { PaginationContext } from "../context/pagination-context.js";
7
7
  import { tcx } from "../../../../shared/utils/tcx/tcx.js";
8
8
  const PaginationRoot = forwardRef((props, ref) => {
9
9
  const {
@@ -40,7 +40,7 @@ const PaginationRoot = forwardRef((props, ref) => {
40
40
  onItemsPerPageChange,
41
41
  disabled
42
42
  });
43
- const styles = paginationTv();
43
+ const tv = paginationTv();
44
44
  if (totalItems === 0) {
45
45
  return null;
46
46
  }
@@ -66,7 +66,7 @@ const PaginationRoot = forwardRef((props, ref) => {
66
66
  "div",
67
67
  {
68
68
  ref,
69
- className: tcx(styles.root(), className),
69
+ className: tcx(tv.root(), className),
70
70
  ...rest,
71
71
  children
72
72
  }
@@ -4,7 +4,7 @@ import { ChevronLeftMedium, ChevronRightMedium } from "@choiceform/icons-react";
4
4
  import { forwardRef, useState, useRef, useEffect } from "react";
5
5
  import { useOnClickOutside, useEventCallback } from "usehooks-ts";
6
6
  import { paginationSpinnerTv } from "../tv.js";
7
- import { usePaginationContext } from "./pagination-context.js";
7
+ import { usePaginationContext } from "../context/pagination-context.js";
8
8
  import { tcx } from "../../../../shared/utils/tcx/tcx.js";
9
9
  const PaginationSpinner = forwardRef(
10
10
  (props, ref) => {
@@ -20,7 +20,7 @@ const PaginationSpinner = forwardRef(
20
20
  }
21
21
  });
22
22
  const { currentPage, totalPages, handlePageChange, disabled } = usePaginationContext();
23
- const styles = paginationSpinnerTv();
23
+ const tv = paginationSpinnerTv();
24
24
  useEffect(() => {
25
25
  if (isEditing) {
26
26
  setInputValue(currentPage.toString());
@@ -29,15 +29,17 @@ const PaginationSpinner = forwardRef(
29
29
  useEffect(() => {
30
30
  if (isEditing && inputRef.current) {
31
31
  inputRef.current.focus();
32
- try {
33
- const timer = setTimeout(() => {
34
- if (inputRef.current && inputRef.current.setSelectionRange) {
35
- inputRef.current.setSelectionRange(0, inputRef.current.value.length);
36
- }
37
- }, 0);
38
- return () => clearTimeout(timer);
39
- } catch (e) {
40
- }
32
+ if (inputRef.current.type === "number") return;
33
+ const timer = setTimeout(() => {
34
+ const el = inputRef.current;
35
+ if (!el) return;
36
+ if (el.type === "number") return;
37
+ try {
38
+ el.setSelectionRange(0, el.value.length);
39
+ } catch {
40
+ }
41
+ }, 0);
42
+ return () => clearTimeout(timer);
41
43
  }
42
44
  }, [isEditing]);
43
45
  const handleInputChange = useEventCallback((e) => {
@@ -77,7 +79,7 @@ const PaginationSpinner = forwardRef(
77
79
  "div",
78
80
  {
79
81
  ref,
80
- className: tcx(styles.spinner(), className),
82
+ className: tcx(tv.spinner(), className),
81
83
  ...rest,
82
84
  children: [
83
85
  /* @__PURE__ */ jsx(
@@ -87,7 +89,7 @@ const PaginationSpinner = forwardRef(
87
89
  disabled: currentPage === 1 || disabled,
88
90
  onClick: handlePrevious,
89
91
  "aria-label": "Previous page",
90
- className: styles.button({ position: "left" }),
92
+ className: tv.button({ position: "left" }),
91
93
  children: /* @__PURE__ */ jsx(ChevronLeftMedium, {})
92
94
  }
93
95
  ),
@@ -95,7 +97,7 @@ const PaginationSpinner = forwardRef(
95
97
  "div",
96
98
  {
97
99
  ref: inputWrapperRef,
98
- className: styles.inputWrapper(),
100
+ className: tv.inputWrapper(),
99
101
  onClick: () => {
100
102
  if (!isEditing) {
101
103
  setIsEditing(true);
@@ -110,16 +112,15 @@ const PaginationSpinner = forwardRef(
110
112
  onChange: handleInputChange,
111
113
  onBlur: handleInputBlur,
112
114
  onKeyDown: handleInputKeyDown,
113
- onFocus: (e) => e.target.select(),
114
115
  type: "number",
115
116
  min: 1,
116
117
  max: totalPages,
117
118
  disabled,
118
- className: styles.input(),
119
+ className: tv.input(),
119
120
  autoFocus: true
120
121
  }
121
- ) : /* @__PURE__ */ jsx("span", { className: tcx(styles.currentPage()), children: currentPage }),
122
- /* @__PURE__ */ jsxs("span", { className: styles.label(), children: [
122
+ ) : /* @__PURE__ */ jsx("span", { className: tcx(tv.currentPage()), children: currentPage }),
123
+ /* @__PURE__ */ jsxs("span", { className: tv.label(), children: [
123
124
  "/ ",
124
125
  totalPages
125
126
  ] })
@@ -133,7 +134,7 @@ const PaginationSpinner = forwardRef(
133
134
  disabled: currentPage === totalPages || disabled,
134
135
  onClick: handleNext,
135
136
  "aria-label": "Next page",
136
- className: styles.button({ position: "right" }),
137
+ className: tv.button({ position: "right" }),
137
138
  children: /* @__PURE__ */ jsx(ChevronRightMedium, {})
138
139
  }
139
140
  )
@@ -0,0 +1 @@
1
+ export * from './pagination-context';