@tcn/ui 0.2.0 → 0.3.1

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 (341) hide show
  1. package/dist/Color-ASIRERSW-B4GaVKuQ.js +990 -0
  2. package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +1 -0
  3. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js +1485 -0
  4. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +1 -0
  5. package/dist/actions/__docs__/components/gallery.d.ts +8 -0
  6. package/dist/actions/__docs__/components/gallery.d.ts.map +1 -0
  7. package/dist/actions/__docs__/components/gallery.js +20 -0
  8. package/dist/actions/__docs__/components/gallery.js.map +1 -0
  9. package/dist/actions/__docs__/components/showcase.d.ts +27 -0
  10. package/dist/actions/__docs__/components/showcase.d.ts.map +1 -0
  11. package/dist/actions/__docs__/components/showcase.js +15 -0
  12. package/dist/actions/__docs__/components/showcase.js.map +1 -0
  13. package/dist/actions/button/base_button/base_button.d.ts +2 -0
  14. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  15. package/dist/actions/button/base_button/base_button.js +18 -16
  16. package/dist/actions/button/base_button/base_button.js.map +1 -1
  17. package/dist/actions/button/button/button.js +6 -6
  18. package/dist/actions/button/button_group/button_group.js +1 -1
  19. package/dist/actions/button/select_group/select_group.js +13 -13
  20. package/dist/actions/button/select_group/single_select_group.js +6 -6
  21. package/dist/actions/button/slim_button/slim_button.js +2 -2
  22. package/dist/actions/types.d.ts +2 -0
  23. package/dist/actions/types.d.ts.map +1 -0
  24. package/dist/actions/types.js +2 -0
  25. package/dist/actions/types.js.map +1 -0
  26. package/dist/divider.module-FptFV0PX.js +5 -0
  27. package/dist/divider.module-FptFV0PX.js.map +1 -0
  28. package/dist/feedback/loading/loading.js +12 -12
  29. package/dist/feedback/loading/loading.js.map +1 -1
  30. package/dist/feedback/progress/progress_bar.js +1 -1
  31. package/dist/form/field/common/field_control/field_control.js +8 -8
  32. package/dist/form/field/common/status_input/status_input.js +6 -6
  33. package/dist/form/field/field.js +6 -6
  34. package/dist/form/field/h_field/h_field.js +11 -11
  35. package/dist/form/field/v_field/v_field.js +10 -10
  36. package/dist/form/field_set/field_set.js +3 -3
  37. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +6 -0
  38. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +1 -0
  39. package/dist/frame.css +1 -0
  40. package/dist/gallery.css +1 -0
  41. package/dist/inputs/checkbox/checkbox.js +11 -11
  42. package/dist/inputs/color_input/color_input.js +1 -1
  43. package/dist/inputs/color_input/color_input.js.map +1 -1
  44. package/dist/inputs/color_input/color_picker.js +6 -6
  45. package/dist/inputs/combo_box/combo_box.js +17 -17
  46. package/dist/inputs/date_picker/date_picker.js +19 -19
  47. package/dist/inputs/date_picker/date_picker_body.js +2 -2
  48. package/dist/inputs/date_picker/date_picker_input.js +20 -20
  49. package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
  50. package/dist/inputs/date_picker/date_picker_year_input.js +1 -1
  51. package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
  52. package/dist/inputs/date_picker/date_picker_year_selector.js +1 -1
  53. package/dist/inputs/input/input.js +5 -5
  54. package/dist/inputs/mask_input/key_capture_input.js +8 -8
  55. package/dist/inputs/mask_input/mask_input.js +5 -5
  56. package/dist/inputs/multi_combo_box/multi_combo_box.js +17 -17
  57. package/dist/inputs/multiselect/multiselect.js +14 -14
  58. package/dist/inputs/multiselect/multiselect_row.js +8 -8
  59. package/dist/inputs/phone_number_input/phone_number_input.js +12 -12
  60. package/dist/inputs/radio/radio.js +10 -10
  61. package/dist/inputs/radio/radio_row.js +3 -3
  62. package/dist/inputs/select/select.js +15 -15
  63. package/dist/inputs/slider/slider.js +11 -11
  64. package/dist/inputs/suggestions/suggestion_list.js +2 -2
  65. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  66. package/dist/inputs/switch/switch.js +5 -5
  67. package/dist/inputs/textarea/textarea.js +7 -7
  68. package/dist/inputs/unit_input/unit_input.js +5 -5
  69. package/dist/layouts/body/h_body.js +7 -7
  70. package/dist/layouts/body/v_body.js +6 -6
  71. package/dist/layouts/column/column.js +17 -17
  72. package/dist/layouts/divider/divider.js +24 -23
  73. package/dist/layouts/divider/divider.js.map +1 -1
  74. package/dist/layouts/footer/footer.js +7 -7
  75. package/dist/layouts/grid/grid.js +24 -24
  76. package/dist/layouts/header/header.js +2 -2
  77. package/dist/layouts/index.d.ts +6 -5
  78. package/dist/layouts/index.d.ts.map +1 -1
  79. package/dist/layouts/index.js +28 -26
  80. package/dist/layouts/index.js.map +1 -1
  81. package/dist/layouts/list/item.js +2 -2
  82. package/dist/layouts/list/list.js +7 -7
  83. package/dist/layouts/list/section_header.js +6 -6
  84. package/dist/layouts/scaffold/scaffold.d.ts +9 -0
  85. package/dist/layouts/scaffold/scaffold.d.ts.map +1 -0
  86. package/dist/layouts/scaffold/scaffold.js +55 -0
  87. package/dist/layouts/scaffold/scaffold.js.map +1 -0
  88. package/dist/layouts/sidebar_end/sidebar_end.js +14 -14
  89. package/dist/layouts/sidebar_start/sidebar_start.js +10 -10
  90. package/dist/layouts/utility_bar/utility_bar.js +10 -10
  91. package/dist/modal.css +1 -1
  92. package/dist/overlay/frame/frame.d.ts.map +1 -1
  93. package/dist/overlay/frame/frame.js +22 -5
  94. package/dist/overlay/frame/frame.js.map +1 -1
  95. package/dist/overlay/index.d.ts +9 -2
  96. package/dist/overlay/index.d.ts.map +1 -1
  97. package/dist/overlay/index.js +22 -10
  98. package/dist/overlay/index.js.map +1 -1
  99. package/dist/overlay/menu/menu.d.ts +1 -1
  100. package/dist/overlay/menu/menu.d.ts.map +1 -1
  101. package/dist/overlay/menu/menu.js +36 -36
  102. package/dist/overlay/menu/menu.js.map +1 -1
  103. package/dist/overlay/popper/base/base_popper.d.ts +11 -0
  104. package/dist/overlay/popper/base/base_popper.d.ts.map +1 -0
  105. package/dist/overlay/popper/base/base_popper.js +27 -0
  106. package/dist/overlay/popper/base/base_popper.js.map +1 -0
  107. package/dist/overlay/popper/base/dismissal_decorator.d.ts +16 -0
  108. package/dist/overlay/popper/base/dismissal_decorator.d.ts.map +1 -0
  109. package/dist/overlay/popper/base/dismissal_decorator.js +69 -0
  110. package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -0
  111. package/dist/overlay/popper/context_popper.d.ts +11 -0
  112. package/dist/overlay/popper/context_popper.d.ts.map +1 -0
  113. package/dist/overlay/popper/context_popper.js +33 -0
  114. package/dist/overlay/popper/context_popper.js.map +1 -0
  115. package/dist/overlay/popper/element_popper.d.ts +7 -0
  116. package/dist/overlay/popper/element_popper.d.ts.map +1 -0
  117. package/dist/overlay/popper/element_popper.js +33 -0
  118. package/dist/overlay/popper/element_popper.js.map +1 -0
  119. package/dist/overlay/popper/hooks/use_context_trigger.d.ts +7 -0
  120. package/dist/overlay/popper/hooks/use_context_trigger.d.ts.map +1 -0
  121. package/dist/overlay/popper/hooks/use_context_trigger.js +31 -0
  122. package/dist/overlay/popper/hooks/use_context_trigger.js.map +1 -0
  123. package/dist/overlay/popper/hooks/use_hover_trigger.d.ts +6 -0
  124. package/dist/overlay/popper/hooks/use_hover_trigger.d.ts.map +1 -0
  125. package/dist/overlay/popper/hooks/use_hover_trigger.js +17 -0
  126. package/dist/overlay/popper/hooks/use_hover_trigger.js.map +1 -0
  127. package/dist/overlay/popper/hooks/use_restore_focus.d.ts +2 -0
  128. package/dist/overlay/popper/hooks/use_restore_focus.d.ts.map +1 -0
  129. package/dist/overlay/popper/hooks/use_restore_focus.js +18 -0
  130. package/dist/overlay/popper/hooks/use_restore_focus.js.map +1 -0
  131. package/dist/overlay/popper/legacy/popper.d.ts.map +1 -0
  132. package/dist/overlay/popper/{popper.js → legacy/popper.js} +6 -6
  133. package/dist/overlay/popper/legacy/popper.js.map +1 -0
  134. package/dist/overlay/popper/preview_popper.d.ts +7 -0
  135. package/dist/overlay/popper/preview_popper.d.ts.map +1 -0
  136. package/dist/overlay/popper/preview_popper.js +46 -0
  137. package/dist/overlay/popper/preview_popper.js.map +1 -0
  138. package/dist/overlay/portal/portal_platform_context.js +4 -4
  139. package/dist/overlay/tethered/element_tethered.d.ts +8 -0
  140. package/dist/overlay/tethered/element_tethered.d.ts.map +1 -0
  141. package/dist/overlay/tethered/element_tethered.js +33 -0
  142. package/dist/overlay/tethered/element_tethered.js.map +1 -0
  143. package/dist/overlay/tethered/hooks/calculate_position.d.ts +19 -0
  144. package/dist/overlay/tethered/hooks/calculate_position.d.ts.map +1 -0
  145. package/dist/overlay/tethered/hooks/calculate_position.js +43 -0
  146. package/dist/overlay/tethered/hooks/calculate_position.js.map +1 -0
  147. package/dist/overlay/tethered/hooks/useTether.d.ts +19 -0
  148. package/dist/overlay/tethered/hooks/useTether.d.ts.map +1 -0
  149. package/dist/overlay/tethered/hooks/useTether.js +61 -0
  150. package/dist/overlay/tethered/hooks/useTether.js.map +1 -0
  151. package/dist/overlay/tethered/tethered.d.ts +20 -0
  152. package/dist/overlay/tethered/tethered.d.ts.map +1 -0
  153. package/dist/overlay/tethered/tethered.js +59 -0
  154. package/dist/overlay/tethered/tethered.js.map +1 -0
  155. package/dist/overlay/tethered/types.d.ts +3 -0
  156. package/dist/overlay/tethered/types.d.ts.map +1 -0
  157. package/dist/overlay/tethered/types.js +2 -0
  158. package/dist/overlay/tethered/types.js.map +1 -0
  159. package/dist/popper.css +1 -1
  160. package/dist/scaffold.css +1 -0
  161. package/dist/showcase-WfP6kBEb.js +58401 -0
  162. package/dist/showcase-WfP6kBEb.js.map +1 -0
  163. package/dist/showcase.css +1 -0
  164. package/dist/stacks/box/box.js +24 -24
  165. package/dist/stacks/h_collapsible_box.js +3 -3
  166. package/dist/stacks/h_stack.js +41 -41
  167. package/dist/stacks/spacer.js +11 -11
  168. package/dist/stacks/story_components/circle.js +10 -10
  169. package/dist/stacks/story_components/picture_placeholder.js +9 -9
  170. package/dist/stacks/story_components/rect.js +7 -7
  171. package/dist/stacks/story_components/style_box.js +4 -4
  172. package/dist/stacks/utils/use_is_collapsed.js +6 -6
  173. package/dist/stacks/v_collapsible_box.js +3 -3
  174. package/dist/stacks/v_stack.js +42 -42
  175. package/dist/stacks/z_stack.js +39 -39
  176. package/dist/surfaces/alert/alert.js +4 -4
  177. package/dist/surfaces/card/card.d.ts +2 -2
  178. package/dist/surfaces/card/card.d.ts.map +1 -1
  179. package/dist/surfaces/card/card.js +7 -7
  180. package/dist/surfaces/card/card.js.map +1 -1
  181. package/dist/surfaces/confirm/confirm.js +9 -9
  182. package/dist/surfaces/drawers/drawer_start/drawer_start.js +2 -2
  183. package/dist/surfaces/drawers/drawer_top/drawer_top.js +2 -2
  184. package/dist/surfaces/index.d.ts +2 -0
  185. package/dist/surfaces/index.d.ts.map +1 -1
  186. package/dist/surfaces/index.js +22 -18
  187. package/dist/surfaces/index.js.map +1 -1
  188. package/dist/surfaces/modal/modal.d.ts +3 -3
  189. package/dist/surfaces/modal/modal.d.ts.map +1 -1
  190. package/dist/surfaces/modal/modal.js +14 -14
  191. package/dist/surfaces/modal/modal.js.map +1 -1
  192. package/dist/surfaces/page/h_page.js +7 -7
  193. package/dist/surfaces/page/v_page.js +5 -5
  194. package/dist/surfaces/panel/h_panel.js +29 -30
  195. package/dist/surfaces/panel/h_panel.js.map +1 -1
  196. package/dist/surfaces/panel/v_panel.d.ts +3 -7
  197. package/dist/surfaces/panel/v_panel.d.ts.map +1 -1
  198. package/dist/surfaces/panel/v_panel.js +12 -54
  199. package/dist/surfaces/panel/v_panel.js.map +1 -1
  200. package/dist/surfaces/pop_confirm/pop_confirm.d.ts +5 -0
  201. package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -0
  202. package/dist/surfaces/pop_confirm/pop_confirm.js +37 -0
  203. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -0
  204. package/dist/surfaces/popconfirm/pop_confirm.d.ts +5 -0
  205. package/dist/surfaces/popconfirm/pop_confirm.d.ts.map +1 -0
  206. package/dist/surfaces/popconfirm/pop_confirm.js +13 -0
  207. package/dist/surfaces/popconfirm/pop_confirm.js.map +1 -0
  208. package/dist/surfaces/popover/popover.d.ts +1 -1
  209. package/dist/surfaces/popover/popover.d.ts.map +1 -1
  210. package/dist/surfaces/popover/popover.js +1 -1
  211. package/dist/surfaces/popover/popover.js.map +1 -1
  212. package/dist/surfaces/tooltip/tooltip.d.ts +10 -0
  213. package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -0
  214. package/dist/surfaces/tooltip/tooltip.js +38 -0
  215. package/dist/surfaces/tooltip/tooltip.js.map +1 -0
  216. package/dist/surfaces/window/window.d.ts +3 -3
  217. package/dist/surfaces/window/window.d.ts.map +1 -1
  218. package/dist/surfaces/window/window.js +15 -13
  219. package/dist/surfaces/window/window.js.map +1 -1
  220. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js +3777 -0
  221. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +1 -0
  222. package/dist/tethered.css +1 -0
  223. package/dist/themes/themes/ergo/ergo_theme.js +177 -206
  224. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  225. package/dist/tokens/badge/badge.js +9 -9
  226. package/dist/tokens/bubble/bubble.js +8 -8
  227. package/dist/tokens/chip/chip.js +3 -3
  228. package/dist/tooltip.css +1 -1
  229. package/dist/utility_bar.css +1 -1
  230. package/dist/utils/click_away_listener.d.ts +1 -0
  231. package/dist/utils/click_away_listener.d.ts.map +1 -1
  232. package/dist/utils/click_away_listener.js +12 -11
  233. package/dist/utils/click_away_listener.js.map +1 -1
  234. package/dist/utils/dnd/draggable/draggable.js +4 -4
  235. package/dist/utils/dnd/handle.js +8 -8
  236. package/dist/utils/focus_redirect.js +5 -5
  237. package/dist/utils/hooks/make_context_hook.js +4 -4
  238. package/dist/utils/hooks/use_media_query.js +2 -2
  239. package/dist/utils/hooks/use_media_query.js.map +1 -1
  240. package/dist/utils/index.d.ts +6 -5
  241. package/dist/utils/index.d.ts.map +1 -1
  242. package/dist/utils/index.js +26 -23
  243. package/dist/utils/index.js.map +1 -1
  244. package/dist/utils/mouse_leave_region.d.ts +8 -0
  245. package/dist/utils/mouse_leave_region.d.ts.map +1 -0
  246. package/dist/utils/mouse_leave_region.js +26 -0
  247. package/dist/utils/mouse_leave_region.js.map +1 -0
  248. package/dist/utils/types/dimensions.d.ts +11 -1
  249. package/dist/utils/types/dimensions.d.ts.map +1 -1
  250. package/package.json +3 -3
  251. package/src/actions/__docs__/actions.mdx +131 -0
  252. package/src/actions/__docs__/actions.stories.tsx +309 -0
  253. package/src/actions/__docs__/components/gallery.module.css +6 -0
  254. package/src/actions/__docs__/components/gallery.tsx +28 -0
  255. package/src/actions/__docs__/components/showcase.module.css +55 -0
  256. package/src/actions/__docs__/components/showcase.tsx +121 -0
  257. package/src/actions/button/base_button/base_button.tsx +5 -1
  258. package/src/actions/types.ts +6 -0
  259. package/src/inputs/color_input/color_input.tsx +1 -1
  260. package/src/inputs/date_picker/date_picker_input.tsx +1 -1
  261. package/src/inputs/date_picker/date_picker_year_input.tsx +1 -1
  262. package/src/inputs/suggestions/suggestion_list.tsx +1 -1
  263. package/src/layouts/index.ts +7 -5
  264. package/src/layouts/scaffold/scaffold.module.css +5 -0
  265. package/src/layouts/scaffold/scaffold.tsx +60 -0
  266. package/src/layouts/utility_bar/utility_bar.module.css +0 -3
  267. package/src/overlay/frame/frame.module.css +5 -0
  268. package/src/overlay/frame/frame.stories.tsx +1 -1
  269. package/src/overlay/frame/frame.tsx +19 -3
  270. package/src/overlay/index.ts +29 -2
  271. package/src/overlay/menu/menu.tsx +1 -1
  272. package/src/overlay/popper/__stories__/base_args.ts +75 -0
  273. package/src/overlay/popper/__stories__/context_popper.stories.tsx +77 -0
  274. package/src/overlay/popper/__stories__/element_popper.stories.tsx +80 -0
  275. package/src/overlay/popper/__stories__/preview_popper.stories.tsx +73 -0
  276. package/src/overlay/popper/base/base_popper.tsx +55 -0
  277. package/src/overlay/popper/base/dismissal_decorator.tsx +80 -0
  278. package/src/overlay/popper/context_popper.tsx +43 -0
  279. package/src/overlay/popper/element_popper.tsx +42 -0
  280. package/src/overlay/popper/hooks/use_context_trigger.ts +50 -0
  281. package/src/overlay/popper/hooks/use_hover_trigger.ts +24 -0
  282. package/src/overlay/popper/hooks/use_restore_focus.ts +16 -0
  283. package/src/overlay/popper/{popper.stories.tsx → legacy/popper.stories.tsx} +11 -5
  284. package/src/overlay/popper/{popper.tsx → legacy/popper.tsx} +3 -2
  285. package/src/overlay/popper/preview_popper.tsx +54 -0
  286. package/src/overlay/tethered/__stories__/element/element_tethered.stories.tsx +57 -0
  287. package/src/overlay/tethered/__stories__/element/element_tethered_stories.module.css +14 -0
  288. package/src/overlay/tethered/__stories__/shared/base_story_config.ts +52 -0
  289. package/src/overlay/tethered/__stories__/shared/components/sb_point.module.css +20 -0
  290. package/src/overlay/tethered/__stories__/shared/components/sb_point.tsx +34 -0
  291. package/src/overlay/tethered/__stories__/shared/components/sb_reference_points.tsx +54 -0
  292. package/src/overlay/tethered/__stories__/tethered/tethered.stories.tsx +90 -0
  293. package/src/overlay/tethered/__stories__/tethered/tethered_stories.module.css +25 -0
  294. package/src/overlay/tethered/element_tethered.tsx +62 -0
  295. package/src/overlay/tethered/hooks/calculate_position.ts +110 -0
  296. package/src/overlay/tethered/hooks/useTether.ts +85 -0
  297. package/src/overlay/tethered/tethered.module.css +8 -0
  298. package/src/overlay/tethered/tethered.tsx +72 -0
  299. package/src/overlay/tethered/types.ts +2 -0
  300. package/src/stacks/h_stack.stories.tsx +2 -2
  301. package/src/stacks/v_stack.stories.tsx +2 -2
  302. package/src/surfaces/card/card.stories.tsx +64 -0
  303. package/src/surfaces/card/card.tsx +4 -4
  304. package/src/surfaces/card/card_stories.module.css +13 -0
  305. package/src/surfaces/index.ts +2 -0
  306. package/src/surfaces/modal/__stories__/modal.stories.tsx +12 -1
  307. package/src/surfaces/modal/modal.module.css +2 -2
  308. package/src/surfaces/modal/modal.tsx +14 -12
  309. package/src/surfaces/panel/__stories__/panel.stories.tsx +1 -1
  310. package/src/surfaces/panel/v_panel.tsx +8 -53
  311. package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +70 -0
  312. package/src/surfaces/pop_confirm/pop_confirm.tsx +30 -0
  313. package/src/surfaces/popconfirm/pop_confirm.tsx +18 -0
  314. package/src/surfaces/popover/popover.tsx +1 -1
  315. package/src/surfaces/tooltip/tooltip.stories.tsx +54 -0
  316. package/src/surfaces/tooltip/tooltip.tsx +59 -0
  317. package/src/surfaces/window/window.stories.tsx +15 -1
  318. package/src/surfaces/window/window.tsx +16 -12
  319. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +7 -9
  320. package/src/themes/themes/ergo/__stories__/material.stories.tsx +2 -6
  321. package/src/themes/themes/ergo/__stories__/sb_materials.module.css +29 -21
  322. package/src/themes/themes/ergo/ergo_theme.css +177 -206
  323. package/src/utils/click_away_listener.tsx +1 -1
  324. package/src/utils/index.ts +7 -5
  325. package/src/utils/mouse_leave_region.tsx +38 -0
  326. package/src/utils/types/dimensions.ts +13 -1
  327. package/tsconfig.json +3 -0
  328. package/dist/overlay/popper/popper.d.ts.map +0 -1
  329. package/dist/overlay/popper/popper.js.map +0 -1
  330. package/dist/overlay/tooltip/tooltip.d.ts +0 -7
  331. package/dist/overlay/tooltip/tooltip.d.ts.map +0 -1
  332. package/dist/overlay/tooltip/tooltip.js +0 -20
  333. package/dist/overlay/tooltip/tooltip.js.map +0 -1
  334. package/dist/panel.module-DwGKncon.js +0 -5
  335. package/dist/panel.module-DwGKncon.js.map +0 -1
  336. package/src/overlay/tooltip/tooltip.stories.tsx +0 -22
  337. package/src/overlay/tooltip/tooltip.tsx +0 -24
  338. /package/dist/{panel.css → h_panel.css} +0 -0
  339. /package/dist/overlay/popper/{popper.d.ts → legacy/popper.d.ts} +0 -0
  340. /package/src/overlay/popper/{popper.module.css → legacy/popper.module.css} +0 -0
  341. /package/src/{overlay → surfaces}/tooltip/tooltip.module.css +0 -0
