@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
@@ -1,44 +1,20 @@
1
1
  import React from 'react';
2
2
  import { clsx } from 'clsx';
3
- import { Box, type BoxProps } from '../../stacks/box/box.js';
4
- import type { Alignment } from '../../stacks/types/alignment.js';
5
- import { HStack } from '../../stacks/h_stack.js';
6
-
3
+ import { HStack, type HStackProps } from '../../stacks/h_stack.js';
7
4
  import styles from './containers.module.css';
8
5
 
9
- export interface RailProps extends Omit<BoxProps, 'as'> {
10
- vAlign?: Alignment;
11
- hAlign?: Alignment;
12
- }
6
+ export interface RailProps extends Omit<HStackProps, 'as'> {}
13
7
 
14
- // WIP: This component is not fully implemented.
15
8
  export const Rail = React.forwardRef<HTMLElement, RailProps>(function Rail(
16
- {
17
- children,
18
- width,
19
- height,
20
- minWidth,
21
- maxWidth,
22
- minHeight,
23
- maxHeight,
24
- hAlign = 'start',
25
- vAlign = 'start',
26
- className,
27
- ...props
28
- }: RailProps,
9
+ { children, className, vAlign = 'start', hAlign = 'start', ...props }: RailProps,
29
10
  ref
30
11
  ) {
31
12
  return (
32
- <Box
13
+ <HStack
33
14
  ref={ref}
34
- width={width}
35
- height={height}
36
- minWidth={minWidth}
37
- maxWidth={maxWidth}
38
- minHeight={minHeight}
39
- maxHeight={maxHeight}
40
- data-h-alignment={hAlign}
41
- data-v-alignment={vAlign}
15
+ as="section"
16
+ vAlign={vAlign}
17
+ hAlign={hAlign}
42
18
  className={clsx(
43
19
  className,
44
20
  styles['rail'],
@@ -48,25 +24,7 @@ export const Rail = React.forwardRef<HTMLElement, RailProps>(function Rail(
48
24
  )}
49
25
  {...props}
50
26
  >
51
- <HStack
52
- as="section"
53
- minWidth={minWidth}
54
- maxWidth={maxWidth}
55
- minHeight={minHeight}
56
- maxHeight={maxHeight}
57
- hAlign={hAlign}
58
- vAlign={vAlign}
59
- ref={ref}
60
- className={clsx(
61
- styles['rail-stack'],
62
- styles['container-stack'],
63
- 'tcn-container-stack',
64
- 'tcn-rail-stack'
65
- )}
66
- zIndex={0}
67
- >
68
- {children}
69
- </HStack>
70
- </Box>
27
+ {children}
28
+ </HStack>
71
29
  );
72
30
  });
@@ -0,0 +1,2 @@
1
+ export { Row, type RowProps } from './row.js';
2
+ export { Rows, type RowsProps } from './rows.js';
@@ -0,0 +1,15 @@
1
+ @layer tcn-system {
2
+ :where(.row) {
3
+ width: 100%;
4
+ min-width: 0;
5
+ height: var(--rows-height, auto);
6
+ min-height: var(--rows-min-height, 0);
7
+ max-height: var(--rows-max-height, none);
8
+ flex-grow: 0;
9
+ }
10
+
11
+ :where(.row[data-height="fill"]) {
12
+ flex-grow: 1;
13
+ height: 0; /* let flex-grow determine height, not content */
14
+ }
15
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { HStack, type HStackProps } from '../../../stacks/h_stack.js';
4
+ import styles from './row.module.css';
5
+
6
+ export interface RowProps extends Omit<HStackProps, 'as'> {}
7
+
8
+ export const Row = React.forwardRef<HTMLElement, RowProps>(function Row(
9
+ { children, className, ...props }: RowProps,
10
+ ref
11
+ ) {
12
+ return (
13
+ <HStack
14
+ ref={ref}
15
+ as="section"
16
+ className={clsx('tcn-row', styles['row'], className)}
17
+ {...props}
18
+ >
19
+ {children}
20
+ </HStack>
21
+ );
22
+ });
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { Scaffold, type ScaffoldProps } from '../scaffold.js';
4
+ import { removeUndefinedProperties } from '../../../stacks/utils/remove_undefined_properties.js';
5
+
6
+ export interface RowsOwnProps {
7
+ rowsMinHeight?: string | number;
8
+ rowsHeight?: string | number;
9
+ rowsMaxHeight?: string | number;
10
+ }
11
+
12
+ export interface RowsProps extends Omit<ScaffoldProps, 'as'>, RowsOwnProps {}
13
+
14
+ export const Rows = React.forwardRef<HTMLElement, RowsProps>(function Rows(
15
+ {
16
+ children,
17
+ className,
18
+ rowsMinHeight,
19
+ rowsHeight,
20
+ rowsMaxHeight,
21
+ style,
22
+ ...props
23
+ }: RowsProps,
24
+ ref
25
+ ) {
26
+ const rowVars = removeUndefinedProperties({
27
+ '--rows-min-height': rowsMinHeight,
28
+ '--rows-height': rowsHeight,
29
+ '--rows-max-height': rowsMaxHeight,
30
+ });
31
+
32
+ return (
33
+ <Scaffold
34
+ ref={ref}
35
+ className={clsx('tcn-rows', className)}
36
+ style={{ ...rowVars, ...style }}
37
+ {...props}
38
+ >
39
+ {children}
40
+ </Scaffold>
41
+ );
42
+ });
@@ -1,42 +1,20 @@
1
1
  import React from 'react';
2
2
  import { clsx } from 'clsx';
3
- import { Box, type BoxProps } from '../../stacks/box/box.js';
4
- import type { Alignment } from '../../stacks/types/alignment.js';
5
- import { VStack } from '../../stacks/v_stack.js';
3
+ import { VStack, type VStackProps } from '../../stacks/v_stack.js';
6
4
  import styles from './containers.module.css';
7
5
 
8
- export interface ScaffoldProps extends Omit<BoxProps, 'as'> {
9
- vAlign?: Alignment;
10
- hAlign?: Alignment;
11
- }
6
+ export interface ScaffoldProps extends Omit<VStackProps, 'as'> {}
12
7
 
13
8
  export const Scaffold = React.forwardRef<HTMLElement, ScaffoldProps>(function Scaffold(
14
- {
15
- children,
16
- width,
17
- height,
18
- minWidth,
19
- maxWidth,
20
- minHeight,
21
- maxHeight,
22
- hAlign = 'start',
23
- vAlign = 'start',
24
- className,
25
- ...props
26
- }: ScaffoldProps,
9
+ { children, className, vAlign = 'start', hAlign = 'start', ...props }: ScaffoldProps,
27
10
  ref
28
11
  ) {
29
12
  return (
30
- <Box
13
+ <VStack
31
14
  ref={ref}
32
- width={width}
33
- height={height}
34
- minWidth={minWidth}
35
- maxWidth={maxWidth}
36
- minHeight={minHeight}
37
- maxHeight={maxHeight}
38
- data-h-alignment={hAlign}
39
- data-v-alignment={vAlign}
15
+ as="section"
16
+ vAlign={vAlign}
17
+ hAlign={hAlign}
40
18
  className={clsx(
41
19
  className,
42
20
  styles['scaffold'],
@@ -46,25 +24,7 @@ export const Scaffold = React.forwardRef<HTMLElement, ScaffoldProps>(function Sc
46
24
  )}
47
25
  {...props}
48
26
  >
49
- <VStack
50
- as="section"
51
- minWidth={minWidth}
52
- maxWidth={maxWidth}
53
- minHeight={minHeight}
54
- maxHeight={maxHeight}
55
- hAlign={hAlign}
56
- vAlign={vAlign}
57
- ref={ref}
58
- className={clsx(
59
- styles['scaffold-stack'],
60
- styles['container-stack'],
61
- 'tcn-container-stack',
62
- 'tcn-scaffold-stack'
63
- )}
64
- zIndex={0}
65
- >
66
- {children}
67
- </VStack>
68
- </Box>
27
+ {children}
28
+ </VStack>
69
29
  );
70
30
  });
@@ -21,6 +21,8 @@ export { TTable, THead, TBody, TFoot, TR, TH, TD } from './table/table.js';
21
21
 
22
22
  export { Rail, type RailProps } from './containers/rail.js';
23
23
  export { Columns, type ColumnsProps } from './containers/columns/columns.js';
24
+ export { Row, type RowProps } from './containers/rows/row.js';
25
+ export { Rows, type RowsProps } from './containers/rows/rows.js';
24
26
  export {
25
27
  UtilityStrip,
26
28
  type UtilityStripProps,
@@ -2,7 +2,7 @@ import { Header, Scaffold } from '../../layouts/index.js';
2
2
  import { ZStack } from '../../stacks/z_stack.js';
3
3
  import { BodyText } from '../../typography/index.js';
4
4
  import { Title } from '../../typography/title/title.js';
5
- import { DragHandle } from '../../utils/dnd/handle.js';
5
+ import { DragHandle } from '../../utils/decorators/draggable/drag_handle.js';
6
6
  import { Frame, type FrameOwnProps } from './frame.js';
7
7
  import styles from './frame_stories.module.css';
8
8
  export default {
@@ -24,6 +24,7 @@ export const FrameStory = (args: Omit<FrameOwnProps, 'children'>) => {
24
24
  <Frame
25
25
  width="300px"
26
26
  height="300px"
27
+ minWidth="100px"
27
28
  className={styles['sb-frame-container']}
28
29
  {...args}
29
30
  >
@@ -1,5 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
- import React, { useCallback } from 'react';
2
+ import React, { useCallback, useRef } from 'react';
3
3
  import { flushSync } from 'react-dom';
4
4
  import {
5
5
  Box,
@@ -8,12 +8,14 @@ import {
8
8
  type OnHeightResizePayload,
9
9
  type OnWidthResizePayload,
10
10
  } from '../../stacks/index.js';
11
- import { useDragContainer } from '../../utils/dnd/context.js';
12
- import { Draggable } from '../../utils/dnd/draggable/draggable.js';
11
+ import { useDragContainer } from '../../utils/decorators/draggable/context.js';
12
+ import { Draggable } from '../../utils/decorators/draggable/draggable.js';
13
+ import { Resizable } from '../../utils/decorators/resizable/resizable.js';
14
+ import { ResizeHandle } from '../../utils/decorators/resizable/resize_handle.js';
13
15
  import { Portal } from '../portal/portal.js';
14
16
 
15
17
  // Styles
16
- import styles from './frame.module.css';
18
+
17
19
  export interface FrameOwnProps {
18
20
  isOpen?: boolean;
19
21
  draggable?: boolean;
@@ -37,6 +39,8 @@ export const Frame = React.forwardRef<HTMLElement, FrameProps>(function Frame(
37
39
  enableResizeOnEnd = true,
38
40
  enableResizeOnLeft = false,
39
41
  enableResizeOnRight = false,
42
+ minWidth = 1,
43
+ minHeight = 1,
40
44
  ...rest
41
45
  }: FrameProps,
42
46
  ref
@@ -56,6 +60,8 @@ export const Frame = React.forwardRef<HTMLElement, FrameProps>(function Frame(
56
60
  enableResizeOnRight={resizable && enableResizeOnRight}
57
61
  enableResizeOnLeft={resizable && enableResizeOnLeft}
58
62
  draggable={draggable}
63
+ minWidth={minWidth}
64
+ minHeight={minHeight}
59
65
  {...rest}
60
66
  >
61
67
  {children}
@@ -77,18 +83,36 @@ export const FrameDialog = React.forwardRef<HTMLElement, FrameDialogProps>(
77
83
  draggable,
78
84
  onWidthResize,
79
85
  onHeightResize,
86
+ onWidthResizeEnd,
87
+ onHeightResizeEnd,
88
+ enableResizeOnTop,
89
+ enableResizeOnBottom,
90
+ enableResizeOnStart,
91
+ enableResizeOnEnd,
92
+ enableResizeOnLeft,
93
+ enableResizeOnRight,
80
94
  ...rest
81
95
  }: FrameDialogProps,
82
96
  ref: React.Ref<HTMLElement>
83
97
  ) {
84
98
  const drag = useDragContainer();
99
+ const prevWidthRef = useRef<number | null>(null);
100
+ const prevHeightRef = useRef<number | null>(null);
85
101
 
86
102
  const handleWidthResize = React.useCallback(
87
103
  (payload: OnWidthResizePayload) => {
88
- if (!draggable) return;
89
- if (payload.currentDelta === 0) return;
90
- const sign = payload.origin === 'right' ? 1 : -1;
91
- const dx = (payload.currentDelta / 2) * sign;
104
+ const actualDelta =
105
+ prevWidthRef.current !== null
106
+ ? payload.width - prevWidthRef.current
107
+ : payload.currentDelta;
108
+ prevWidthRef.current = payload.width;
109
+
110
+ if (!draggable || actualDelta === 0) {
111
+ onWidthResize?.(payload);
112
+ return;
113
+ }
114
+ const sign = payload.origin === 'end' ? 1 : -1;
115
+ const dx = (actualDelta / 2) * sign;
92
116
  flushSync(() => {
93
117
  drag.setPosition(prev => ({
94
118
  x: prev.x + dx,
@@ -103,11 +127,18 @@ export const FrameDialog = React.forwardRef<HTMLElement, FrameDialogProps>(
103
127
 
104
128
  const handleHeightResize = useCallback(
105
129
  (payload: OnHeightResizePayload) => {
106
- if (!draggable) return;
107
- if (payload.currentDelta === 0) return;
130
+ const actualDelta =
131
+ prevHeightRef.current !== null
132
+ ? payload.height - prevHeightRef.current
133
+ : payload.currentDelta;
134
+ prevHeightRef.current = payload.height;
135
+
136
+ if (!draggable || actualDelta === 0) {
137
+ onHeightResize?.(payload);
138
+ return;
139
+ }
108
140
  const sign = payload.origin === 'bottom' ? 1 : -1;
109
- const half = payload.currentDelta / 2;
110
- const dy = half * sign;
141
+ const dy = (actualDelta / 2) * sign;
111
142
  flushSync(() => {
112
143
  drag.setPosition(prev => ({
113
144
  x: prev.x,
@@ -120,17 +151,34 @@ export const FrameDialog = React.forwardRef<HTMLElement, FrameDialogProps>(
120
151
  );
121
152
 
122
153
  return (
123
- <Box
124
- className={clsx(styles['frame-dialog'], 'tcn-frame-dialog', className)}
125
- ref={ref}
154
+ <Resizable
126
155
  onWidthResize={handleWidthResize}
127
156
  onHeightResize={handleHeightResize}
128
- as={as}
129
- role={role}
130
- {...rest}
157
+ onWidthResizeEnd={(width, origin) => {
158
+ prevWidthRef.current = null;
159
+ onWidthResizeEnd?.(width, origin);
160
+ }}
161
+ onHeightResizeEnd={(height, origin) => {
162
+ prevHeightRef.current = null;
163
+ onHeightResizeEnd?.(height, origin);
164
+ }}
131
165
  >
132
- {children}
133
- </Box>
166
+ <Box
167
+ className={clsx('tcn-frame', 'tcn-frame-dialog', className)}
168
+ ref={ref}
169
+ as={as}
170
+ role={role}
171
+ {...rest}
172
+ >
173
+ {children}
174
+ </Box>
175
+ {enableResizeOnTop && <ResizeHandle position="top" />}
176
+ {enableResizeOnBottom && <ResizeHandle position="bottom" />}
177
+ {enableResizeOnStart && <ResizeHandle position="start" />}
178
+ {enableResizeOnEnd && <ResizeHandle position="end" />}
179
+ {enableResizeOnLeft && <ResizeHandle position="start" />}
180
+ {enableResizeOnRight && <ResizeHandle position="end" />}
181
+ </Resizable>
134
182
  );
135
183
  }
136
184
  );
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, type PropsWithChildren } from 'react';
2
- import { ClickAwayListener } from '../../../utils/click_away_listener.js';
3
- import { ScrollAwayListener } from '../../../utils/scroll_away_listener.js';
4
- import { MouseLeaveRegion } from '../../../utils/mouse_leave_region.js';
2
+ import { ClickAwayListener } from '../../../utils/listeners/click_away_listener.js';
3
+ import { ScrollAwayListener } from '../../../utils/listeners/scroll_away_listener.js';
4
+ import { MouseLeaveRegion } from '../../../utils/listeners/mouse_leave_region.js';
5
5
 
6
6
  export enum PopperDismissal {
7
7
  CLICK_AWAY = 'clickAway',
@@ -3,7 +3,7 @@ import { ZStack } from '../../stacks/z_stack.js';
3
3
  import { BodyText } from '../../typography/index.js';
4
4
  import { Title } from '../../typography/title/title.js';
5
5
  import { Slide, type SlideProps } from './slide.js';
6
- import { DragHandle } from '../../utils/dnd/handle.js';
6
+ import { DragHandle } from '../../utils/decorators/draggable/drag_handle.js';
7
7
 
8
8
  export default {
9
9
  title: 'Overlays/Floating/Slide',
@@ -7,8 +7,6 @@ import { removeUndefinedProperties } from '../utils/remove_undefined_properties.
7
7
  import { BottomResizeHandle } from './bottom_resize_handle.js';
8
8
  import { EndResizeHandle } from './end_resize_handle.js';
9
9
  import { HandleProps } from './handle_props.js';
10
- import { LeftResizeHandle } from './left_resize_handle.js';
11
- import { RightResizeHandle } from './right_resize_handle.js';
12
10
  import { StartResizeHandle } from './start_resize_handle.js';
13
11
  import { TopResizeHandle } from './top_resize_handle.js';
14
12
  import type {
@@ -43,20 +41,47 @@ export interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttri
43
41
  overflow?: React.CSSProperties['overflow'];
44
42
  overflowX?: React.CSSProperties['overflowX'];
45
43
  overflowY?: React.CSSProperties['overflowY'];
44
+ /** @deprecated Use Resizable + ResizeHandle instead */
46
45
  enableResizeOnTop?: boolean;
46
+ /** @deprecated Use Resizable + ResizeHandle instead */
47
47
  enableResizeOnEnd?: boolean;
48
+ /** @deprecated Use Resizable + ResizeHandle instead */
48
49
  enableResizeOnBottom?: boolean;
50
+ /** @deprecated Use Resizable + ResizeHandle instead */
49
51
  enableResizeOnStart?: boolean;
52
+ /** @deprecated Use Resizable + ResizeHandle instead */
50
53
  enableResizeOnLeft?: boolean;
54
+ /** @deprecated Use Resizable + ResizeHandle instead */
51
55
  enableResizeOnRight?: boolean;
56
+ /** @deprecated Use Resizable + ResizeHandle instead */
52
57
  horizontalHandleProps?: HandleProps;
58
+ /** @deprecated Use Resizable + ResizeHandle instead */
53
59
  verticalHandleProps?: HandleProps;
60
+ /** @deprecated Use Resizable + ResizeHandle instead */
54
61
  onWidthResize?: OnWidthResize;
62
+ /** @deprecated Use Resizable + ResizeHandle instead */
55
63
  onHeightResize?: OnHeightResize;
64
+ /** @deprecated Use Resizable + ResizeHandle instead */
56
65
  onWidthResizeEnd?: OnWidthResizeEnd;
66
+ /** @deprecated Use Resizable + ResizeHandle instead */
57
67
  onHeightResizeEnd?: OnHeightResizeEnd;
58
68
  }
59
69
 
70
+ /** Union of deprecated resize-related prop names on BoxProps. Useful for Omit<BoxProps, DeprecatedBoxResizeProps>. */
71
+ export type DeprecatedBoxResizeProps =
72
+ | 'enableResizeOnTop'
73
+ | 'enableResizeOnEnd'
74
+ | 'enableResizeOnBottom'
75
+ | 'enableResizeOnStart'
76
+ | 'enableResizeOnLeft'
77
+ | 'enableResizeOnRight'
78
+ | 'horizontalHandleProps'
79
+ | 'verticalHandleProps'
80
+ | 'onWidthResize'
81
+ | 'onHeightResize'
82
+ | 'onWidthResizeEnd'
83
+ | 'onHeightResizeEnd';
84
+
60
85
  export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
61
86
  {
62
87
  style,
@@ -206,7 +231,7 @@ export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
206
231
  />
207
232
  )}
208
233
  {enableResizeOnLeft && (
209
- <LeftResizeHandle
234
+ <StartResizeHandle
210
235
  onWidthResize={onWidthResize}
211
236
  onWidthResizeEnd={onWidthResizeEnd}
212
237
  targetRef={boxRef}
@@ -214,7 +239,7 @@ export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
214
239
  />
215
240
  )}
216
241
  {enableResizeOnRight && (
217
- <RightResizeHandle
242
+ <EndResizeHandle
218
243
  onWidthResize={onWidthResize}
219
244
  onWidthResizeEnd={onWidthResizeEnd}
220
245
  targetRef={boxRef}
@@ -11,6 +11,7 @@ export type DetectResizeBoundsResult = {
11
11
  hitMin: boolean;
12
12
  hitMax: boolean;
13
13
  clamped: boolean;
14
+ clampedSize: number | null;
14
15
  };
15
16
 
16
17
  const styleKeys = {
@@ -36,10 +37,12 @@ function detectByPixelValue(nextSize: number, min: string, max: string) {
36
37
  const maxPx = parsePx(max);
37
38
  const hitMin = minPx !== null && nextSize < minPx;
38
39
  const hitMax = maxPx !== null && nextSize > maxPx;
40
+ const clamped = hitMin || hitMax;
39
41
  return {
40
42
  hitMin,
41
43
  hitMax,
42
- clamped: hitMin || hitMax,
44
+ clamped,
45
+ clampedSize: clamped ? (hitMin ? minPx : maxPx) : null,
43
46
  };
44
47
  }
45
48
 
@@ -76,6 +79,7 @@ export function detectResizeBounds({
76
79
  hitMin,
77
80
  hitMax,
78
81
  clamped,
82
+ clampedSize: clamped ? renderedSize : null,
79
83
  };
80
84
  } finally {
81
85
  // revert the style change
@@ -15,7 +15,7 @@ export function EndResizeHandle({
15
15
  targetRef,
16
16
  onWidthResize,
17
17
  onWidthResizeEnd,
18
- 'right'
18
+ 'end'
19
19
  );
20
20
  const offset = handleProps?.offset ? handleProps.offset : -8;
21
21
 
@@ -19,7 +19,7 @@ export function createHorizontalResizeHandler(
19
19
  targetRef: React.MutableRefObject<HTMLElement | null>,
20
20
  onWidthResize?: OnWidthResize,
21
21
  onWidthResizeEnd?: (width: number, origin: WidthResizeOrigin) => void,
22
- origin: WidthResizeOrigin = 'right',
22
+ origin: WidthResizeOrigin = 'end',
23
23
  invert = false,
24
24
  disableDirection = false
25
25
  ) {
@@ -16,7 +16,7 @@ export function StartResizeHandle({
16
16
  targetRef,
17
17
  onWidthResize,
18
18
  onWidthResizeEnd,
19
- 'left',
19
+ 'start',
20
20
  true
21
21
  );
22
22
 
@@ -1,7 +1,8 @@
1
1
  import type { HandleProps } from './handle_props.js';
2
+ import type { HorizontalSide, VerticalSide } from '../../utils/types/sides.js';
2
3
 
3
- export type WidthResizeOrigin = 'left' | 'right';
4
- export type HeightResizeOrigin = 'top' | 'bottom';
4
+ export type WidthResizeOrigin = HorizontalSide;
5
+ export type HeightResizeOrigin = VerticalSide;
5
6
 
6
7
  export interface BaseOnResizePayload<
7
8
  Origin extends WidthResizeOrigin | HeightResizeOrigin,
@@ -1,7 +1,7 @@
1
1
  import { ChevronLeftIcon as ChevronLeft } from '@tcn/icons/chevron_left_icon.js';
2
2
  import { PlusIcon as Plus } from '@tcn/icons/plus_icon.js';
3
3
  import React from 'react';
4
- import { Button, SlimButton } from '../actions/index.js';
4
+ import { Button } from '../actions/index.js';
5
5
  import { Title } from '../typography/index.js';
6
6
  import { HCollapsibleBox } from './h_collapsible_box.js';
7
7
  import { HStack } from './h_stack.js';
@@ -26,14 +26,14 @@ function MyPanel() {
26
26
  return (
27
27
  <VStack height="100%" vAlign="start" style={{ backgroundColor: 'white' }}>
28
28
  <HStack padding="8px">
29
- <SlimButton hierarchy="tertiary">
29
+ <Button utility hierarchy="tertiary">
30
30
  <ChevronLeft size="lg" />
31
- </SlimButton>
31
+ </Button>
32
32
  <Title emphasis="strong">Foo</Title>
33
33
  <Spacer />
34
- <SlimButton size="md" hierarchy="primary">
34
+ <Button utility size="md" hierarchy="primary">
35
35
  <Plus />
36
- </SlimButton>
36
+ </Button>
37
37
  </HStack>
38
38
  </VStack>
39
39
  );
@@ -6,7 +6,7 @@ import { BodyText, Headline, Subheadline, Title } from '../typography/index.js';
6
6
  import { MoreHorizontalIcon } from '@tcn/icons/more_horizontal_icon.js';
7
7
  import { PlayFilledIcon } from '@tcn/icons/play_filled_icon.js';
8
8
  import { ShuffleIcon } from '@tcn/icons/shuffle_icon.js';
9
- import { Button, SlimButton } from '../actions/index.js';
9
+ import { Button } from '../actions/index.js';
10
10
  import { CloudDownloadIcon } from '@tcn/icons/cloud_download_icon.js';
11
11
  import { Spacer } from './spacer.js';
12
12
  import styles from './demo.module.css';
@@ -28,9 +28,9 @@ export function Track() {
28
28
  </HStack>
29
29
  <HStack width="auto" gap="8px">
30
30
  <BodyText>2:00</BodyText>
31
- <SlimButton hierarchy="tertiary" gap="4px">
31
+ <Button utility hierarchy="tertiary" gap="4px">
32
32
  <MoreHorizontalIcon size="lg" />
33
- </SlimButton>
33
+ </Button>
34
34
  </HStack>
35
35
  </HStack>
36
36
  );
@@ -83,12 +83,12 @@ export function Playing() {
83
83
  </Button>
84
84
  <Spacer />
85
85
  <HStack width="auto" gap="8px">
86
- <SlimButton hierarchy="secondary" gap="4px">
86
+ <Button utility hierarchy="secondary" gap="4px">
87
87
  <CloudDownloadIcon size="lg" />
88
- </SlimButton>
89
- <SlimButton hierarchy="secondary" gap="4px">
88
+ </Button>
89
+ <Button utility hierarchy="secondary" gap="4px">
90
90
  <MoreHorizontalIcon size="lg" />
91
- </SlimButton>
91
+ </Button>
92
92
  </HStack>
93
93
  </HStack>
94
94
  </VStack>
@@ -0,0 +1,5 @@
1
+ @layer tcn-system {
2
+ .card {
3
+ height: auto;
4
+ }
5
+ }