@tcn/ui 0.16.0 → 0.18.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 (437) hide show
  1. package/dist/actions/index.d.ts +0 -1
  2. package/dist/actions/index.d.ts.map +1 -1
  3. package/dist/actions/index.js +6 -8
  4. package/dist/actions/index.js.map +1 -1
  5. package/dist/card.css +1 -0
  6. package/dist/column.css +1 -1
  7. package/dist/containers.css +1 -1
  8. package/dist/containers.module-BmICKsOK.js +5 -0
  9. package/dist/containers.module-BmICKsOK.js.map +1 -0
  10. package/dist/draggable.css +1 -1
  11. package/dist/draggable.module-DFYR5n3n.js +5 -0
  12. package/dist/draggable.module-DFYR5n3n.js.map +1 -0
  13. package/dist/field_set.css +1 -1
  14. package/dist/field_set.module-BpJTFCi4.js +5 -0
  15. package/dist/field_set.module-BpJTFCi4.js.map +1 -0
  16. package/dist/form/field/field.js +17 -13
  17. package/dist/form/field/field.js.map +1 -1
  18. package/dist/form/field_set/field_set.d.ts +6 -10
  19. package/dist/form/field_set/field_set.d.ts.map +1 -1
  20. package/dist/form/field_set/field_set.js +33 -61
  21. package/dist/form/field_set/field_set.js.map +1 -1
  22. package/dist/form/field_set/legend.d.ts +20 -0
  23. package/dist/form/field_set/legend.d.ts.map +1 -0
  24. package/dist/form/field_set/legend.js +28 -0
  25. package/dist/form/field_set/legend.js.map +1 -0
  26. package/dist/form/index.d.ts +2 -1
  27. package/dist/form/index.d.ts.map +1 -1
  28. package/dist/form/index.js +24 -22
  29. package/dist/form/index.js.map +1 -1
  30. package/dist/inputs/color_input/color_input.js +2 -3
  31. package/dist/inputs/color_input/color_input.js.map +1 -1
  32. package/dist/inputs/color_input/color_picker.js +11 -7
  33. package/dist/inputs/color_input/color_picker.js.map +1 -1
  34. package/dist/inputs/combo_box/combo_box.js +24 -20
  35. package/dist/inputs/combo_box/combo_box.js.map +1 -1
  36. package/dist/inputs/date_picker/date_picker.js +19 -15
  37. package/dist/inputs/date_picker/date_picker.js.map +1 -1
  38. package/dist/inputs/date_picker/date_picker_header.d.ts.map +1 -1
  39. package/dist/inputs/date_picker/date_picker_header.js +15 -14
  40. package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
  41. package/dist/inputs/date_picker/date_picker_input.js +26 -23
  42. package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
  43. package/dist/inputs/date_picker/date_picker_time_selector.js +2 -3
  44. package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
  45. package/dist/inputs/date_picker/date_picker_year_input.js +2 -3
  46. package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
  47. package/dist/inputs/date_picker/date_picker_year_selector.js +24 -21
  48. package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
  49. package/dist/inputs/mask_input/key_capture_input.js +35 -31
  50. package/dist/inputs/mask_input/key_capture_input.js.map +1 -1
  51. package/dist/inputs/mask_input/mask_input.js +18 -14
  52. package/dist/inputs/mask_input/mask_input.js.map +1 -1
  53. package/dist/inputs/multiselect/multiselect.js +28 -24
  54. package/dist/inputs/multiselect/multiselect.js.map +1 -1
  55. package/dist/inputs/multiselect/multiselect_inline_values.d.ts.map +1 -1
  56. package/dist/inputs/multiselect/multiselect_inline_values.js +15 -15
  57. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  58. package/dist/inputs/multiselect/multiselect_values.js +16 -17
  59. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  60. package/dist/inputs/phone_number_input/phone_number_context.js +13 -9
  61. package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -1
  62. package/dist/inputs/phone_number_input/phone_number_input_adapter.js +2 -3
  63. package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -1
  64. package/dist/inputs/phone_number_input/sip_input.js +8 -9
  65. package/dist/inputs/phone_number_input/sip_input.js.map +1 -1
  66. package/dist/inputs/select/select.js +11 -8
  67. package/dist/inputs/select/select.js.map +1 -1
  68. package/dist/inputs/slider/slider.js +28 -24
  69. package/dist/inputs/slider/slider.js.map +1 -1
  70. package/dist/inputs/suggestions/suggestion_list.js +11 -8
  71. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  72. package/dist/inputs/switch/switch.js +29 -25
  73. package/dist/inputs/switch/switch.js.map +1 -1
  74. package/dist/inputs/unit_input/unit_input.js +21 -17
  75. package/dist/inputs/unit_input/unit_input.js.map +1 -1
  76. package/dist/layouts/containers/columns/columns.d.ts +6 -1
  77. package/dist/layouts/containers/columns/columns.d.ts.map +1 -1
  78. package/dist/layouts/containers/columns/columns.js +30 -7
  79. package/dist/layouts/containers/columns/columns.js.map +1 -1
  80. package/dist/layouts/containers/rail.d.ts +2 -5
  81. package/dist/layouts/containers/rail.d.ts.map +1 -1
  82. package/dist/layouts/containers/rail.js +17 -55
  83. package/dist/layouts/containers/rail.js.map +1 -1
  84. package/dist/layouts/containers/rows/index.d.ts +3 -0
  85. package/dist/layouts/containers/rows/index.d.ts.map +1 -0
  86. package/dist/layouts/containers/rows/index.js +7 -0
  87. package/dist/layouts/containers/rows/index.js.map +1 -0
  88. package/dist/layouts/containers/rows/row.d.ts +6 -0
  89. package/dist/layouts/containers/rows/row.d.ts.map +1 -0
  90. package/dist/layouts/containers/rows/row.js +20 -0
  91. package/dist/layouts/containers/rows/row.js.map +1 -0
  92. package/dist/layouts/containers/rows/rows.d.ts +11 -0
  93. package/dist/layouts/containers/rows/rows.d.ts.map +1 -0
  94. package/dist/layouts/containers/rows/rows.js +34 -0
  95. package/dist/layouts/containers/rows/rows.js.map +1 -0
  96. package/dist/layouts/containers/scaffold.d.ts +2 -5
  97. package/dist/layouts/containers/scaffold.d.ts.map +1 -1
  98. package/dist/layouts/containers/scaffold.js +17 -55
  99. package/dist/layouts/containers/scaffold.js.map +1 -1
  100. package/dist/layouts/index.d.ts +2 -0
  101. package/dist/layouts/index.d.ts.map +1 -1
  102. package/dist/layouts/index.js +26 -22
  103. package/dist/layouts/index.js.map +1 -1
  104. package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js +11 -7
  105. package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js.map +1 -1
  106. package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js +11 -7
  107. package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js.map +1 -1
  108. package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js +14 -10
  109. package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js.map +1 -1
  110. package/dist/multiselect_values.css +1 -1
  111. package/dist/navigation/tabs/state/link/tab_link.js +15 -11
  112. package/dist/navigation/tabs/state/link/tab_link.js.map +1 -1
  113. package/dist/overlay/frame/frame.d.ts.map +1 -1
  114. package/dist/overlay/frame/frame.js +117 -76
  115. package/dist/overlay/frame/frame.js.map +1 -1
  116. package/dist/overlay/menu/menu.js +21 -17
  117. package/dist/overlay/menu/menu.js.map +1 -1
  118. package/dist/overlay/popper/base/dismissal_decorator.js +3 -3
  119. package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
  120. package/dist/overlay/popper/context_popper.js +14 -10
  121. package/dist/overlay/popper/context_popper.js.map +1 -1
  122. package/dist/overlay/popper/element_popper.js +15 -11
  123. package/dist/overlay/popper/element_popper.js.map +1 -1
  124. package/dist/overlay/popper/legacy/popper.js +32 -28
  125. package/dist/overlay/popper/legacy/popper.js.map +1 -1
  126. package/dist/overlay/popper/preview_popper.js +16 -12
  127. package/dist/overlay/popper/preview_popper.js.map +1 -1
  128. package/dist/overlay/tethered/tethered.js +17 -13
  129. package/dist/overlay/tethered/tethered.js.map +1 -1
  130. package/dist/resizable.css +1 -0
  131. package/dist/resizable.module-ur5FBfxo.js +5 -0
  132. package/dist/resizable.module-ur5FBfxo.js.map +1 -0
  133. package/dist/resize_handle.css +1 -0
  134. package/dist/row.css +1 -0
  135. package/dist/stacks/box/box.d.ts +14 -0
  136. package/dist/stacks/box/box.d.ts.map +1 -1
  137. package/dist/stacks/box/box.js +104 -102
  138. package/dist/stacks/box/box.js.map +1 -1
  139. package/dist/stacks/box/detect_resize_bounds.d.ts +1 -0
  140. package/dist/stacks/box/detect_resize_bounds.d.ts.map +1 -1
  141. package/dist/stacks/box/detect_resize_bounds.js +22 -20
  142. package/dist/stacks/box/detect_resize_bounds.js.map +1 -1
  143. package/dist/stacks/box/end_resize_handle.js +5 -5
  144. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  145. package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
  146. package/dist/stacks/box/resize_handlers.js +12 -12
  147. package/dist/stacks/box/resize_handlers.js.map +1 -1
  148. package/dist/stacks/box/start_resize_handle.js +7 -7
  149. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  150. package/dist/stacks/box/types.d.ts +3 -2
  151. package/dist/stacks/box/types.d.ts.map +1 -1
  152. package/dist/stacks/h_collapsible_box.js +24 -20
  153. package/dist/stacks/h_collapsible_box.js.map +1 -1
  154. package/dist/stacks/v_collapsible_box.js +26 -22
  155. package/dist/stacks/v_collapsible_box.js.map +1 -1
  156. package/dist/surfaces/alert/alert.js +7 -8
  157. package/dist/surfaces/alert/alert.js.map +1 -1
  158. package/dist/surfaces/card/card.d.ts.map +1 -1
  159. package/dist/surfaces/card/card.js +14 -6
  160. package/dist/surfaces/card/card.js.map +1 -1
  161. package/dist/surfaces/pop_confirm/pop_confirm.js +4 -2
  162. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  163. package/dist/test-setup.d.ts +2 -0
  164. package/dist/test-setup.d.ts.map +1 -0
  165. package/dist/test-setup.js +10 -0
  166. package/dist/test-setup.js.map +1 -0
  167. package/dist/themes/stories/button_showcase.d.ts.map +1 -1
  168. package/dist/themes/stories/controls_fieldset.d.ts.map +1 -1
  169. package/dist/themes/stories/menu_showcase.d.ts.map +1 -1
  170. package/dist/themes/theme.d.ts.map +1 -1
  171. package/dist/themes/theme.js +17 -22
  172. package/dist/themes/theme.js.map +1 -1
  173. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  174. package/dist/themes/themes/ergo/ergo_theme.d.ts.map +1 -1
  175. package/dist/themes/themes/ergo/ergo_theme.js +653 -431
  176. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  177. package/dist/themes/themes/ergo/parts/actions.css +1 -0
  178. package/dist/themes/themes/ergo/parts/base.css +1 -0
  179. package/dist/themes/themes/ergo/parts/form.css +1 -0
  180. package/dist/themes/themes/ergo/parts/inputs.css +1 -0
  181. package/dist/themes/themes/ergo/parts/navigation.css +1 -0
  182. package/dist/themes/themes/windows_98/windows_98.css +1 -1
  183. package/dist/themes/themes/windows_98/windows_98_theme.js +32 -43
  184. package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
  185. package/dist/utils/decorators/clone_with_decorator.d.ts +21 -0
  186. package/dist/utils/decorators/clone_with_decorator.d.ts.map +1 -0
  187. package/dist/utils/decorators/clone_with_decorator.js +16 -0
  188. package/dist/utils/decorators/clone_with_decorator.js.map +1 -0
  189. package/dist/utils/decorators/draggable/context.d.ts.map +1 -0
  190. package/dist/utils/decorators/draggable/context.js.map +1 -0
  191. package/dist/utils/{dnd/handle.d.ts → decorators/draggable/drag_handle.d.ts} +1 -1
  192. package/dist/utils/decorators/draggable/drag_handle.d.ts.map +1 -0
  193. package/dist/utils/{dnd/handle.js → decorators/draggable/drag_handle.js} +2 -2
  194. package/dist/utils/decorators/draggable/drag_handle.js.map +1 -0
  195. package/dist/utils/decorators/draggable/draggable.d.ts.map +1 -0
  196. package/dist/utils/{dnd → decorators}/draggable/draggable.js +3 -3
  197. package/dist/utils/decorators/draggable/draggable.js.map +1 -0
  198. package/dist/utils/decorators/draggable/index.d.ts +11 -0
  199. package/dist/utils/decorators/draggable/index.d.ts.map +1 -0
  200. package/dist/utils/decorators/draggable/index.js +14 -0
  201. package/dist/utils/decorators/draggable/index.js.map +1 -0
  202. package/dist/utils/{dnd → decorators/draggable}/types.d.ts +1 -1
  203. package/dist/utils/decorators/draggable/types.d.ts.map +1 -0
  204. package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.d.ts +2 -2
  205. package/dist/utils/decorators/draggable/use_drag_container.d.ts.map +1 -0
  206. package/dist/utils/decorators/draggable/use_drag_container.js.map +1 -0
  207. package/dist/utils/decorators/draggable/use_draggable.d.ts.map +1 -0
  208. package/dist/utils/decorators/draggable/use_draggable.js.map +1 -0
  209. package/dist/utils/decorators/index.d.ts +3 -0
  210. package/dist/utils/decorators/index.d.ts.map +1 -0
  211. package/dist/utils/decorators/index.js +27 -0
  212. package/dist/utils/decorators/index.js.map +1 -0
  213. package/dist/utils/decorators/resizable/context.d.ts +4 -0
  214. package/dist/utils/decorators/resizable/context.d.ts.map +1 -0
  215. package/dist/utils/decorators/resizable/context.js +10 -0
  216. package/dist/utils/decorators/resizable/context.js.map +1 -0
  217. package/dist/utils/decorators/resizable/handle_config.d.ts +32 -0
  218. package/dist/utils/decorators/resizable/handle_config.d.ts.map +1 -0
  219. package/dist/utils/decorators/resizable/handle_config.js +62 -0
  220. package/dist/utils/decorators/resizable/handle_config.js.map +1 -0
  221. package/dist/utils/decorators/resizable/index.d.ts +10 -0
  222. package/dist/utils/decorators/resizable/index.d.ts.map +1 -0
  223. package/dist/utils/decorators/resizable/index.js +16 -0
  224. package/dist/utils/decorators/resizable/index.js.map +1 -0
  225. package/dist/utils/decorators/resizable/resizable.d.ts +11 -0
  226. package/dist/utils/decorators/resizable/resizable.d.ts.map +1 -0
  227. package/dist/utils/decorators/resizable/resizable.js +52 -0
  228. package/dist/utils/decorators/resizable/resizable.js.map +1 -0
  229. package/dist/utils/decorators/resizable/resize_handle.d.ts +7 -0
  230. package/dist/utils/decorators/resizable/resize_handle.d.ts.map +1 -0
  231. package/dist/utils/decorators/resizable/resize_handle.js +100 -0
  232. package/dist/utils/decorators/resizable/resize_handle.js.map +1 -0
  233. package/dist/utils/decorators/resizable/resize_strategy.d.ts +47 -0
  234. package/dist/utils/decorators/resizable/resize_strategy.d.ts.map +1 -0
  235. package/dist/utils/decorators/resizable/resize_strategy.js +108 -0
  236. package/dist/utils/decorators/resizable/resize_strategy.js.map +1 -0
  237. package/dist/utils/decorators/resizable/types.d.ts +28 -0
  238. package/dist/utils/decorators/resizable/types.d.ts.map +1 -0
  239. package/dist/utils/decorators/resizable/types.js +2 -0
  240. package/dist/utils/decorators/resizable/types.js.map +1 -0
  241. package/dist/utils/hooks/labelled_by_context.d.ts +21 -0
  242. package/dist/utils/hooks/labelled_by_context.d.ts.map +1 -0
  243. package/dist/utils/hooks/labelled_by_context.js +12 -0
  244. package/dist/utils/hooks/labelled_by_context.js.map +1 -0
  245. package/dist/utils/index.d.ts +8 -7
  246. package/dist/utils/index.d.ts.map +1 -1
  247. package/dist/utils/index.js +45 -28
  248. package/dist/utils/index.js.map +1 -1
  249. package/dist/utils/listeners/click_away_listener.d.ts.map +1 -0
  250. package/dist/utils/{click_away_listener.js → listeners/click_away_listener.js} +1 -1
  251. package/dist/utils/listeners/click_away_listener.js.map +1 -0
  252. package/dist/utils/listeners/focus_redirect.d.ts.map +1 -0
  253. package/dist/utils/listeners/focus_redirect.js.map +1 -0
  254. package/dist/utils/listeners/index.d.ts +4 -0
  255. package/dist/utils/listeners/index.d.ts.map +1 -0
  256. package/dist/utils/listeners/index.js +10 -0
  257. package/dist/utils/listeners/index.js.map +1 -0
  258. package/dist/utils/listeners/mouse_leave_region.d.ts.map +1 -0
  259. package/dist/utils/listeners/mouse_leave_region.js.map +1 -0
  260. package/dist/utils/listeners/scroll_away_listener.d.ts.map +1 -0
  261. package/dist/utils/{scroll_away_listener.js → listeners/scroll_away_listener.js} +1 -1
  262. package/dist/utils/listeners/scroll_away_listener.js.map +1 -0
  263. package/dist/utils/system/index.d.ts +2 -0
  264. package/dist/utils/system/index.d.ts.map +1 -0
  265. package/dist/utils/system/index.js +2 -0
  266. package/dist/utils/system/index.js.map +1 -0
  267. package/dist/utils/system/variations.d.ts.map +1 -0
  268. package/dist/utils/system/variations.js +2 -0
  269. package/dist/utils/system/variations.js.map +1 -0
  270. package/dist/utils/types/sides.d.ts +3 -0
  271. package/dist/utils/types/sides.d.ts.map +1 -0
  272. package/package.json +3 -9
  273. package/src/actions/button/__stories__/button_group.stories.tsx +23 -24
  274. package/src/actions/index.ts +0 -1
  275. package/src/form/field/field.stories.tsx +2 -2
  276. package/src/form/field/h_field/h_field.stories.tsx +1 -1
  277. package/src/form/field/v_field/v_field.stories.tsx +1 -1
  278. package/src/form/field_set/field_set.module.css +0 -14
  279. package/src/form/field_set/field_set.stories.tsx +101 -1
  280. package/src/form/field_set/field_set.tsx +43 -57
  281. package/src/form/field_set/legend.tsx +44 -0
  282. package/src/form/index.ts +6 -1
  283. package/src/inputs/date_picker/date_picker_header.tsx +7 -5
  284. package/src/inputs/date_picker/date_picker_year_selector.tsx +5 -5
  285. package/src/inputs/multiselect/multiselect_inline_values.tsx +4 -3
  286. package/src/inputs/multiselect/multiselect_values.module.css +1 -0
  287. package/src/inputs/multiselect/multiselect_values.tsx +4 -4
  288. package/src/layouts/__stories__/columns.stories.tsx +31 -0
  289. package/src/layouts/__stories__/composed.stories.tsx +77 -8
  290. package/src/layouts/__stories__/rows.stories.tsx +77 -0
  291. package/src/layouts/__stories__/utils.tsx +2 -84
  292. package/src/layouts/containers/columns/column.module.css +3 -2
  293. package/src/layouts/containers/columns/columns.tsx +29 -3
  294. package/src/layouts/containers/containers.module.css +27 -29
  295. package/src/layouts/containers/rail.tsx +9 -51
  296. package/src/layouts/containers/rows/index.ts +2 -0
  297. package/src/layouts/containers/rows/row.module.css +15 -0
  298. package/src/layouts/containers/rows/row.tsx +22 -0
  299. package/src/layouts/containers/rows/rows.tsx +42 -0
  300. package/src/layouts/containers/scaffold.tsx +9 -49
  301. package/src/layouts/index.ts +2 -0
  302. package/src/overlay/frame/frame.stories.tsx +2 -1
  303. package/src/overlay/frame/frame.tsx +68 -20
  304. package/src/overlay/popper/base/dismissal_decorator.tsx +3 -3
  305. package/src/overlay/slide/slide.stories.tsx +1 -1
  306. package/src/stacks/box/box.tsx +29 -4
  307. package/src/stacks/box/detect_resize_bounds.ts +5 -1
  308. package/src/stacks/box/end_resize_handle.tsx +1 -1
  309. package/src/stacks/box/resize_handlers.ts +1 -1
  310. package/src/stacks/box/start_resize_handle.tsx +1 -1
  311. package/src/stacks/box/types.ts +3 -2
  312. package/src/stacks/collapsible_box.stories.tsx +5 -5
  313. package/src/stacks/demo.stories.tsx +7 -7
  314. package/src/surfaces/card/card.module.css +5 -0
  315. package/src/surfaces/card/card.stories.tsx +66 -8
  316. package/src/surfaces/card/card.tsx +6 -2
  317. package/src/surfaces/page/page.stories.tsx +84 -4
  318. package/src/surfaces/panel/__stories__/panel.stories.tsx +84 -9
  319. package/src/surfaces/window/window.stories.tsx +1 -1
  320. package/src/test-setup.ts +11 -0
  321. package/src/themes/stories/button_showcase.tsx +3 -1
  322. package/src/themes/stories/controls_fieldset.tsx +3 -1
  323. package/src/themes/stories/menu_showcase.tsx +3 -1
  324. package/src/themes/theme.tsx +6 -16
  325. package/src/themes/themes/ergo/INTERACTIVE.md +89 -0
  326. package/src/themes/themes/ergo/ROADMAP.md +116 -0
  327. package/src/themes/themes/ergo/ergo_theme.css +219 -734
  328. package/src/themes/themes/ergo/ergo_theme.ts +15 -1
  329. package/src/themes/themes/ergo/parts/actions.css +287 -0
  330. package/src/themes/themes/ergo/parts/base.css +62 -0
  331. package/src/themes/themes/ergo/parts/form.css +23 -0
  332. package/src/themes/themes/ergo/parts/inputs.css +252 -0
  333. package/src/themes/themes/ergo/parts/navigation.css +104 -0
  334. package/src/themes/themes/windows_98/windows_98.css +32 -43
  335. package/src/tokens/chip/chip.stories.tsx +5 -5
  336. package/src/utils/decorators/DECORATOR_PATTERN.md +86 -0
  337. package/src/utils/decorators/clone_with_decorator.ts +47 -0
  338. package/src/utils/{dnd → decorators/draggable}/__stories__/draggable.stories.tsx +7 -7
  339. package/src/utils/{dnd → decorators/draggable}/__stories__/use_draggable.stories.tsx +2 -2
  340. package/src/utils/{dnd/handle.tsx → decorators/draggable/drag_handle.tsx} +1 -1
  341. package/src/utils/{dnd → decorators}/draggable/draggable.tsx +2 -2
  342. package/src/utils/decorators/draggable/index.ts +15 -0
  343. package/src/utils/{dnd → decorators/draggable}/types.ts +1 -1
  344. package/src/utils/{dnd/hooks → decorators/draggable}/use_drag_container.ts +2 -2
  345. package/src/utils/decorators/index.ts +2 -0
  346. package/src/utils/decorators/resizable/__stories__/resizable.stories.tsx +214 -0
  347. package/src/utils/decorators/resizable/__stories__/resizable_stories.module.css +47 -0
  348. package/src/utils/decorators/resizable/__tests__/handle_config.test.ts +191 -0
  349. package/src/utils/decorators/resizable/__tests__/resize_strategy.test.ts +163 -0
  350. package/src/utils/decorators/resizable/context.ts +9 -0
  351. package/src/utils/decorators/resizable/handle_config.ts +118 -0
  352. package/src/utils/decorators/resizable/index.ts +37 -0
  353. package/src/utils/decorators/resizable/resizable.module.css +5 -0
  354. package/src/utils/decorators/resizable/resizable.tsx +97 -0
  355. package/src/utils/decorators/resizable/resize_handle.module.css +106 -0
  356. package/src/utils/decorators/resizable/resize_handle.tsx +165 -0
  357. package/src/utils/decorators/resizable/resize_strategy.ts +190 -0
  358. package/src/utils/decorators/resizable/types.ts +58 -0
  359. package/src/utils/hooks/labelled_by_context.ts +27 -0
  360. package/src/utils/index.ts +9 -7
  361. package/src/utils/{click_away_listener.tsx → listeners/click_away_listener.tsx} +1 -1
  362. package/src/utils/listeners/index.ts +3 -0
  363. package/src/utils/{scroll_away_listener.tsx → listeners/scroll_away_listener.tsx} +1 -1
  364. package/src/utils/system/index.ts +1 -0
  365. package/src/utils/types/sides.ts +2 -0
  366. package/dist/actions/button/slim_button/slim_button.d.ts +0 -9
  367. package/dist/actions/button/slim_button/slim_button.d.ts.map +0 -1
  368. package/dist/actions/button/slim_button/slim_button.js +0 -18
  369. package/dist/actions/button/slim_button/slim_button.js.map +0 -1
  370. package/dist/containers.module-DlGySre0.js +0 -5
  371. package/dist/containers.module-DlGySre0.js.map +0 -1
  372. package/dist/draggable.module-BgelQsuJ.js +0 -5
  373. package/dist/draggable.module-BgelQsuJ.js.map +0 -1
  374. package/dist/frame.css +0 -1
  375. package/dist/left_resize_handle.css +0 -1
  376. package/dist/right_resize_handle.css +0 -1
  377. package/dist/slim_button.css +0 -1
  378. package/dist/stacks/box/left_resize_handle.d.ts +0 -4
  379. package/dist/stacks/box/left_resize_handle.d.ts.map +0 -1
  380. package/dist/stacks/box/left_resize_handle.js +0 -36
  381. package/dist/stacks/box/left_resize_handle.js.map +0 -1
  382. package/dist/stacks/box/right_resize_handle.d.ts +0 -4
  383. package/dist/stacks/box/right_resize_handle.d.ts.map +0 -1
  384. package/dist/stacks/box/right_resize_handle.js +0 -36
  385. package/dist/stacks/box/right_resize_handle.js.map +0 -1
  386. package/dist/utils/click_away_listener.d.ts.map +0 -1
  387. package/dist/utils/click_away_listener.js.map +0 -1
  388. package/dist/utils/dnd/context.d.ts.map +0 -1
  389. package/dist/utils/dnd/context.js.map +0 -1
  390. package/dist/utils/dnd/draggable/draggable.d.ts.map +0 -1
  391. package/dist/utils/dnd/draggable/draggable.js.map +0 -1
  392. package/dist/utils/dnd/handle.d.ts.map +0 -1
  393. package/dist/utils/dnd/handle.js.map +0 -1
  394. package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +0 -1
  395. package/dist/utils/dnd/hooks/use_drag_container.js.map +0 -1
  396. package/dist/utils/dnd/hooks/use_draggable.d.ts.map +0 -1
  397. package/dist/utils/dnd/hooks/use_draggable.js.map +0 -1
  398. package/dist/utils/dnd/types.d.ts.map +0 -1
  399. package/dist/utils/focus_redirect.d.ts.map +0 -1
  400. package/dist/utils/focus_redirect.js.map +0 -1
  401. package/dist/utils/mouse_leave_region.d.ts.map +0 -1
  402. package/dist/utils/mouse_leave_region.js.map +0 -1
  403. package/dist/utils/scroll_away_listener.d.ts.map +0 -1
  404. package/dist/utils/scroll_away_listener.js.map +0 -1
  405. package/dist/utils/types/variations.d.ts.map +0 -1
  406. package/src/actions/button/__stories__/slim_button.stories.tsx +0 -274
  407. package/src/actions/button/slim_button/slim_button.module.css +0 -9
  408. package/src/actions/button/slim_button/slim_button.tsx +0 -26
  409. package/src/overlay/frame/frame.module.css +0 -5
  410. package/src/stacks/box/left_resize_handle.module.css +0 -12
  411. package/src/stacks/box/left_resize_handle.tsx +0 -39
  412. package/src/stacks/box/right_resize_handle.module.css +0 -12
  413. package/src/stacks/box/right_resize_handle.tsx +0 -38
  414. /package/dist/utils/{dnd → decorators/draggable}/context.d.ts +0 -0
  415. /package/dist/utils/{dnd → decorators/draggable}/context.js +0 -0
  416. /package/dist/utils/{dnd → decorators}/draggable/draggable.d.ts +0 -0
  417. /package/dist/utils/{dnd → decorators/draggable}/types.js +0 -0
  418. /package/dist/utils/{dnd → decorators/draggable}/types.js.map +0 -0
  419. /package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.js +0 -0
  420. /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.d.ts +0 -0
  421. /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.js +0 -0
  422. /package/dist/utils/{click_away_listener.d.ts → listeners/click_away_listener.d.ts} +0 -0
  423. /package/dist/utils/{focus_redirect.d.ts → listeners/focus_redirect.d.ts} +0 -0
  424. /package/dist/utils/{focus_redirect.js → listeners/focus_redirect.js} +0 -0
  425. /package/dist/utils/{mouse_leave_region.d.ts → listeners/mouse_leave_region.d.ts} +0 -0
  426. /package/dist/utils/{mouse_leave_region.js → listeners/mouse_leave_region.js} +0 -0
  427. /package/dist/utils/{scroll_away_listener.d.ts → listeners/scroll_away_listener.d.ts} +0 -0
  428. /package/dist/utils/{types → system}/variations.d.ts +0 -0
  429. /package/src/utils/{dnd → decorators/draggable}/__stories__/draggable_stories.module.css +0 -0
  430. /package/src/utils/{dnd → decorators/draggable}/context.ts +0 -0
  431. /package/src/utils/{dnd → decorators}/draggable/draggable.module.css +0 -0
  432. /package/src/utils/{dnd/hooks → decorators/draggable}/use_draggable.ts +0 -0
  433. /package/src/utils/{click_away_listener.stories.tsx → listeners/click_away_listener.stories.tsx} +0 -0
  434. /package/src/utils/{focus_redirect.tsx → listeners/focus_redirect.tsx} +0 -0
  435. /package/src/utils/{mouse_leave_region.tsx → listeners/mouse_leave_region.tsx} +0 -0
  436. /package/src/utils/{scroll_away_listener.stories.tsx → listeners/scroll_away_listener.stories.tsx} +0 -0
  437. /package/src/utils/{types → system}/variations.ts +0 -0