@@ -3,24 +3,24 @@ import { clsx as s } from "clsx";
3
3
  import u from "react";
4
4
  import { theme as f } from "../../themes/theme_variables.js";
5
5
  import "../../themes/stylesheets/reset.js";
6
- import { HStack as p } from "../../stacks/h_stack.js";
7
- import '../../bubble.css';const d = "_bubble_d3b757e", h = { bubble: d }, R = u.forwardRef(function({
6
+ import { HStack as d } from "../../stacks/h_stack.js";
7
+ import '../../bubble.css';const p = "_bubble_d3b757e", h = { bubble: p }, B = u.forwardRef(function({
8
8
  children: e,
9
9
  className: t,
10
10
  style: o,
11
11
  backgroundColor: b = f.accentColor,
12
- textColor: r = "#fff",
13
- size: l = "md",
12
+ textColor: l = "#fff",
13
+ size: r = "md",
14
14
  elevate: a = !1,
15
15
  ...c
16
16
  }, i) {
17
17
  const n = {
18
- "--bubble-text-color": r,
18
+ "--bubble-text-color": l,
19
19
  "--bubble-color": b,
20
20
  ...o
21
21
  };
22
22
  return /* @__PURE__ */ m(
23
- p,
23
+ d,
24
24
  {
25
25
  inline: !0,
26
26
  className: s(h.bubble, "bubble", t),
@@ -30,7 +30,7 @@ import '../../bubble.css';const d = "_bubble_d3b757e", h = { bubble: d }, R = u.
30
30
  style: n,
31
31
  hAlign: "center",
32
32
  vAlign: "center",
33
- "data-size": l,
33
+ "data-size": r,
34
34
  "data-elevate": a,
35
35
  padding: "4px",
36
36
  ...c,
@@ -39,6 +39,6 @@ import '../../bubble.css';const d = "_bubble_d3b757e", h = { bubble: d }, R = u.
39
39
  );
40
40
  });
41
41
  export {
42
- R as Bubble
42
+ B as Bubble
43
43
  };
44
44
  //# sourceMappingURL=bubble.js.map
@@ -2,9 +2,9 @@ import { jsx as m } from "react/jsx-runtime";
2
2
  import { HStack as n } from "../../stacks/h_stack.js";
3
3
  import { clsx as f } from "clsx";
4
4
  import h from "react";
5
- import { theme as s } from "../../themes/theme_variables.js";
5
+ import { theme as l } from "../../themes/theme_variables.js";
6
6
  import "../../themes/stylesheets/reset.js";
7
- import '../../chip.css';const l = "_chip_35f6f0b", a = { chip: l }, R = h.forwardRef(function({ children: t, style: o, className: i, color: r = s.accentColor, ...c }, e) {
7
+ import '../../chip.css';const s = "_chip_35f6f0b", a = { chip: s }, w = h.forwardRef(function({ children: t, style: o, className: i, color: r = l.accentColor, ...c }, e) {
8
8
  const p = {
9
9
  "--chip-color": r,
10
10
  ...o
@@ -25,6 +25,6 @@ import '../../chip.css';const l = "_chip_35f6f0b", a = { chip: l }, R = h.forwar
25
25
  );
26
26
  });
27
27
  export {
28
- R as Chip
28
+ w as Chip
29
29
  };
30
30
  //# sourceMappingURL=chip.js.map
package/dist/tooltip.css CHANGED
@@ -1 +1 @@
1
- ._tooltip_e324d7e{background-color:var(--background-color-primary)}
1
+ ._tooltip_b8c58d5{background-color:var(--background-color-primary)}
@@ -1 +1 @@
1
- ._utility-bar_3a92315{width:100%;min-height:0;border-bottom:1px solid rgb(221,221,221);padding:var(--padding-medium);gap:var(--gap-medium)}
1
+ ._utility-bar_3a92315{width:100%;min-height:0}
@@ -7,5 +7,6 @@ export interface ClickAwayListenerProps {
7
7
  isException?: (target: HTMLElement) => boolean;
8
8
  refs?: React.RefObject<Element>[];
9
9
  }
10
+ export declare function isEventWithinElement(event: MouseEvent | TouchEvent, node: HTMLElement | null, activated: boolean, refs: (Element | null)[]): boolean;
10
11
  export declare const ClickAwayListener: React.ForwardRefExoticComponent<ClickAwayListenerProps & React.RefAttributes<HTMLElement>>;
11
12
  //# sourceMappingURL=click_away_listener.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click_away_listener.d.ts","sourceRoot":"","sources":["../../src/utils/click_away_listener.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAClE,UAAU,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;IACrD,UAAU,CAAC,EAAE,cAAc,GAAG,YAAY,CAAC;IAC3C,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAE/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC;AAuCD,eAAO,MAAM,iBAAiB,4FA0E7B,CAAC"}
1
+ {"version":3,"file":"click_away_listener.d.ts","sourceRoot":"","sources":["../../src/utils/click_away_listener.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAClE,UAAU,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;IACrD,UAAU,CAAC,EAAE,cAAc,GAAG,YAAY,CAAC;IAC3C,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAE/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC;AAWD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,WAsBzB;AAED,eAAO,MAAM,iBAAiB,4FA0E7B,CAAC"}
@@ -1,4 +1,4 @@
1
- import m, { useRef as p, useCallback as L, useEffect as W } from "react";
1
+ import d, { useRef as p, useCallback as L, useEffect as W } from "react";
2
2
  import { useForkRef as T } from "./hooks/use_fork_ref.js";
3
3
  const C = {
4
4
  onClick: "click",
@@ -8,16 +8,16 @@ const C = {
8
8
  onTouchStart: "touchstart",
9
9
  onTouchEnd: "touchend"
10
10
  };
11
- function w(o, t, d, s) {
12
- if (!d)
11
+ function w(o, t, m, s) {
12
+ if (!m)
13
13
  return !0;
14
14
  let n;
15
15
  return o.composedPath ? n = [t, ...s].find((e) => o.composedPath().indexOf(e) > -1) !== void 0 : n = !document.documentElement.contains(o.target) || [t, ...s].find((e) => e?.contains(o.target)) !== void 0, n;
16
16
  }
17
- const F = m.forwardRef(
18
- function({ children: t, mouseEvent: d, touchEvent: s, onClickAway: n, refs: e = [], isException: a }, R) {
19
- const f = p(null), v = p(!0), E = C[d || "onClick"], l = g[s || "onTouchEnd"], k = T(R, f, t.ref), i = m.useRef(!1);
20
- m.useEffect(() => (window.setTimeout(() => {
17
+ const F = d.forwardRef(
18
+ function({ children: t, mouseEvent: m, touchEvent: s, onClickAway: n, refs: e = [], isException: a }, R) {
19
+ const f = p(null), v = p(!0), l = C[m || "onClick"], E = g[s || "onTouchEnd"], k = T(R, f, t.ref), i = d.useRef(!1);
20
+ d.useEffect(() => (window.setTimeout(() => {
21
21
  i.current = !0;
22
22
  }, 0), () => {
23
23
  i.current = !1;
@@ -44,15 +44,16 @@ const F = m.forwardRef(
44
44
  },
45
45
  [n, e, a]
46
46
  );
47
- return W(() => (document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), document.addEventListener(E, c), document.addEventListener(l, c), () => {
48
- document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r), document.removeEventListener(E, c), document.removeEventListener(l, c);
49
- }), [l, E, c, r]), m.cloneElement(t, {
47
+ return W(() => (document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), document.addEventListener(l, c), document.addEventListener(E, c), () => {
48
+ document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r), document.removeEventListener(l, c), document.removeEventListener(E, c);
49
+ }), [E, l, c, r]), d.cloneElement(t, {
50
50
  ...t.props,
51
51
  ref: k
52
52
  });
53
53
  }
54
54
  );
55
55
  export {
56
- F as ClickAwayListener
56
+ F as ClickAwayListener,
57
+ w as isEventWithinElement
57
58
  };
58
59
  //# sourceMappingURL=click_away_listener.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"click_away_listener.js","sources":["../../src/utils/click_away_listener.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useRef } from 'react';\nimport { useForkRef } from './hooks/use_fork_ref.js';\nexport interface ClickAwayListenerProps {\n children: React.ReactElement;\n onClickAway: (event: React.MouseEvent | React.TouchEvent) => void;\n mouseEvent?: 'onMouseUp' | 'onMouseDown' | 'onClick';\n touchEvent?: 'onTouchStart' | 'onTouchEnd';\n isException?: (target: HTMLElement) => boolean;\n // An array of refs that wont trigger the click away listener\n refs?: React.RefObject<Element>[];\n}\nconst eventMap = {\n onClick: 'click',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n};\nconst touchMap = {\n onTouchStart: 'touchstart',\n onTouchEnd: 'touchend',\n};\n\nfunction isEventWithinElement(\n event: MouseEvent | TouchEvent,\n node: HTMLElement | null,\n activated: boolean,\n refs: (Element | null)[]\n) {\n if (!activated) {\n return true;\n }\n\n let isWithinElement: boolean;\n\n if (event.composedPath) {\n isWithinElement =\n [node, ...refs].find((ref: any) => {\n return event.composedPath().indexOf(ref) > -1;\n }) !== undefined;\n } else {\n isWithinElement =\n !document.documentElement.contains(event.target as any) ||\n [node, ...refs].find((ref: any) => {\n return ref?.contains(event.target);\n }) !== undefined;\n }\n\n return isWithinElement;\n}\n\nexport const ClickAwayListener = React.forwardRef<HTMLElement, ClickAwayListenerProps>(\n function ClickAwayListener(\n { children, mouseEvent, touchEvent, onClickAway, refs = [], isException },\n ref\n ) {\n const nodeRef = useRef<HTMLElement | null>(null);\n const startedActionWithinElementRef = useRef<boolean>(true);\n const DOMMouseEvent = eventMap[mouseEvent || 'onClick'];\n const DOMTouchEvent = touchMap[touchEvent || 'onTouchEnd'];\n const newRef = useForkRef(ref, nodeRef, (children as any).ref);\n const activatedRef = React.useRef(false);\n\n React.useEffect(() => {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n window.setTimeout(() => {\n activatedRef.current = true;\n }, 0);\n return () => {\n activatedRef.current = false;\n };\n }, []);\n\n const trackAction = useCallback(\n (event: any) => {\n startedActionWithinElementRef.current = isEventWithinElement(\n event,\n nodeRef.current,\n activatedRef.current,\n refs.map(r => r.current)\n );\n },\n [refs]\n );\n\n const eventHandler = useCallback(\n (event: any) => {\n const startedFromWithinElement = startedActionWithinElementRef.current;\n const isWithinElement = isEventWithinElement(\n event,\n nodeRef.current,\n activatedRef.current,\n refs.map(r => r.current)\n );\n\n if (\n !isWithinElement &&\n !startedFromWithinElement &&\n (!isException || !isException(event.target))\n ) {\n onClickAway(event);\n }\n },\n [onClickAway, refs, isException]\n );\n\n useEffect(() => {\n document.addEventListener('mousedown', trackAction);\n document.addEventListener('touchstart', trackAction);\n document.addEventListener(DOMMouseEvent, eventHandler);\n document.addEventListener(DOMTouchEvent, eventHandler);\n return () => {\n document.removeEventListener('mousedown', trackAction);\n document.removeEventListener('touchstart', trackAction);\n document.removeEventListener(DOMMouseEvent, eventHandler);\n document.removeEventListener(DOMTouchEvent, eventHandler);\n };\n }, [DOMTouchEvent, DOMMouseEvent, eventHandler, trackAction]);\n\n return React.cloneElement(children, {\n ...children.props,\n ref: newRef,\n });\n }\n);\n"],"names":["eventMap","touchMap","isEventWithinElement","event","node","activated","refs","isWithinElement","ref","ClickAwayListener","React","children","mouseEvent","touchEvent","onClickAway","isException","nodeRef","useRef","startedActionWithinElementRef","DOMMouseEvent","DOMTouchEvent","newRef","useForkRef","activatedRef","trackAction","useCallback","r","eventHandler","startedFromWithinElement","useEffect"],"mappings":";;AAWA,MAAMA,IAAW;AAAA,EACf,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb,GACMC,IAAW;AAAA,EACf,cAAc;AAAA,EACd,YAAY;AACd;AAEA,SAASC,EACPC,GACAC,GACAC,GACAC,GACA;AACA,MAAI,CAACD;AACH,WAAO;AAGT,MAAIE;AAEJ,SAAIJ,EAAM,eACRI,IACE,CAACH,GAAM,GAAGE,CAAI,EAAE,KAAK,CAACE,MACbL,EAAM,aAAA,EAAe,QAAQK,CAAG,IAAI,EAC5C,MAAM,SAETD,IACE,CAAC,SAAS,gBAAgB,SAASJ,EAAM,MAAa,KACtD,CAACC,GAAM,GAAGE,CAAI,EAAE,KAAK,CAACE,MACbA,GAAK,SAASL,EAAM,MAAM,CAClC,MAAM,QAGJI;AACT;AAEO,MAAME,IAAoBC,EAAM;AAAA,EACrC,SACE,EAAE,UAAAC,GAAU,YAAAC,GAAY,YAAAC,GAAY,aAAAC,GAAa,MAAAR,IAAO,CAAA,GAAI,aAAAS,EAAA,GAC5DP,GACA;AACA,UAAMQ,IAAUC,EAA2B,IAAI,GACzCC,IAAgCD,EAAgB,EAAI,GACpDE,IAAgBnB,EAASY,KAAc,SAAS,GAChDQ,IAAgBnB,EAASY,KAAc,YAAY,GACnDQ,IAASC,EAAWd,GAAKQ,GAAUL,EAAiB,GAAG,GACvDY,IAAeb,EAAM,OAAO,EAAK;AAEvC,IAAAA,EAAM,UAAU,OAGd,OAAO,WAAW,MAAM;AACtB,MAAAa,EAAa,UAAU;AAAA,IACzB,GAAG,CAAC,GACG,MAAM;AACX,MAAAA,EAAa,UAAU;AAAA,IACzB,IACC,CAAA,CAAE;AAEL,UAAMC,IAAcC;AAAA,MAClB,CAACtB,MAAe;AACd,QAAAe,EAA8B,UAAUhB;AAAA,UACtCC;AAAA,UACAa,EAAQ;AAAA,UACRO,EAAa;AAAA,UACbjB,EAAK,IAAI,CAAAoB,MAAKA,EAAE,OAAO;AAAA,QAAA;AAAA,MAE3B;AAAA,MACA,CAACpB,CAAI;AAAA,IAAA,GAGDqB,IAAeF;AAAA,MACnB,CAACtB,MAAe;AACd,cAAMyB,IAA2BV,EAA8B;AAQ/D,QACE,CARsBhB;AAAA,UACtBC;AAAA,UACAa,EAAQ;AAAA,UACRO,EAAa;AAAA,UACbjB,EAAK,IAAI,CAAAoB,MAAKA,EAAE,OAAO;AAAA,QAAA,KAKvB,CAACE,MACA,CAACb,KAAe,CAACA,EAAYZ,EAAM,MAAM,MAE1CW,EAAYX,CAAK;AAAA,MAErB;AAAA,MACA,CAACW,GAAaR,GAAMS,CAAW;AAAA,IAAA;AAGjC,WAAAc,EAAU,OACR,SAAS,iBAAiB,aAAaL,CAAW,GAClD,SAAS,iBAAiB,cAAcA,CAAW,GACnD,SAAS,iBAAiBL,GAAeQ,CAAY,GACrD,SAAS,iBAAiBP,GAAeO,CAAY,GAC9C,MAAM;AACX,eAAS,oBAAoB,aAAaH,CAAW,GACrD,SAAS,oBAAoB,cAAcA,CAAW,GACtD,SAAS,oBAAoBL,GAAeQ,CAAY,GACxD,SAAS,oBAAoBP,GAAeO,CAAY;AAAA,IAC1D,IACC,CAACP,GAAeD,GAAeQ,GAAcH,CAAW,CAAC,GAErDd,EAAM,aAAaC,GAAU;AAAA,MAClC,GAAGA,EAAS;AAAA,MACZ,KAAKU;AAAA,IAAA,CACN;AAAA,EACH;AACF;"}
1
+ {"version":3,"file":"click_away_listener.js","sources":["../../src/utils/click_away_listener.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useRef } from 'react';\nimport { useForkRef } from './hooks/use_fork_ref.js';\nexport interface ClickAwayListenerProps {\n children: React.ReactElement;\n onClickAway: (event: React.MouseEvent | React.TouchEvent) => void;\n mouseEvent?: 'onMouseUp' | 'onMouseDown' | 'onClick';\n touchEvent?: 'onTouchStart' | 'onTouchEnd';\n isException?: (target: HTMLElement) => boolean;\n // An array of refs that wont trigger the click away listener\n refs?: React.RefObject<Element>[];\n}\nconst eventMap = {\n onClick: 'click',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n};\nconst touchMap = {\n onTouchStart: 'touchstart',\n onTouchEnd: 'touchend',\n};\n\nexport function isEventWithinElement(\n event: MouseEvent | TouchEvent,\n node: HTMLElement | null,\n activated: boolean,\n refs: (Element | null)[]\n) {\n if (!activated) {\n return true;\n }\n\n let isWithinElement: boolean;\n\n if (event.composedPath) {\n isWithinElement =\n [node, ...refs].find((ref: any) => {\n return event.composedPath().indexOf(ref) > -1;\n }) !== undefined;\n } else {\n isWithinElement =\n !document.documentElement.contains(event.target as any) ||\n [node, ...refs].find((ref: any) => {\n return ref?.contains(event.target);\n }) !== undefined;\n }\n\n return isWithinElement;\n}\n\nexport const ClickAwayListener = React.forwardRef<HTMLElement, ClickAwayListenerProps>(\n function ClickAwayListener(\n { children, mouseEvent, touchEvent, onClickAway, refs = [], isException },\n ref\n ) {\n const nodeRef = useRef<HTMLElement | null>(null);\n const startedActionWithinElementRef = useRef<boolean>(true);\n const DOMMouseEvent = eventMap[mouseEvent || 'onClick'];\n const DOMTouchEvent = touchMap[touchEvent || 'onTouchEnd'];\n const newRef = useForkRef(ref, nodeRef, (children as any).ref);\n const activatedRef = React.useRef(false);\n\n React.useEffect(() => {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n window.setTimeout(() => {\n activatedRef.current = true;\n }, 0);\n return () => {\n activatedRef.current = false;\n };\n }, []);\n\n const trackAction = useCallback(\n (event: any) => {\n startedActionWithinElementRef.current = isEventWithinElement(\n event,\n nodeRef.current,\n activatedRef.current,\n refs.map(r => r.current)\n );\n },\n [refs]\n );\n\n const eventHandler = useCallback(\n (event: any) => {\n const startedFromWithinElement = startedActionWithinElementRef.current;\n const isWithinElement = isEventWithinElement(\n event,\n nodeRef.current,\n activatedRef.current,\n refs.map(r => r.current)\n );\n\n if (\n !isWithinElement &&\n !startedFromWithinElement &&\n (!isException || !isException(event.target))\n ) {\n onClickAway(event);\n }\n },\n [onClickAway, refs, isException]\n );\n\n useEffect(() => {\n document.addEventListener('mousedown', trackAction);\n document.addEventListener('touchstart', trackAction);\n document.addEventListener(DOMMouseEvent, eventHandler);\n document.addEventListener(DOMTouchEvent, eventHandler);\n return () => {\n document.removeEventListener('mousedown', trackAction);\n document.removeEventListener('touchstart', trackAction);\n document.removeEventListener(DOMMouseEvent, eventHandler);\n document.removeEventListener(DOMTouchEvent, eventHandler);\n };\n }, [DOMTouchEvent, DOMMouseEvent, eventHandler, trackAction]);\n\n return React.cloneElement(children, {\n ...children.props,\n ref: newRef,\n });\n }\n);\n"],"names":["eventMap","touchMap","isEventWithinElement","event","node","activated","refs","isWithinElement","ref","ClickAwayListener","React","children","mouseEvent","touchEvent","onClickAway","isException","nodeRef","useRef","startedActionWithinElementRef","DOMMouseEvent","DOMTouchEvent","newRef","useForkRef","activatedRef","trackAction","useCallback","r","eventHandler","startedFromWithinElement","useEffect"],"mappings":";;AAWA,MAAMA,IAAW;AAAA,EACf,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb,GACMC,IAAW;AAAA,EACf,cAAc;AAAA,EACd,YAAY;AACd;AAEO,SAASC,EACdC,GACAC,GACAC,GACAC,GACA;AACA,MAAI,CAACD;AACH,WAAO;AAGT,MAAIE;AAEJ,SAAIJ,EAAM,eACRI,IACE,CAACH,GAAM,GAAGE,CAAI,EAAE,KAAK,CAACE,MACbL,EAAM,aAAA,EAAe,QAAQK,CAAG,IAAI,EAC5C,MAAM,SAETD,IACE,CAAC,SAAS,gBAAgB,SAASJ,EAAM,MAAa,KACtD,CAACC,GAAM,GAAGE,CAAI,EAAE,KAAK,CAACE,MACbA,GAAK,SAASL,EAAM,MAAM,CAClC,MAAM,QAGJI;AACT;AAEO,MAAME,IAAoBC,EAAM;AAAA,EACrC,SACE,EAAE,UAAAC,GAAU,YAAAC,GAAY,YAAAC,GAAY,aAAAC,GAAa,MAAAR,IAAO,CAAA,GAAI,aAAAS,EAAA,GAC5DP,GACA;AACA,UAAMQ,IAAUC,EAA2B,IAAI,GACzCC,IAAgCD,EAAgB,EAAI,GACpDE,IAAgBnB,EAASY,KAAc,SAAS,GAChDQ,IAAgBnB,EAASY,KAAc,YAAY,GACnDQ,IAASC,EAAWd,GAAKQ,GAAUL,EAAiB,GAAG,GACvDY,IAAeb,EAAM,OAAO,EAAK;AAEvCA,IAAAA,EAAM,UAAU,OAGd,OAAO,WAAW,MAAM;AACtB,MAAAa,EAAa,UAAU;AAAA,IACzB,GAAG,CAAC,GACG,MAAM;AACX,MAAAA,EAAa,UAAU;AAAA,IACzB,IACC,CAAA,CAAE;AAEL,UAAMC,IAAcC;AAAA,MAClB,CAACtB,MAAe;AACd,QAAAe,EAA8B,UAAUhB;AAAA,UACtCC;AAAA,UACAa,EAAQ;AAAA,UACRO,EAAa;AAAA,UACbjB,EAAK,IAAI,CAAAoB,MAAKA,EAAE,OAAO;AAAA,QAAA;AAAA,MAE3B;AAAA,MACA,CAACpB,CAAI;AAAA,IAAA,GAGDqB,IAAeF;AAAA,MACnB,CAACtB,MAAe;AACd,cAAMyB,IAA2BV,EAA8B;AAQ/D,QACE,CARsBhB;AAAA,UACtBC;AAAA,UACAa,EAAQ;AAAA,UACRO,EAAa;AAAA,UACbjB,EAAK,IAAI,CAAAoB,MAAKA,EAAE,OAAO;AAAA,QAAA,KAKvB,CAACE,MACA,CAACb,KAAe,CAACA,EAAYZ,EAAM,MAAM,MAE1CW,EAAYX,CAAK;AAAA,MAErB;AAAA,MACA,CAACW,GAAaR,GAAMS,CAAW;AAAA,IAAA;AAGjC,WAAAc,EAAU,OACR,SAAS,iBAAiB,aAAaL,CAAW,GAClD,SAAS,iBAAiB,cAAcA,CAAW,GACnD,SAAS,iBAAiBL,GAAeQ,CAAY,GACrD,SAAS,iBAAiBP,GAAeO,CAAY,GAC9C,MAAM;AACX,eAAS,oBAAoB,aAAaH,CAAW,GACrD,SAAS,oBAAoB,cAAcA,CAAW,GACtD,SAAS,oBAAoBL,GAAeQ,CAAY,GACxD,SAAS,oBAAoBP,GAAeO,CAAY;AAAA,IAC1D,IACC,CAACP,GAAeD,GAAeQ,GAAcH,CAAW,CAAC,GAErDd,EAAM,aAAaC,GAAU;AAAA,MAClC,GAAGA,EAAS;AAAA,MACZ,KAAKU;AAAA,IAAA,CACN;AAAA,EACH;AACF;"}
@@ -7,19 +7,19 @@ import '../../../draggable.css';const c = "_draggable_db40376", m = { draggable:
7
7
  children: a,
8
8
  draggable: t = !0
9
9
  }) => {
10
- const o = p({}), r = n(
10
+ const o = p({}), e = n(
11
11
  () => ({
12
12
  "--position-x": `${o.position.x}px`,
13
13
  "--position-y": `${o.position.y}px`
14
14
  }),
15
15
  [o.position]
16
- ), e = i.cloneElement(a, {
16
+ ), r = i.cloneElement(a, {
17
17
  className: l("tcn-draggable", m.draggable, a.props.className),
18
- style: { ...r, ...a.props.style },
18
+ style: { ...e, ...a.props.style },
19
19
  "data-is-dragging": o.isDragging,
20
20
  "data-is-draggable": t
21
21
  });
22
- return /* @__PURE__ */ s(g.Provider, { value: o, children: e });
22
+ return /* @__PURE__ */ s(g.Provider, { value: o, children: r });
23
23
  };
24
24
  export {
25
25
  y as Draggable
@@ -2,17 +2,17 @@ import s, { useRef as f, useEffect as u } from "react";
2
2
  import a from "clsx";
3
3
  import { useDragContainer as l } from "./context.js";
4
4
  import { useForkRef as m } from "../hooks/use_fork_ref.js";
5
- const d = ({ children: e }) => {
6
- const { registerHandle: t, unregisterHandle: n } = l(), r = f(null);
5
+ const d = ({ children: r }) => {
6
+ const { registerHandle: t, unregisterHandle: n } = l(), e = f(null);
7
7
  u(() => {
8
- if (r.current != null)
9
- return t(r), () => {
10
- r.current != null && n(r);
8
+ if (e.current != null)
9
+ return t(e), () => {
10
+ e.current != null && n(e);
11
11
  };
12
12
  }, [t, n]);
13
- const o = m(r, e.props.ref);
14
- return s.cloneElement(e, {
15
- className: a("tcn-drag-handle", e.props.className),
13
+ const o = m(e, r.props.ref);
14
+ return s.cloneElement(r, {
15
+ className: a("tcn-drag-handle", r.props.className),
16
16
  ref: o
17
17
  });
18
18
  };
@@ -1,7 +1,7 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import e from "react";
3
- const d = e.forwardRef(function({ onRedirect: t }, o) {
4
- return /* @__PURE__ */ i(
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import i from "react";
3
+ const n = i.forwardRef(function({ onRedirect: t }, o) {
4
+ return /* @__PURE__ */ e(
5
5
  "div",
6
6
  {
7
7
  ref: o,
@@ -19,6 +19,6 @@ const d = e.forwardRef(function({ onRedirect: t }, o) {
19
19
  );
20
20
  });
21
21
  export {
22
- d as FocusRedirect
22
+ n as FocusRedirect
23
23
  };
24
24
  //# sourceMappingURL=focus_redirect.js.map
@@ -1,9 +1,9 @@
1
1
  import r from "react";
2
- const i = (e, t) => () => {
3
- const o = r.useContext(e);
4
- if (o === void 0)
2
+ const i = (o, t) => () => {
3
+ const e = r.useContext(o);
4
+ if (e === void 0)
5
5
  throw t ? new Error(`Context ${t} was accessed outside of a context provider!`) : new Error("Context must be used within a Context Provider!");
6
- return o;
6
+ return e;
7
7
  };
8
8
  export {
9
9
  i as makeContextHook
@@ -1,5 +1,5 @@
1
1
  import s from "react";
2
- function h(t) {
2
+ function d(t) {
3
3
  const [c, a] = s.useState(!1);
4
4
  return s.useEffect(() => {
5
5
  const e = window.matchMedia(t);
@@ -11,6 +11,6 @@ function h(t) {
11
11
  }, [t]), c;
12
12
  }
13
13
  export {
14
- h as useMediaQuery
14
+ d as useMediaQuery
15
15
  };
16
16
  //# sourceMappingURL=use_media_query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_media_query.js","sources":["../../../src/utils/hooks/use_media_query.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * Custom hook that returns a boolean indicating if the current viewport\n * matches the given media query.\n *\n * @param query - The media query to match against (e.g. \"(min-width: 768px)\")\n * @returns boolean indicating if the media query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = React.useState(false);\n\n React.useEffect(() => {\n const mediaQuery = window.matchMedia(query);\n\n // Set initial value\n setMatches(mediaQuery.matches);\n\n // Create event listener\n const handler = (event: MediaQueryListEvent) => {\n setMatches(event.matches);\n };\n\n // Add the listener\n mediaQuery.addEventListener('change', handler);\n\n // Clean up\n return () => mediaQuery.removeEventListener('change', handler);\n }, [query]);\n\n return matches;\n}\n"],"names":["useMediaQuery","query","matches","setMatches","React","mediaQuery","handler","event"],"mappings":";AASO,SAASA,EAAcC,GAAwB;AACpD,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAM,SAAS,EAAK;AAElD,SAAAA,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAa,OAAO,WAAWJ,CAAK;AAG1C,IAAAE,EAAWE,EAAW,OAAO;AAG7B,UAAMC,IAAU,CAACC,MAA+B;AAC9C,MAAAJ,EAAWI,EAAM,OAAO;AAAA,IAC1B;AAGA,WAAAF,EAAW,iBAAiB,UAAUC,CAAO,GAGtC,MAAMD,EAAW,oBAAoB,UAAUC,CAAO;AAAA,EAC/D,GAAG,CAACL,CAAK,CAAC,GAEHC;AACT;"}
1
+ {"version":3,"file":"use_media_query.js","sources":["../../../src/utils/hooks/use_media_query.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * Custom hook that returns a boolean indicating if the current viewport\n * matches the given media query.\n *\n * @param query - The media query to match against (e.g. \"(min-width: 768px)\")\n * @returns boolean indicating if the media query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = React.useState(false);\n\n React.useEffect(() => {\n const mediaQuery = window.matchMedia(query);\n\n // Set initial value\n setMatches(mediaQuery.matches);\n\n // Create event listener\n const handler = (event: MediaQueryListEvent) => {\n setMatches(event.matches);\n };\n\n // Add the listener\n mediaQuery.addEventListener('change', handler);\n\n // Clean up\n return () => mediaQuery.removeEventListener('change', handler);\n }, [query]);\n\n return matches;\n}\n"],"names":["useMediaQuery","query","matches","setMatches","React","mediaQuery","handler","event"],"mappings":";AASO,SAASA,EAAcC,GAAwB;AACpD,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAM,SAAS,EAAK;AAElDA,SAAAA,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAa,OAAO,WAAWJ,CAAK;AAG1C,IAAAE,EAAWE,EAAW,OAAO;AAG7B,UAAMC,IAAU,CAACC,MAA+B;AAC9C,MAAAJ,EAAWI,EAAM,OAAO;AAAA,IAC1B;AAGA,WAAAF,EAAW,iBAAiB,UAAUC,CAAO,GAGtC,MAAMD,EAAW,oBAAoB,UAAUC,CAAO;AAAA,EAC/D,GAAG,CAACL,CAAK,CAAC,GAEHC;AACT;"}
@@ -1,17 +1,18 @@
1
- export * from './focus_redirect.js';
2
1
  export * from './click_away_listener.js';
2
+ export * from './focus_redirect.js';
3
3
  export * from './scroll_away_listener.js';
4
- export * from './hooks/make_context_hook.js';
5
4
  export * from './dnd/hooks/use_draggable.js';
5
+ export * from './hooks/make_context_hook.js';
6
6
  export * from './hooks/use_fork_ref.js';
7
7
  export * from './hooks/use_media_query.js';
8
8
  export * from './hooks/use_resize_observer.js';
9
9
  export * from './default_value.js';
10
10
  export * from './calendar/calendar_date.js';
11
11
  export * from './calendar/calendar_dates_generator.js';
12
- export * from './calendar/month.js';
13
- export * from './calendar/get_months_of_year.js';
14
12
  export * from './calendar/get_days_of_week.js';
15
- export * from './types/variations.js';
13
+ export * from './calendar/get_months_of_year.js';
14
+ export * from './calendar/month.js';
16
15
  export * from './types/dimensions.js';
16
+ export * from './types/variations.js';
17
+ export * from './responsive/responsive_renderer.js';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,qCAAqC,CAAC"}
@@ -1,30 +1,33 @@
1
- import { FocusRedirect as o } from "./focus_redirect.js";
2
- import { ClickAwayListener as f } from "./click_away_listener.js";
3
- import { ScrollAwayListener as m } from "./scroll_away_listener.js";
4
- import { makeContextHook as p } from "./hooks/make_context_hook.js";
5
- import { useDraggable as i } from "./dnd/hooks/use_draggable.js";
1
+ import { ClickAwayListener as o, isEventWithinElement as t } from "./click_away_listener.js";
2
+ import { FocusRedirect as m } from "./focus_redirect.js";
3
+ import { ScrollAwayListener as s } from "./scroll_away_listener.js";
4
+ import { useDraggable as a } from "./dnd/hooks/use_draggable.js";
5
+ import { makeContextHook as i } from "./hooks/make_context_hook.js";
6
6
  import { useForkRef as u } from "./hooks/use_fork_ref.js";
7
- import { useMediaQuery as l } from "./hooks/use_media_query.js";
8
- import { TriggerConfig as c, useResizeObserver as d } from "./hooks/use_resize_observer.js";
7
+ import { useMediaQuery as d } from "./hooks/use_media_query.js";
8
+ import { TriggerConfig as R, useResizeObserver as c } from "./hooks/use_resize_observer.js";
9
9
  import { defaultValue as C } from "./default_value.js";
10
- import { CalendarDatesGenerator as M } from "./calendar/calendar_dates_generator.js";
11
- import { Month as R } from "./calendar/month.js";
12
- import { getMonthsOfYear as h } from "./calendar/get_months_of_year.js";
13
- import { getDaysOfWeek as A } from "./calendar/get_days_of_week.js";
10
+ import { CalendarDatesGenerator as v } from "./calendar/calendar_dates_generator.js";
11
+ import { getDaysOfWeek as M } from "./calendar/get_days_of_week.js";
12
+ import { getMonthsOfYear as b } from "./calendar/get_months_of_year.js";
13
+ import { Month as A } from "./calendar/month.js";
14
+ import { ResponsiveRenderer as F } from "./responsive/responsive_renderer.js";
14
15
  export {
15
- M as CalendarDatesGenerator,
16
- f as ClickAwayListener,
17
- o as FocusRedirect,
18
- R as Month,
19
- m as ScrollAwayListener,
20
- c as TriggerConfig,
16
+ v as CalendarDatesGenerator,
17
+ o as ClickAwayListener,
18
+ m as FocusRedirect,
19
+ A as Month,
20
+ F as ResponsiveRenderer,
21
+ s as ScrollAwayListener,
22
+ R as TriggerConfig,
21
23
  C as defaultValue,
22
- A as getDaysOfWeek,
23
- h as getMonthsOfYear,
24
- p as makeContextHook,
25
- i as useDraggable,
24
+ M as getDaysOfWeek,
25
+ b as getMonthsOfYear,
26
+ t as isEventWithinElement,
27
+ i as makeContextHook,
28
+ a as useDraggable,
26
29
  u as useForkRef,
27
- l as useMediaQuery,
28
- d as useResizeObserver
30
+ d as useMediaQuery,
31
+ c as useResizeObserver
29
32
  };
30
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface MouseLeaveRegionProps {
3
+ elementsRefs: (React.RefObject<Element> | React.MutableRefObject<Element>)[];
4
+ onMouseLeave: () => void;
5
+ buffer?: number;
6
+ }
7
+ export declare function MouseLeaveRegion({ onMouseLeave, elementsRefs: elementRefs, buffer, }: MouseLeaveRegionProps): null;
8
+ //# sourceMappingURL=mouse_leave_region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse_leave_region.d.ts","sourceRoot":"","sources":["../../src/utils/mouse_leave_region.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;IAC7E,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,YAAY,EAAE,WAAW,EACzB,MAAU,GACX,EAAE,qBAAqB,QAyBvB"}
@@ -0,0 +1,26 @@
1
+ import { useEffect as u } from "react";
2
+ function v({
3
+ onMouseLeave: o,
4
+ elementsRefs: i,
5
+ buffer: t = 8
6
+ }) {
7
+ return u(() => {
8
+ const r = (e) => {
9
+ i.some((c) => {
10
+ const s = c.current;
11
+ if (s != null) {
12
+ const n = s.getBoundingClientRect(), l = Math.max(e.clientX - t, n.left), m = Math.min(e.clientX + t, n.right), a = Math.max(e.clientY - t, n.top), p = Math.min(e.clientY + t, n.bottom);
13
+ return l <= m && a <= p;
14
+ }
15
+ return !1;
16
+ }) || o();
17
+ };
18
+ return window.addEventListener("mousemove", r), () => {
19
+ window.removeEventListener("mousemove", r);
20
+ };
21
+ }, [o, i, t]), null;
22
+ }
23
+ export {
24
+ v as MouseLeaveRegion
25
+ };
26
+ //# sourceMappingURL=mouse_leave_region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse_leave_region.js","sources":["../../src/utils/mouse_leave_region.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nexport interface MouseLeaveRegionProps {\n elementsRefs: (React.RefObject<Element> | React.MutableRefObject<Element>)[];\n onMouseLeave: () => void;\n buffer?: number;\n}\n\nexport function MouseLeaveRegion({\n onMouseLeave,\n elementsRefs: elementRefs,\n buffer = 8,\n}: MouseLeaveRegionProps) {\n useEffect(() => {\n const update = (event: MouseEvent) => {\n const intersects = elementRefs.some(ref => {\n const element = ref.current;\n if (element != null) {\n const rect = element.getBoundingClientRect();\n const overlapLeft = Math.max(event.clientX - buffer, rect.left);\n const overlapRight = Math.min(event.clientX + buffer, rect.right);\n const overlapTop = Math.max(event.clientY - buffer, rect.top);\n const overlapBottom = Math.min(event.clientY + buffer, rect.bottom);\n return overlapLeft <= overlapRight && overlapTop <= overlapBottom;\n }\n return false;\n });\n if (!intersects) {\n onMouseLeave();\n }\n };\n window.addEventListener('mousemove', update);\n return () => {\n window.removeEventListener('mousemove', update);\n };\n }, [onMouseLeave, elementRefs, buffer]);\n return null;\n}\n"],"names":["MouseLeaveRegion","onMouseLeave","elementRefs","buffer","useEffect","update","event","ref","element","rect","overlapLeft","overlapRight","overlapTop","overlapBottom"],"mappings":";AAQO,SAASA,EAAiB;AAAA,EAC/B,cAAAC;AAAA,EACA,cAAcC;AAAA,EACd,QAAAC,IAAS;AACX,GAA0B;AACxB,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAS,CAACC,MAAsB;AAapC,MAZmBJ,EAAY,KAAK,CAAAK,MAAO;AACzC,cAAMC,IAAUD,EAAI;AACpB,YAAIC,KAAW,MAAM;AACnB,gBAAMC,IAAOD,EAAQ,sBAAA,GACfE,IAAc,KAAK,IAAIJ,EAAM,UAAUH,GAAQM,EAAK,IAAI,GACxDE,IAAe,KAAK,IAAIL,EAAM,UAAUH,GAAQM,EAAK,KAAK,GAC1DG,IAAa,KAAK,IAAIN,EAAM,UAAUH,GAAQM,EAAK,GAAG,GACtDI,IAAgB,KAAK,IAAIP,EAAM,UAAUH,GAAQM,EAAK,MAAM;AAClE,iBAAOC,KAAeC,KAAgBC,KAAcC;AAAA,QACtD;AACA,eAAO;AAAA,MACT,CAAC,KAECZ,EAAA;AAAA,IAEJ;AACA,kBAAO,iBAAiB,aAAaI,CAAM,GACpC,MAAM;AACX,aAAO,oBAAoB,aAAaA,CAAM;AAAA,IAChD;AAAA,EACF,GAAG,CAACJ,GAAcC,GAAaC,CAAM,CAAC,GAC/B;AACT;"}
@@ -6,7 +6,17 @@ export interface Dimensions {
6
6
  width: number;
7
7
  height: number;
8
8
  }
9
- export interface Rect {
9
+ export interface Rectangle {
10
+ dimensions: Dimensions;
11
+ position: Position;
12
+ }
13
+ export interface RectCorners {
14
+ topLeft: Position;
15
+ topRight: Position;
16
+ bottomLeft: Position;
17
+ bottomRight: Position;
18
+ }
19
+ export interface RectEdges {
10
20
  top: number;
11
21
  right: number;
12
22
  bottom: number;
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/utils/types/dimensions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/utils/types/dimensions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,QAAQ,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,EAAE,QAAQ,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tcn/ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "author": "TCN",
@@ -134,8 +134,8 @@
134
134
  "dependencies": {
135
135
  "clsx": "^2.1.1",
136
136
  "react-color": "^2.19.3",
137
- "@tcn/state": "1.0.1",
138
- "@tcn/icons": "2.1.1"
137
+ "@tcn/icons": "2.2.0",
138
+ "@tcn/state": "1.1.0"
139
139
  },
140
140
  "scripts": {
141
141
  "build": "vite build",
@@ -0,0 +1,131 @@
1
+ import { Canvas, Meta, Markdown } from '@storybook/addon-docs/blocks';
2
+ import * as ActionStories from './actions.stories';
3
+ import { Showcase, Section } from './components/showcase';
4
+ import { Gallery } from './components/gallery';
5
+
6
+ <Meta title="Catalog/Actions" of={ActionStories} />
7
+
8
+ # Actions
9
+
10
+ Interactive elements that trigger operations or set configuration for application tooling.
11
+
12
+ ## Button
13
+
14
+ Relaxed, text based actions for high level page decisions (Cancel, Save, etc.)
15
+
16
+ <Gallery minColumnWidth="350px">
17
+
18
+ <Showcase
19
+ title="Hierarchy"
20
+ description="Visually indicates the importance of an action and its relationship to other actions. A primary action should be limited to one per surface."
21
+ of={ActionStories.HierarchyShowcase}
22
+ width="380px"
23
+ />
24
+
25
+ <Showcase
26
+ title="Size"
27
+ description="Used to customize the size of actions in relation to one another on a surface. Use sparingly, do not use as a replacement for hierarchy."
28
+ of={ActionStories.SizeShowcase}
29
+ width="320px"
30
+ />
31
+
32
+ <Showcase
33
+ title="Disabled"
34
+ description="Prevents interaction and reduces visual prominence."
35
+ of={ActionStories.DisabledShowcase}
36
+ width="420px"
37
+ />
38
+
39
+ <Showcase
40
+ title="With Icons"
41
+ description="Icons can be added to buttons with the use of Icon and Spacer components."
42
+ of={ActionStories.IconShowcase}
43
+ width="300px"
44
+ />
45
+
46
+ <Showcase
47
+ title="Severity"
48
+ description="Visual indication of the severity of consequential, one-time actions."
49
+ of={ActionStories.SeverityShowcase}
50
+ width="300px"
51
+ >
52
+ <Markdown>
53
+ {`
54
+ **🚧 This concept is being actively developed.**
55
+
56
+ Severity gives users a clear, visual indication of the impact and importance of an action.
57
+
58
+ Should be the primary exception of color variance in actions and generally replacing the need for using custom colors.
59
+
60
+ Use sparingly for consequential, one-time actions such as:
61
+
62
+ - Deleting an entity permanently - **dangerous**
63
+ - Discarding the UIs current state or unsaved changes when leaving the page - **cautious**
64
+ - Prompting a user to pick a preferred option out of multiple otherwise valid options - **suggested**
65
+ - Client confirmation for important migration - **encouraged**
66
+ `}
67
+ </Markdown>
68
+ </Showcase>
69
+
70
+ <Showcase
71
+ title="Custom Colors"
72
+ description="
73
+ Override accent color for heavily brand or product specific actions.
74
+ Use sparingly, should be avoided to create cohesion and consistency between UIs."
75
+ of={ActionStories.ColorShowcase}
76
+ width="420px"
77
+ />
78
+
79
+ <Showcase
80
+ title="Full Width"
81
+ description="Fill container width for mobile or prominent CTAs."
82
+ of={ActionStories.FullWidth}
83
+ width="340px"
84
+ />
85
+
86
+ </Gallery>
87
+
88
+
89
+
90
+ ## Utility
91
+
92
+ Compact, icon-based actions. Used as re-usable tooling for item rows, utility bars, or supplemental behavior on elements (Close Panel, Copy Entity, ect)
93
+
94
+ <Gallery>
95
+
96
+ <Showcase
97
+ title="Hierarchy"
98
+ description="Visually indicates the importance of an action and its relationship to other actions. A primary action should be limited to one per surface."
99
+ of={ActionStories.SlimButtonHierarchy}
100
+ width="240px"
101
+ />
102
+
103
+ <Showcase
104
+ title="Size"
105
+ description="Used to customize the size of actions in relation to one another on a surface. Use sparingly, do not use as a replacement for hierarchy."
106
+ of={ActionStories.SlimButtonSizes}
107
+ width="220px"
108
+ />
109
+
110
+ <Showcase
111
+ title="Disabled"
112
+ description="Prevents interaction and reduces visual prominence."
113
+ of={ActionStories.SlimButtonDisabled}
114
+ width="240px"
115
+ />
116
+
117
+ <Showcase
118
+ title="Severity"
119
+ description="Visual indication of the severity of consequential, one-time actions."
120
+ of={ActionStories.SlimButtonSeverity}
121
+ width="140px"
122
+ />
123
+
124
+ <Showcase
125
+ title="Custom Colors"
126
+ description="Override accent color for heavily brand or product specific actions. Use sparingly, should be avoided to create cohesion and consistency between UIs."
127
+ of={ActionStories.SlimButtonColors}
128
+ width="140px"
129
+ />
130
+
131
+ </Gallery>