@@ -0,0 +1,106 @@
1
+ @layer tcn-system {
2
+ .resize-handle {
3
+ position: absolute;
4
+ z-index: 1;
5
+ pointer-events: auto;
6
+ }
7
+
8
+ /* Horizontal edges: start, end */
9
+ :where(.resize-handle[data-position="start"]),
10
+ :where(.resize-handle[data-position="end"]) {
11
+ top: 0;
12
+ height: 100%;
13
+ width: 16px;
14
+ cursor: ew-resize;
15
+ }
16
+
17
+ :where(.resize-handle[data-position="start"]:dir(ltr)) {
18
+ left: var(--resize-offset, 0px);
19
+ }
20
+
21
+ :where(.resize-handle[data-position="start"]:dir(rtl)) {
22
+ right: var(--resize-offset, 0px);
23
+ }
24
+
25
+ :where(.resize-handle[data-position="end"]:dir(ltr)) {
26
+ right: var(--resize-offset, 0px);
27
+ }
28
+
29
+ :where(.resize-handle[data-position="end"]:dir(rtl)) {
30
+ left: var(--resize-offset, 0px);
31
+ }
32
+
33
+ /* Vertical edges: top, bottom */
34
+ :where(.resize-handle[data-position="top"]),
35
+ :where(.resize-handle[data-position="bottom"]) {
36
+ left: 0;
37
+ width: 100%;
38
+ height: 16px;
39
+ cursor: ns-resize;
40
+ }
41
+
42
+ :where(.resize-handle[data-position="top"]) {
43
+ top: var(--resize-offset, 0px);
44
+ }
45
+
46
+ :where(.resize-handle[data-position="bottom"]) {
47
+ bottom: var(--resize-offset, 0px);
48
+ }
49
+
50
+ /* Corners: small square at intersection */
51
+ :where(.resize-handle[data-position="top-start"]),
52
+ :where(.resize-handle[data-position="top-end"]),
53
+ :where(.resize-handle[data-position="bottom-start"]),
54
+ :where(.resize-handle[data-position="bottom-end"]) {
55
+ width: 16px;
56
+ height: 16px;
57
+ }
58
+
59
+ :where(.resize-handle[data-position="top-start"]:dir(ltr)) {
60
+ top: var(--resize-offset, 0px);
61
+ left: var(--resize-offset, 0px);
62
+ cursor: nwse-resize;
63
+ }
64
+
65
+ :where(.resize-handle[data-position="top-start"]:dir(rtl)) {
66
+ top: var(--resize-offset, 0px);
67
+ right: var(--resize-offset, 0px);
68
+ cursor: nesw-resize;
69
+ }
70
+
71
+ :where(.resize-handle[data-position="top-end"]:dir(ltr)) {
72
+ top: var(--resize-offset, 0px);
73
+ right: var(--resize-offset, 0px);
74
+ cursor: nesw-resize;
75
+ }
76
+
77
+ :where(.resize-handle[data-position="top-end"]:dir(rtl)) {
78
+ top: var(--resize-offset, 0px);
79
+ left: var(--resize-offset, 0px);
80
+ cursor: nwse-resize;
81
+ }
82
+
83
+ :where(.resize-handle[data-position="bottom-start"]:dir(ltr)) {
84
+ bottom: var(--resize-offset, 0px);
85
+ left: var(--resize-offset, 0px);
86
+ cursor: nesw-resize;
87
+ }
88
+
89
+ :where(.resize-handle[data-position="bottom-start"]:dir(rtl)) {
90
+ bottom: var(--resize-offset, 0px);
91
+ right: var(--resize-offset, 0px);
92
+ cursor: nwse-resize;
93
+ }
94
+
95
+ :where(.resize-handle[data-position="bottom-end"]:dir(ltr)) {
96
+ bottom: var(--resize-offset, 0px);
97
+ right: var(--resize-offset, 0px);
98
+ cursor: nwse-resize;
99
+ }
100
+
101
+ :where(.resize-handle[data-position="bottom-end"]:dir(rtl)) {
102
+ bottom: var(--resize-offset, 0px);
103
+ left: var(--resize-offset, 0px);
104
+ cursor: nesw-resize;
105
+ }
106
+ }
@@ -0,0 +1,165 @@
1
+ import React, { forwardRef, useMemo } from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { useResizable } from './context.js';
4
+ import { getHandleConfig } from './handle_config.js';
5
+ import { ResizeHandleStrategy } from './resize_strategy.js';
6
+ import { detectResizeBounds } from '../../../stacks/box/detect_resize_bounds.js';
7
+ import type { ResizeHandlePosition } from './types.js';
8
+ import styles from './resize_handle.module.css';
9
+
10
+ export interface ResizeHandleProps extends React.HTMLAttributes<HTMLDivElement> {
11
+ position: ResizeHandlePosition;
12
+ }
13
+
14
+ export const ResizeHandle = forwardRef<HTMLDivElement, ResizeHandleProps>(
15
+ function ResizeHandle({ position, className, ...rest }, ref) {
16
+ const {
17
+ targetRef,
18
+ onWidthResize,
19
+ onWidthResizeEnd,
20
+ onHeightResize,
21
+ onHeightResizeEnd,
22
+ } = useResizable();
23
+
24
+ const config = getHandleConfig(position);
25
+ const axis =
26
+ config.horizontal && config.vertical
27
+ ? 'corner'
28
+ : config.horizontal
29
+ ? 'horizontal'
30
+ : 'vertical';
31
+
32
+ const strategy = useMemo(() => new ResizeHandleStrategy(position), [position]);
33
+
34
+ const handleMouseDown = (event: React.MouseEvent<HTMLDivElement>) => {
35
+ const target = targetRef.current;
36
+ if (target == null) return;
37
+
38
+ const rect = target.getBoundingClientRect();
39
+ strategy.startResize({
40
+ rectangle: {
41
+ dimensions: {
42
+ width: rect.width,
43
+ height: rect.height,
44
+ },
45
+ position: {
46
+ x: event.clientX,
47
+ y: event.clientY,
48
+ },
49
+ },
50
+ languageDirection: window.getComputedStyle(target).direction,
51
+ });
52
+
53
+ let frameId = 0;
54
+
55
+ const drag = (e: MouseEvent) => {
56
+ e.stopPropagation();
57
+ e.preventDefault();
58
+
59
+ cancelAnimationFrame(frameId);
60
+ frameId = requestAnimationFrame(() => {
61
+ const result = strategy.resize({ x: e.clientX, y: e.clientY });
62
+
63
+ let appliedWidth = rect.width;
64
+ let appliedHeight = rect.height;
65
+
66
+ if (result.horizontal) {
67
+ const bounds = detectResizeBounds({
68
+ element: target,
69
+ axis: 'width',
70
+ nextSize: result.horizontal.newSize,
71
+ });
72
+ if (!bounds.clamped) {
73
+ appliedWidth = result.horizontal.newSize;
74
+ target.style.width = `${result.horizontal.newSize}px`;
75
+ onWidthResize?.({
76
+ width: result.horizontal.newSize,
77
+ origin: result.horizontal.origin,
78
+ totalDelta: result.horizontal.totalDelta,
79
+ currentDelta: result.horizontal.currentDelta,
80
+ });
81
+ } else if (
82
+ bounds.clampedSize !== null &&
83
+ bounds.clampedSize !== appliedWidth
84
+ ) {
85
+ appliedWidth = bounds.clampedSize;
86
+ target.style.width = `${bounds.clampedSize}px`;
87
+ onWidthResize?.({
88
+ width: bounds.clampedSize,
89
+ origin: result.horizontal.origin,
90
+ totalDelta: result.horizontal.totalDelta,
91
+ currentDelta: result.horizontal.currentDelta,
92
+ });
93
+ }
94
+ }
95
+
96
+ if (result.vertical) {
97
+ const bounds = detectResizeBounds({
98
+ element: target,
99
+ axis: 'height',
100
+ nextSize: result.vertical.newSize,
101
+ });
102
+ if (!bounds.clamped) {
103
+ appliedHeight = result.vertical.newSize;
104
+ target.style.height = `${result.vertical.newSize}px`;
105
+ onHeightResize?.({
106
+ height: result.vertical.newSize,
107
+ origin: result.vertical.origin,
108
+ totalDelta: result.vertical.totalDelta,
109
+ currentDelta: result.vertical.currentDelta,
110
+ });
111
+ } else if (
112
+ bounds.clampedSize !== null &&
113
+ bounds.clampedSize !== appliedHeight
114
+ ) {
115
+ appliedHeight = bounds.clampedSize;
116
+ target.style.height = `${bounds.clampedSize}px`;
117
+ onHeightResize?.({
118
+ height: bounds.clampedSize,
119
+ origin: result.vertical.origin,
120
+ totalDelta: result.vertical.totalDelta,
121
+ currentDelta: result.vertical.currentDelta,
122
+ });
123
+ }
124
+ }
125
+
126
+ strategy.commitResize({ width: appliedWidth, height: appliedHeight });
127
+ });
128
+ };
129
+
130
+ const endDrag = () => {
131
+ cancelAnimationFrame(frameId);
132
+ document.body.removeEventListener('mousemove', drag);
133
+ document.body.removeEventListener('mouseup', endDrag);
134
+ window.removeEventListener('blur', endDrag);
135
+
136
+ const result = strategy.endResize();
137
+ if (result.horizontal) {
138
+ onWidthResizeEnd?.(result.horizontal.width, result.horizontal.origin);
139
+ }
140
+ if (result.vertical) {
141
+ onHeightResizeEnd?.(result.vertical.height, result.vertical.origin);
142
+ }
143
+ };
144
+
145
+ document.body.addEventListener('mousemove', drag);
146
+ document.body.addEventListener('mouseup', endDrag);
147
+ window.addEventListener('blur', endDrag);
148
+ event.stopPropagation();
149
+ event.preventDefault();
150
+ };
151
+
152
+ return (
153
+ <div
154
+ ref={ref}
155
+ className={clsx(styles['resize-handle'], 'tcn-resize-handle', className)}
156
+ data-position={position}
157
+ data-axis={axis}
158
+ onMouseDown={handleMouseDown}
159
+ {...rest}
160
+ />
161
+ );
162
+ }
163
+ );
164
+
165
+ ResizeHandle.displayName = 'ResizeHandle';
@@ -0,0 +1,190 @@
1
+ import {
2
+ getHandleConfig,
3
+ resolveDirection,
4
+ computeResizeState,
5
+ } from './handle_config.js';
6
+ import type {
7
+ AxisConfig,
8
+ ResizeHandlePosition,
9
+ WidthResizeOrigin,
10
+ HeightResizeOrigin,
11
+ } from './types.js';
12
+ import type { Dimensions, Position, Rectangle } from '../../types/dimensions.js';
13
+
14
+ export interface StartResizeParams {
15
+ rectangle: Rectangle;
16
+ languageDirection: string;
17
+ }
18
+
19
+ export interface AxisResizeResult {
20
+ newSize: number;
21
+ totalDelta: number;
22
+ currentDelta: number;
23
+ }
24
+
25
+ export interface HorizontalResizeResult extends AxisResizeResult {
26
+ origin: WidthResizeOrigin;
27
+ }
28
+
29
+ export interface VerticalResizeResult extends AxisResizeResult {
30
+ origin: HeightResizeOrigin;
31
+ }
32
+
33
+ export interface ResizeResult {
34
+ horizontal?: HorizontalResizeResult;
35
+ vertical?: VerticalResizeResult;
36
+ }
37
+
38
+ export interface EndResizeResult {
39
+ horizontal?: { width: number; origin: WidthResizeOrigin };
40
+ vertical?: { height: number; origin: HeightResizeOrigin };
41
+ }
42
+
43
+ /**
44
+ * Single-axis resize handler. Pure — no DOM, no React.
45
+ * Subclasses extract the correct axis from uniform args.
46
+ */
47
+ abstract class AxisResizeHandler {
48
+ protected direction = 1;
49
+ protected startSize = 0;
50
+ protected startCoord = 0;
51
+ protected currentSize = 0;
52
+
53
+ constructor(protected axisConfig: AxisConfig) {}
54
+
55
+ get origin() {
56
+ return this.axisConfig.origin;
57
+ }
58
+
59
+ get size() {
60
+ return this.currentSize;
61
+ }
62
+
63
+ protected abstract extractSize(dimensions: Dimensions): number;
64
+ protected abstract extractCoord(coord: Position): number;
65
+ abstract applyResize(coord: Position): Partial<ResizeResult>;
66
+ abstract applyEnd(): Partial<EndResizeResult>;
67
+
68
+ start(rect: Rectangle, languageDirection: string) {
69
+ this.direction = resolveDirection(
70
+ languageDirection,
71
+ this.axisConfig.invert,
72
+ this.axisConfig.disableDirection
73
+ );
74
+ this.startSize = this.extractSize(rect.dimensions);
75
+ this.startCoord = this.extractCoord(rect.position);
76
+ this.currentSize = this.startSize;
77
+ }
78
+
79
+ resize(coord: Position): AxisResizeResult {
80
+ return computeResizeState(
81
+ this.startSize,
82
+ this.startCoord,
83
+ this.extractCoord(coord),
84
+ this.direction,
85
+ this.currentSize
86
+ );
87
+ }
88
+
89
+ commit(dimensions: Dimensions) {
90
+ this.currentSize = this.extractSize(dimensions);
91
+ }
92
+ }
93
+
94
+ class HorizontalAxisResizeHandler extends AxisResizeHandler {
95
+ protected extractSize(dimensions: Dimensions) {
96
+ return dimensions.width;
97
+ }
98
+
99
+ protected extractCoord(coord: Position) {
100
+ return coord.x;
101
+ }
102
+
103
+ applyResize(coord: Position): Partial<ResizeResult> {
104
+ return {
105
+ horizontal: {
106
+ ...this.resize(coord),
107
+ origin: this.origin as WidthResizeOrigin,
108
+ },
109
+ };
110
+ }
111
+
112
+ applyEnd(): Partial<EndResizeResult> {
113
+ return {
114
+ horizontal: {
115
+ width: this.size,
116
+ origin: this.origin as WidthResizeOrigin,
117
+ },
118
+ };
119
+ }
120
+ }
121
+
122
+ class VerticalAxisResizeHandler extends AxisResizeHandler {
123
+ protected extractSize(dimensions: Dimensions) {
124
+ return dimensions.height;
125
+ }
126
+
127
+ protected extractCoord(coord: Position) {
128
+ return coord.y;
129
+ }
130
+
131
+ applyResize(coord: Position): Partial<ResizeResult> {
132
+ return {
133
+ vertical: {
134
+ ...this.resize(coord),
135
+ origin: this.origin as HeightResizeOrigin,
136
+ },
137
+ };
138
+ }
139
+
140
+ applyEnd(): Partial<EndResizeResult> {
141
+ return {
142
+ vertical: {
143
+ height: this.size,
144
+ origin: this.origin as HeightResizeOrigin,
145
+ },
146
+ };
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Flow:
152
+ * 1. adapter calls startResize() with rect/coords from DOM
153
+ * 2. adapter calls resize() on each mousemove with coord
154
+ * 3. adapter checks bounds (DOM), applies style, then calls commitResize()
155
+ * 4. adapter calls endResize() on mouseup to get final state
156
+ */
157
+ export class ResizeHandleStrategy {
158
+ private handlers: AxisResizeHandler[];
159
+
160
+ constructor(position: ResizeHandlePosition) {
161
+ const config = getHandleConfig(position);
162
+ this.handlers = [];
163
+ if (config.horizontal) {
164
+ this.handlers.push(new HorizontalAxisResizeHandler(config.horizontal));
165
+ }
166
+ if (config.vertical) {
167
+ this.handlers.push(new VerticalAxisResizeHandler(config.vertical));
168
+ }
169
+ }
170
+
171
+ startResize(params: StartResizeParams): void {
172
+ for (const handler of this.handlers) {
173
+ handler.start(params.rectangle, params.languageDirection);
174
+ }
175
+ }
176
+
177
+ resize(position: Position): ResizeResult {
178
+ return Object.assign({}, ...this.handlers.map(h => h.applyResize(position)));
179
+ }
180
+
181
+ commitResize(dimensions: Dimensions): void {
182
+ for (const handler of this.handlers) {
183
+ handler.commit(dimensions);
184
+ }
185
+ }
186
+
187
+ endResize(): EndResizeResult {
188
+ return Object.assign({}, ...this.handlers.map(h => h.applyEnd()));
189
+ }
190
+ }
@@ -0,0 +1,58 @@
1
+ import type {
2
+ OnWidthResize,
3
+ OnWidthResizeEnd,
4
+ OnHeightResize,
5
+ OnHeightResizeEnd,
6
+ WidthResizeOrigin,
7
+ HeightResizeOrigin,
8
+ } from '../../../stacks/box/types.js';
9
+
10
+ export type {
11
+ OnWidthResize,
12
+ OnWidthResizeEnd,
13
+ OnHeightResize,
14
+ OnHeightResizeEnd,
15
+ WidthResizeOrigin,
16
+ HeightResizeOrigin,
17
+ };
18
+
19
+ export type ResizeHandlePosition =
20
+ // Edges (single axis)
21
+ | 'top'
22
+ | 'bottom'
23
+ | 'start'
24
+ | 'end'
25
+ // Corners (dual axis)
26
+ | 'top-start'
27
+ | 'top-end'
28
+ | 'bottom-start'
29
+ | 'bottom-end';
30
+
31
+ export interface AxisConfig {
32
+ origin: WidthResizeOrigin | HeightResizeOrigin;
33
+ invert: boolean;
34
+ disableDirection: boolean;
35
+ }
36
+
37
+ export interface HandleConfig {
38
+ horizontal?: AxisConfig;
39
+ vertical?: AxisConfig;
40
+ }
41
+
42
+ export interface ResolvedAxisConfig {
43
+ origin: WidthResizeOrigin | HeightResizeOrigin;
44
+ direction: number;
45
+ }
46
+
47
+ export interface ResolvedHandleConfig {
48
+ horizontal?: ResolvedAxisConfig;
49
+ vertical?: ResolvedAxisConfig;
50
+ }
51
+
52
+ export interface ResizableContextValue {
53
+ targetRef: React.RefObject<HTMLElement | null>;
54
+ onWidthResize?: OnWidthResize;
55
+ onWidthResizeEnd?: OnWidthResizeEnd;
56
+ onHeightResize?: OnHeightResize;
57
+ onHeightResizeEnd?: OnHeightResizeEnd;
58
+ }
@@ -0,0 +1,27 @@
1
+ import { createContext, useContext, useId } from 'react';
2
+
3
+ export interface LabelledByContextValue {
4
+ labelId: string;
5
+ }
6
+
7
+ /**
8
+ * Context for wiring aria-labelledby between a parent container and a child
9
+ * label element.
10
+ */
11
+ export const LabelledByContext = createContext<LabelledByContextValue | null>(null);
12
+
13
+ export const useLabelledBy = () => useContext(LabelledByContext);
14
+
15
+ /**
16
+ * Derives a stable label ID for aria-labelledby wiring.
17
+ *
18
+ * - If `ariaLabelledBy` is provided, it takes precedence (full override).
19
+ * - If `id` is provided, the label ID is deterministic (`${id}-legend`).
20
+ * - Otherwise, falls back to React's `useId()`.
21
+ */
22
+ export function useLabelledById(id?: string, ariaLabelledBy?: string) {
23
+ const reactId = useId();
24
+ const baseId = id ?? reactId;
25
+ const labelId = ariaLabelledBy || `${baseId}-legend`;
26
+ return { baseId, labelId };
27
+ }
@@ -1,12 +1,11 @@
1
- export * from './click_away_listener.js';
2
- export * from './focus_redirect.js';
3
- export * from './scroll_away_listener.js';
1
+ export * from './listeners/index.js';
4
2
 
5
- export * from './dnd/hooks/use_draggable.js';
3
+ export * from './decorators/draggable/use_draggable.js';
6
4
  export * from './hooks/make_context_hook.js';
7
5
  export * from './hooks/use_fork_ref.js';
8
6
  export * from './hooks/use_resize_observer.js';
9
7
  export * from './hooks/use_media_query.js';
8
+ export * from './hooks/labelled_by_context.js';
10
9
 
11
10
  export * from './default_value.js';
12
11
 
@@ -17,7 +16,10 @@ export * from './calendar/get_months_of_year.js';
17
16
  export * from './calendar/month.js';
18
17
 
19
18
  export * from './types/dimensions.js';
20
- export * from './types/variations.js';
19
+ export * from './types/sides.js';
20
+ export * from './system/index.js';
21
21
 
22
- export * from './dnd/draggable/draggable.js';
23
- export * from './dnd/handle.js';
22
+ export * from './decorators/draggable/draggable.js';
23
+ export * from './decorators/draggable/drag_handle.js';
24
+
25
+ export * from './decorators/resizable/index.js';
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useCallback, useRef } from 'react';
2
- import { useForkRef } from './hooks/use_fork_ref.js';
2
+ import { useForkRef } from '../hooks/use_fork_ref.js';
3
3
  export interface ClickAwayListenerProps {
4
4
  children: React.ReactElement;
5
5
  onClickAway: (event: React.MouseEvent | React.TouchEvent) => void;
@@ -0,0 +1,3 @@
1
+ export * from './click_away_listener.js';
2
+ export * from './focus_redirect.js';
3
+ export * from './scroll_away_listener.js';
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { useForkRef } from './hooks/use_fork_ref.js';
2
+ import { useForkRef } from '../hooks/use_fork_ref.js';
3
3
  export interface ScrollAwayListenerProps {
4
4
  children: React.ReactElement;
5
5
  isException?: (target: HTMLElement) => boolean;
@@ -0,0 +1 @@
1
+ export * from './variations.js';
@@ -0,0 +1,2 @@
1
+ export type HorizontalSide = 'start' | 'end';
2
+ export type VerticalSide = 'top' | 'bottom';
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ButtonProps } from '../button/button.js';
3
- /**
4
- * @deprecated - use Button instead (utility=true)
5
- * @param props - ButtonProps
6
- * @returns SlimButton
7
- */
8
- export declare const SlimButton: React.ForwardRefExoticComponent<Omit<Omit<ButtonProps, "utility">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
- //# sourceMappingURL=slim_button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slim_button.d.ts","sourceRoot":"","sources":["../../../../src/actions/button/slim_button/slim_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;GAIG;AACH,eAAO,MAAM,UAAU,qHAcrB,CAAC"}
@@ -1,18 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import i from "react";
3
- import { Button as n } from "../button/button.js";
4
- import { clsx as l } from "clsx";
5
- import '../../../slim_button.css';const u = "_slim-button_188fdc3", c = { "slim-button": u }, b = i.forwardRef(({ children: t, className: o, ...m }, r) => /* @__PURE__ */ s(
6
- n,
7
- {
8
- ref: r,
9
- className: l(c["slim-button"], "tcn-slim-button", o),
10
- utility: !0,
11
- ...m,
12
- children: t
13
- }
14
- ));
15
- export {
16
- b as SlimButton
17
- };
18
- //# sourceMappingURL=slim_button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slim_button.js","sources":["../../../../src/actions/button/slim_button/slim_button.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '../button/button.js';\nimport { clsx } from 'clsx';\n// Styles\nimport styles from './slim_button.module.css';\n\n/**\n * @deprecated - use Button instead (utility=true)\n * @param props - ButtonProps\n * @returns SlimButton\n */\nexport const SlimButton = React.forwardRef<\n HTMLButtonElement,\n Omit<ButtonProps, 'utility'>\n>(({ children, className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={clsx(styles['slim-button'], 'tcn-slim-button', className)}\n utility={true}\n {...props}\n >\n {children}\n </Button>\n );\n});\n"],"names":["SlimButton","React","children","className","props","ref","jsx","Button","clsx","styles"],"mappings":";;;;4DAWaA,IAAaC,EAAM,WAG9B,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAElC,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAKC,EAAO,aAAa,GAAG,mBAAmBN,CAAS;AAAA,IACnE,SAAS;AAAA,IACR,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AAAA,CAGN;"}
@@ -1,5 +0,0 @@
1
- import './containers.css';const a = "_scaffold_7e9ff51", c = "_rail_9474c96", t = "_container_336e83e", s = "_container-stack_0d2e80a", o = "_scaffold-stack_3a72ba8", n = "_rail-stack_2e4d934", e = { scaffold: a, rail: c, container: t, "container-stack": s, "scaffold-stack": o, "rail-stack": n };
2
- export {
3
- e as s
4
- };
5
- //# sourceMappingURL=containers.module-DlGySre0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containers.module-DlGySre0.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- import './draggable.css';const s = "_draggable_db40376", a = { draggable: s };
2
- export {
3
- a as s
4
- };
5
- //# sourceMappingURL=draggable.module-BgelQsuJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"draggable.module-BgelQsuJ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/frame.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._frame-dialog_2a77c1d){overflow:hidden}}
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._left-resize-handle_215501a){position:fixed;bottom:0;left:var(--resize-offset, -8px);height:100%;width:16px;z-index:1;cursor:ew-resize;pointer-events:auto}}
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._right-resize-handle_7f232b9){position:fixed;bottom:0;right:var(--resize-offset, -8px);height:100%;width:16px;z-index:1;cursor:ew-resize;pointer-events:auto}}
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._slim-button_188fdc3){min-height:auto}:where(._slim-button_188fdc3[data-is-disabled=true]){pointer-events:none}}
@@ -1,4 +0,0 @@
1
- import { HorizontalResizeHandleProps } from './types.js';
2
- export type LeftResizeHandleProps = HorizontalResizeHandleProps;
3
- export declare function LeftResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: LeftResizeHandleProps): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=left_resize_handle.d.ts.map