@tcn/ui 0.17.0 → 0.18.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.
- package/AI_USAGE.md +59 -0
- package/CHANGELOG.md +1009 -0
- package/ai-docs/actions.md +43 -0
- package/ai-docs/decorators.md +34 -0
- package/ai-docs/feedback.md +31 -0
- package/ai-docs/form.md +58 -0
- package/ai-docs/inputs.md +71 -0
- package/ai-docs/layouts.md +76 -0
- package/ai-docs/mobile.md +34 -0
- package/ai-docs/navigation.md +48 -0
- package/ai-docs/overlay.md +58 -0
- package/ai-docs/stacks.md +59 -0
- package/ai-docs/surfaces.md +79 -0
- package/ai-docs/themes.md +47 -0
- package/ai-docs/tokens.md +35 -0
- package/ai-docs/typography.md +38 -0
- package/ai-docs/utils.md +51 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +6 -8
- package/dist/actions/index.js.map +1 -1
- package/dist/draggable.css +1 -1
- package/dist/draggable.module-DFYR5n3n.js +5 -0
- package/dist/draggable.module-DFYR5n3n.js.map +1 -0
- package/dist/field_set.css +1 -1
- package/dist/field_set.module-BpJTFCi4.js +5 -0
- package/dist/field_set.module-BpJTFCi4.js.map +1 -0
- package/dist/form/field/field.js +11 -10
- package/dist/form/field/field.js.map +1 -1
- package/dist/form/field_set/field_set.d.ts +6 -10
- package/dist/form/field_set/field_set.d.ts.map +1 -1
- package/dist/form/field_set/field_set.js +33 -61
- package/dist/form/field_set/field_set.js.map +1 -1
- package/dist/form/field_set/legend.d.ts +20 -0
- package/dist/form/field_set/legend.d.ts.map +1 -0
- package/dist/form/field_set/legend.js +28 -0
- package/dist/form/field_set/legend.js.map +1 -0
- package/dist/form/index.d.ts +2 -1
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +24 -22
- package/dist/form/index.js.map +1 -1
- package/dist/inputs/color_input/color_input.js +2 -3
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +11 -10
- package/dist/inputs/color_input/color_picker.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +11 -10
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/date_picker/date_picker.js +11 -10
- package/dist/inputs/date_picker/date_picker.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_header.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_header.js +15 -14
- package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +9 -9
- package/dist/inputs/date_picker/date_picker_time_selector.js +2 -3
- package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +2 -3
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +22 -22
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/mask_input/key_capture_input.js +21 -20
- package/dist/inputs/mask_input/key_capture_input.js.map +1 -1
- package/dist/inputs/mask_input/mask_input.js +18 -17
- package/dist/inputs/mask_input/mask_input.js.map +1 -1
- package/dist/inputs/multiselect/multiselect.js +11 -10
- package/dist/inputs/multiselect/multiselect.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_inline_values.d.ts.map +1 -1
- package/dist/inputs/multiselect/multiselect_inline_values.js +15 -15
- package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +16 -17
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.js +13 -12
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +2 -3
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -1
- package/dist/inputs/phone_number_input/sip_input.js +8 -9
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -1
- package/dist/inputs/select/select.js +9 -9
- package/dist/inputs/slider/slider.js +21 -20
- package/dist/inputs/slider/slider.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +9 -9
- package/dist/inputs/switch/switch.js +16 -15
- package/dist/inputs/switch/switch.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +11 -10
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js.map +1 -1
- package/dist/multiselect_values.css +1 -1
- package/dist/navigation/tabs/state/link/tab_link.js +11 -10
- package/dist/navigation/tabs/state/link/tab_link.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +117 -76
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/menu/menu.js +21 -20
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/popper/base/dismissal_decorator.js +3 -3
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
- package/dist/overlay/popper/context_popper.js +11 -10
- package/dist/overlay/popper/context_popper.js.map +1 -1
- package/dist/overlay/popper/element_popper.js +11 -10
- package/dist/overlay/popper/element_popper.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +28 -27
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/overlay/popper/preview_popper.js +11 -10
- package/dist/overlay/popper/preview_popper.js.map +1 -1
- package/dist/overlay/tethered/tethered.js +11 -10
- package/dist/overlay/tethered/tethered.js.map +1 -1
- package/dist/resizable.css +1 -1
- package/dist/resizable.module-ur5FBfxo.js +5 -0
- package/dist/resizable.module-ur5FBfxo.js.map +1 -0
- package/dist/resize_handle.css +1 -1
- package/dist/stacks/box/box.d.ts +14 -0
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js +98 -99
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +5 -5
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +12 -12
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +7 -7
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +3 -2
- package/dist/stacks/box/types.d.ts.map +1 -1
- package/dist/stacks/h_collapsible_box.js +14 -13
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +14 -13
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/alert/alert.js +7 -8
- package/dist/surfaces/alert/alert.js.map +1 -1
- package/dist/themes/stories/button_showcase.d.ts.map +1 -1
- package/dist/themes/stories/controls_fieldset.d.ts.map +1 -1
- package/dist/themes/stories/menu_showcase.d.ts.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.d.ts.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +336 -294
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/themes/themes/ergo/parts/actions.css +1 -0
- package/dist/themes/themes/ergo/parts/base.css +1 -0
- package/dist/themes/themes/ergo/parts/form.css +1 -0
- package/dist/themes/themes/ergo/parts/inputs.css +1 -0
- package/dist/themes/themes/ergo/parts/navigation.css +1 -0
- package/dist/themes/themes/windows_98/windows_98.css +1 -1
- package/dist/themes/themes/windows_98/windows_98_theme.js +32 -43
- package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
- package/dist/utils/decorators/clone_with_decorator.d.ts +21 -0
- package/dist/utils/decorators/clone_with_decorator.d.ts.map +1 -0
- package/dist/utils/decorators/clone_with_decorator.js +16 -0
- package/dist/utils/decorators/clone_with_decorator.js.map +1 -0
- package/dist/utils/decorators/draggable/context.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/context.js.map +1 -0
- package/dist/utils/{dnd/handle.d.ts → decorators/draggable/drag_handle.d.ts} +1 -1
- package/dist/utils/decorators/draggable/drag_handle.d.ts.map +1 -0
- package/dist/utils/{dnd/handle.js → decorators/draggable/drag_handle.js} +2 -2
- package/dist/utils/decorators/draggable/drag_handle.js.map +1 -0
- package/dist/utils/decorators/draggable/draggable.d.ts.map +1 -0
- package/dist/utils/{dnd → decorators}/draggable/draggable.js +3 -3
- package/dist/utils/decorators/draggable/draggable.js.map +1 -0
- package/dist/utils/decorators/draggable/index.d.ts +11 -0
- package/dist/utils/decorators/draggable/index.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/index.js +14 -0
- package/dist/utils/{dnd → decorators/draggable}/types.d.ts +1 -1
- package/dist/utils/decorators/draggable/types.d.ts.map +1 -0
- package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.d.ts +2 -2
- package/dist/utils/decorators/draggable/use_drag_container.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/use_drag_container.js.map +1 -0
- package/dist/utils/decorators/draggable/use_draggable.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/use_draggable.js.map +1 -0
- package/dist/utils/decorators/index.d.ts +3 -0
- package/dist/utils/decorators/index.d.ts.map +1 -0
- package/dist/utils/decorators/index.js +27 -0
- package/dist/utils/decorators/index.js.map +1 -0
- package/dist/utils/decorators/resizable/context.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/context.js +1 -1
- package/dist/utils/decorators/resizable/context.js.map +1 -0
- package/dist/utils/decorators/resizable/handle_config.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/handle_config.js +62 -0
- package/dist/utils/decorators/resizable/handle_config.js.map +1 -0
- package/dist/utils/decorators/resizable/index.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/index.js.map +1 -0
- package/dist/utils/decorators/resizable/resizable.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resizable.js +2 -2
- package/dist/utils/decorators/resizable/resizable.js.map +1 -0
- package/dist/utils/decorators/resizable/resize_handle.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resize_handle.js +2 -2
- package/dist/utils/decorators/resizable/resize_handle.js.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resize_strategy.d.ts +1 -1
- package/dist/utils/decorators/resizable/resize_strategy.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/resize_strategy.js.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/types.d.ts +2 -2
- package/dist/utils/decorators/resizable/types.d.ts.map +1 -0
- package/dist/utils/hooks/labelled_by_context.d.ts +21 -0
- package/dist/utils/hooks/labelled_by_context.d.ts.map +1 -0
- package/dist/utils/hooks/labelled_by_context.js +12 -0
- package/dist/utils/hooks/labelled_by_context.js.map +1 -0
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +44 -40
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/listeners/click_away_listener.d.ts.map +1 -0
- package/dist/utils/{click_away_listener.js → listeners/click_away_listener.js} +1 -1
- package/dist/utils/listeners/click_away_listener.js.map +1 -0
- package/dist/utils/listeners/focus_redirect.d.ts.map +1 -0
- package/dist/utils/listeners/focus_redirect.js.map +1 -0
- package/dist/utils/listeners/index.d.ts +4 -0
- package/dist/utils/listeners/index.d.ts.map +1 -0
- package/dist/utils/listeners/index.js +10 -0
- package/dist/utils/listeners/index.js.map +1 -0
- package/dist/utils/listeners/mouse_leave_region.d.ts.map +1 -0
- package/dist/utils/listeners/mouse_leave_region.js.map +1 -0
- package/dist/utils/listeners/scroll_away_listener.d.ts.map +1 -0
- package/dist/utils/{scroll_away_listener.js → listeners/scroll_away_listener.js} +1 -1
- package/dist/utils/listeners/scroll_away_listener.js.map +1 -0
- package/dist/utils/system/index.d.ts +2 -0
- package/dist/utils/system/index.d.ts.map +1 -0
- package/dist/utils/system/index.js +2 -0
- package/dist/utils/system/index.js.map +1 -0
- package/dist/utils/system/variations.d.ts.map +1 -0
- package/dist/utils/system/variations.js +2 -0
- package/dist/utils/system/variations.js.map +1 -0
- package/dist/utils/types/sides.d.ts +3 -0
- package/dist/utils/types/sides.d.ts.map +1 -0
- package/package.json +7 -9
- package/src/actions/button/__stories__/button_group.stories.tsx +23 -24
- package/src/actions/index.ts +0 -1
- package/src/form/field/field.stories.tsx +2 -2
- package/src/form/field/h_field/h_field.stories.tsx +1 -1
- package/src/form/field/v_field/v_field.stories.tsx +1 -1
- package/src/form/field_set/field_set.module.css +0 -14
- package/src/form/field_set/field_set.stories.tsx +101 -1
- package/src/form/field_set/field_set.tsx +43 -57
- package/src/form/field_set/legend.tsx +44 -0
- package/src/form/index.ts +6 -1
- package/src/inputs/date_picker/date_picker_header.tsx +7 -5
- package/src/inputs/date_picker/date_picker_year_selector.tsx +5 -5
- package/src/inputs/multiselect/multiselect_inline_values.tsx +4 -3
- package/src/inputs/multiselect/multiselect_values.module.css +1 -0
- package/src/inputs/multiselect/multiselect_values.tsx +4 -4
- package/src/overlay/frame/frame.stories.tsx +2 -1
- package/src/overlay/frame/frame.tsx +68 -20
- package/src/overlay/popper/base/dismissal_decorator.tsx +3 -3
- package/src/overlay/popper/legacy/popper.stories.tsx +9 -2
- package/src/overlay/slide/slide.stories.tsx +1 -1
- package/src/stacks/box/box.tsx +29 -4
- package/src/stacks/box/end_resize_handle.tsx +1 -1
- package/src/stacks/box/resize_handlers.ts +1 -1
- package/src/stacks/box/start_resize_handle.tsx +1 -1
- package/src/stacks/box/types.ts +3 -2
- package/src/stacks/collapsible_box.stories.tsx +5 -5
- package/src/stacks/demo.stories.tsx +7 -7
- package/src/surfaces/page/page.stories.tsx +4 -4
- package/src/surfaces/window/window.stories.tsx +1 -1
- package/src/themes/stories/button_showcase.tsx +3 -1
- package/src/themes/stories/controls_fieldset.tsx +3 -1
- package/src/themes/stories/menu_showcase.tsx +3 -1
- package/src/themes/themes/ergo/INTERACTIVE.md +89 -0
- package/src/themes/themes/ergo/ROADMAP.md +116 -0
- package/src/themes/themes/ergo/ergo_theme.css +22 -717
- package/src/themes/themes/ergo/ergo_theme.ts +15 -1
- package/src/themes/themes/ergo/parts/actions.css +287 -0
- package/src/themes/themes/ergo/parts/base.css +62 -0
- package/src/themes/themes/ergo/parts/form.css +23 -0
- package/src/themes/themes/ergo/parts/inputs.css +252 -0
- package/src/themes/themes/ergo/parts/navigation.css +104 -0
- package/src/themes/themes/windows_98/windows_98.css +32 -43
- package/src/tokens/chip/chip.stories.tsx +5 -5
- package/src/utils/decorators/DECORATOR_PATTERN.md +86 -0
- package/src/utils/decorators/clone_with_decorator.ts +47 -0
- package/src/utils/{dnd → decorators/draggable}/__stories__/draggable.stories.tsx +7 -7
- package/src/utils/{dnd → decorators/draggable}/__stories__/use_draggable.stories.tsx +2 -2
- package/src/utils/{dnd/handle.tsx → decorators/draggable/drag_handle.tsx} +1 -1
- package/src/utils/{dnd → decorators}/draggable/draggable.tsx +2 -2
- package/src/utils/decorators/draggable/index.ts +15 -0
- package/src/utils/{dnd → decorators/draggable}/types.ts +1 -1
- package/src/utils/{dnd/hooks → decorators/draggable}/use_drag_container.ts +2 -2
- package/src/utils/decorators/index.ts +2 -0
- package/src/utils/{resize → decorators/resizable}/__stories__/resizable.stories.tsx +23 -23
- package/src/utils/{resize → decorators/resizable}/__tests__/handle_config.test.ts +19 -97
- package/src/utils/{resize → decorators/resizable}/__tests__/resize_strategy.test.ts +20 -20
- package/src/utils/{resize → decorators/resizable}/context.ts +1 -1
- package/src/utils/{resize → decorators/resizable}/handle_config.ts +7 -31
- package/src/utils/{resize → decorators/resizable}/resizable.tsx +1 -1
- package/src/utils/{resize → decorators/resizable}/resize_handle.module.css +1 -41
- package/src/utils/{resize → decorators/resizable}/resize_handle.tsx +1 -1
- package/src/utils/{resize → decorators/resizable}/resize_strategy.ts +1 -1
- package/src/utils/{resize → decorators/resizable}/types.ts +1 -7
- package/src/utils/hooks/labelled_by_context.ts +27 -0
- package/src/utils/index.ts +8 -8
- package/src/utils/{click_away_listener.tsx → listeners/click_away_listener.tsx} +1 -1
- package/src/utils/listeners/index.ts +3 -0
- package/src/utils/{scroll_away_listener.tsx → listeners/scroll_away_listener.tsx} +1 -1
- package/src/utils/system/index.ts +1 -0
- package/src/utils/types/sides.ts +2 -0
- package/dist/actions/button/slim_button/slim_button.d.ts +0 -9
- package/dist/actions/button/slim_button/slim_button.d.ts.map +0 -1
- package/dist/actions/button/slim_button/slim_button.js +0 -18
- package/dist/actions/button/slim_button/slim_button.js.map +0 -1
- package/dist/draggable.module-BgelQsuJ.js +0 -5
- package/dist/draggable.module-BgelQsuJ.js.map +0 -1
- package/dist/frame.css +0 -1
- package/dist/left_resize_handle.css +0 -1
- package/dist/resizable.module-I6iyBAvM.js +0 -5
- package/dist/resizable.module-I6iyBAvM.js.map +0 -1
- package/dist/right_resize_handle.css +0 -1
- package/dist/slim_button.css +0 -1
- package/dist/stacks/box/left_resize_handle.d.ts +0 -4
- package/dist/stacks/box/left_resize_handle.d.ts.map +0 -1
- package/dist/stacks/box/left_resize_handle.js +0 -36
- package/dist/stacks/box/left_resize_handle.js.map +0 -1
- package/dist/stacks/box/right_resize_handle.d.ts +0 -4
- package/dist/stacks/box/right_resize_handle.d.ts.map +0 -1
- package/dist/stacks/box/right_resize_handle.js +0 -36
- package/dist/stacks/box/right_resize_handle.js.map +0 -1
- package/dist/utils/click_away_listener.d.ts.map +0 -1
- package/dist/utils/click_away_listener.js.map +0 -1
- package/dist/utils/dnd/context.d.ts.map +0 -1
- package/dist/utils/dnd/context.js.map +0 -1
- package/dist/utils/dnd/draggable/draggable.d.ts.map +0 -1
- package/dist/utils/dnd/draggable/draggable.js.map +0 -1
- package/dist/utils/dnd/handle.d.ts.map +0 -1
- package/dist/utils/dnd/handle.js.map +0 -1
- package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +0 -1
- package/dist/utils/dnd/hooks/use_drag_container.js.map +0 -1
- package/dist/utils/dnd/hooks/use_draggable.d.ts.map +0 -1
- package/dist/utils/dnd/hooks/use_draggable.js.map +0 -1
- package/dist/utils/dnd/types.d.ts.map +0 -1
- package/dist/utils/focus_redirect.d.ts.map +0 -1
- package/dist/utils/focus_redirect.js.map +0 -1
- package/dist/utils/mouse_leave_region.d.ts.map +0 -1
- package/dist/utils/mouse_leave_region.js.map +0 -1
- package/dist/utils/resize/context.d.ts.map +0 -1
- package/dist/utils/resize/context.js.map +0 -1
- package/dist/utils/resize/handle_config.d.ts.map +0 -1
- package/dist/utils/resize/handle_config.js +0 -85
- package/dist/utils/resize/handle_config.js.map +0 -1
- package/dist/utils/resize/index.d.ts.map +0 -1
- package/dist/utils/resize/resizable.d.ts.map +0 -1
- package/dist/utils/resize/resizable.js.map +0 -1
- package/dist/utils/resize/resize_handle.d.ts.map +0 -1
- package/dist/utils/resize/resize_handle.js.map +0 -1
- package/dist/utils/resize/resize_strategy.d.ts.map +0 -1
- package/dist/utils/resize/resize_strategy.js.map +0 -1
- package/dist/utils/resize/types.d.ts.map +0 -1
- package/dist/utils/scroll_away_listener.d.ts.map +0 -1
- package/dist/utils/scroll_away_listener.js.map +0 -1
- package/dist/utils/types/variations.d.ts.map +0 -1
- package/src/actions/button/__stories__/slim_button.stories.tsx +0 -274
- package/src/actions/button/slim_button/slim_button.module.css +0 -9
- package/src/actions/button/slim_button/slim_button.tsx +0 -26
- package/src/overlay/frame/frame.module.css +0 -5
- package/src/stacks/box/left_resize_handle.module.css +0 -12
- package/src/stacks/box/left_resize_handle.tsx +0 -39
- package/src/stacks/box/right_resize_handle.module.css +0 -12
- package/src/stacks/box/right_resize_handle.tsx +0 -38
- /package/dist/utils/{dnd → decorators/draggable}/context.d.ts +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/context.js +0 -0
- /package/dist/utils/{dnd → decorators}/draggable/draggable.d.ts +0 -0
- /package/dist/utils/{resize → decorators/draggable}/index.js.map +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/types.js +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/types.js.map +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.js +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.d.ts +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/context.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/handle_config.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/index.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/index.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resizable.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resize_handle.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resize_strategy.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/types.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/types.js.map +0 -0
- /package/dist/utils/{click_away_listener.d.ts → listeners/click_away_listener.d.ts} +0 -0
- /package/dist/utils/{focus_redirect.d.ts → listeners/focus_redirect.d.ts} +0 -0
- /package/dist/utils/{focus_redirect.js → listeners/focus_redirect.js} +0 -0
- /package/dist/utils/{mouse_leave_region.d.ts → listeners/mouse_leave_region.d.ts} +0 -0
- /package/dist/utils/{mouse_leave_region.js → listeners/mouse_leave_region.js} +0 -0
- /package/dist/utils/{scroll_away_listener.d.ts → listeners/scroll_away_listener.d.ts} +0 -0
- /package/dist/utils/{types → system}/variations.d.ts +0 -0
- /package/src/utils/{dnd → decorators/draggable}/__stories__/draggable_stories.module.css +0 -0
- /package/src/utils/{dnd → decorators/draggable}/context.ts +0 -0
- /package/src/utils/{dnd → decorators}/draggable/draggable.module.css +0 -0
- /package/src/utils/{dnd/hooks → decorators/draggable}/use_draggable.ts +0 -0
- /package/src/utils/{resize → decorators/resizable}/__stories__/resizable_stories.module.css +0 -0
- /package/src/utils/{resize → decorators/resizable}/index.ts +0 -0
- /package/src/utils/{resize → decorators/resizable}/resizable.module.css +0 -0
- /package/src/utils/{click_away_listener.stories.tsx → listeners/click_away_listener.stories.tsx} +0 -0
- /package/src/utils/{focus_redirect.tsx → listeners/focus_redirect.tsx} +0 -0
- /package/src/utils/{mouse_leave_region.tsx → listeners/mouse_leave_region.tsx} +0 -0
- /package/src/utils/{scroll_away_listener.stories.tsx → listeners/scroll_away_listener.stories.tsx} +0 -0
- /package/src/utils/{types → system}/variations.ts +0 -0
|
@@ -8,40 +8,20 @@ import {
|
|
|
8
8
|
|
|
9
9
|
describe('getHandleConfig', () => {
|
|
10
10
|
describe('edge positions', () => {
|
|
11
|
-
it('
|
|
12
|
-
const config = getHandleConfig('left');
|
|
13
|
-
expect(config.horizontal).toEqual({
|
|
14
|
-
origin: 'left',
|
|
15
|
-
invert: true,
|
|
16
|
-
disableDirection: true,
|
|
17
|
-
});
|
|
18
|
-
expect(config.vertical).toBeUndefined();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('right → horizontal, origin right, invert false, disableDirection true', () => {
|
|
22
|
-
const config = getHandleConfig('right');
|
|
23
|
-
expect(config.horizontal).toEqual({
|
|
24
|
-
origin: 'right',
|
|
25
|
-
invert: false,
|
|
26
|
-
disableDirection: true,
|
|
27
|
-
});
|
|
28
|
-
expect(config.vertical).toBeUndefined();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('start → horizontal, origin left, invert true, disableDirection false', () => {
|
|
11
|
+
it('start → horizontal, origin start, invert true, disableDirection false', () => {
|
|
32
12
|
const config = getHandleConfig('start');
|
|
33
13
|
expect(config.horizontal).toEqual({
|
|
34
|
-
origin: '
|
|
14
|
+
origin: 'start',
|
|
35
15
|
invert: true,
|
|
36
16
|
disableDirection: false,
|
|
37
17
|
});
|
|
38
18
|
expect(config.vertical).toBeUndefined();
|
|
39
19
|
});
|
|
40
20
|
|
|
41
|
-
it('end → horizontal, origin
|
|
21
|
+
it('end → horizontal, origin end, invert false, disableDirection false', () => {
|
|
42
22
|
const config = getHandleConfig('end');
|
|
43
23
|
expect(config.horizontal).toEqual({
|
|
44
|
-
origin: '
|
|
24
|
+
origin: 'end',
|
|
45
25
|
invert: false,
|
|
46
26
|
disableDirection: false,
|
|
47
27
|
});
|
|
@@ -69,65 +49,7 @@ describe('getHandleConfig', () => {
|
|
|
69
49
|
});
|
|
70
50
|
});
|
|
71
51
|
|
|
72
|
-
describe('corner positions
|
|
73
|
-
it('top-left → both axes', () => {
|
|
74
|
-
const config = getHandleConfig('top-left');
|
|
75
|
-
expect(config.horizontal).toEqual({
|
|
76
|
-
origin: 'left',
|
|
77
|
-
invert: true,
|
|
78
|
-
disableDirection: true,
|
|
79
|
-
});
|
|
80
|
-
expect(config.vertical).toEqual({
|
|
81
|
-
origin: 'top',
|
|
82
|
-
invert: true,
|
|
83
|
-
disableDirection: true,
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('top-right → both axes', () => {
|
|
88
|
-
const config = getHandleConfig('top-right');
|
|
89
|
-
expect(config.horizontal).toEqual({
|
|
90
|
-
origin: 'right',
|
|
91
|
-
invert: false,
|
|
92
|
-
disableDirection: true,
|
|
93
|
-
});
|
|
94
|
-
expect(config.vertical).toEqual({
|
|
95
|
-
origin: 'top',
|
|
96
|
-
invert: true,
|
|
97
|
-
disableDirection: true,
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('bottom-left → both axes', () => {
|
|
102
|
-
const config = getHandleConfig('bottom-left');
|
|
103
|
-
expect(config.horizontal).toEqual({
|
|
104
|
-
origin: 'left',
|
|
105
|
-
invert: true,
|
|
106
|
-
disableDirection: true,
|
|
107
|
-
});
|
|
108
|
-
expect(config.vertical).toEqual({
|
|
109
|
-
origin: 'bottom',
|
|
110
|
-
invert: false,
|
|
111
|
-
disableDirection: true,
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('bottom-right → both axes', () => {
|
|
116
|
-
const config = getHandleConfig('bottom-right');
|
|
117
|
-
expect(config.horizontal).toEqual({
|
|
118
|
-
origin: 'right',
|
|
119
|
-
invert: false,
|
|
120
|
-
disableDirection: true,
|
|
121
|
-
});
|
|
122
|
-
expect(config.vertical).toEqual({
|
|
123
|
-
origin: 'bottom',
|
|
124
|
-
invert: false,
|
|
125
|
-
disableDirection: true,
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
describe('corner positions (logical, RTL-aware)', () => {
|
|
52
|
+
describe('corner positions', () => {
|
|
131
53
|
it('top-start → horizontal disableDirection false', () => {
|
|
132
54
|
const config = getHandleConfig('top-start');
|
|
133
55
|
expect(config.horizontal?.disableDirection).toBe(false);
|
|
@@ -230,38 +152,38 @@ describe('computeResizeState', () => {
|
|
|
230
152
|
});
|
|
231
153
|
|
|
232
154
|
describe('resolveHandleConfig', () => {
|
|
233
|
-
it('resolves edge
|
|
234
|
-
const config = resolveHandleConfig('
|
|
235
|
-
expect(config.horizontal).toEqual({ origin: '
|
|
155
|
+
it('resolves end edge with direction in LTR', () => {
|
|
156
|
+
const config = resolveHandleConfig('end', 'ltr');
|
|
157
|
+
expect(config.horizontal).toEqual({ origin: 'end', direction: 1 });
|
|
236
158
|
expect(config.vertical).toBeUndefined();
|
|
237
159
|
});
|
|
238
160
|
|
|
239
|
-
it('resolves edge
|
|
240
|
-
const config = resolveHandleConfig('
|
|
241
|
-
expect(config.horizontal).toEqual({ origin: '
|
|
161
|
+
it('resolves start edge with direction in LTR (inverted)', () => {
|
|
162
|
+
const config = resolveHandleConfig('start', 'ltr');
|
|
163
|
+
expect(config.horizontal).toEqual({ origin: 'start', direction: -1 });
|
|
242
164
|
});
|
|
243
165
|
|
|
244
|
-
it('
|
|
166
|
+
it('start flips direction in RTL', () => {
|
|
245
167
|
const ltr = resolveHandleConfig('start', 'ltr');
|
|
246
168
|
const rtl = resolveHandleConfig('start', 'rtl');
|
|
247
169
|
expect(ltr.horizontal?.direction).toBe(-1);
|
|
248
170
|
expect(rtl.horizontal?.direction).toBe(1);
|
|
249
171
|
});
|
|
250
172
|
|
|
251
|
-
it('
|
|
252
|
-
const ltr = resolveHandleConfig('
|
|
253
|
-
const rtl = resolveHandleConfig('
|
|
254
|
-
expect(ltr.horizontal?.direction).toBe(
|
|
173
|
+
it('end flips direction in RTL', () => {
|
|
174
|
+
const ltr = resolveHandleConfig('end', 'ltr');
|
|
175
|
+
const rtl = resolveHandleConfig('end', 'rtl');
|
|
176
|
+
expect(ltr.horizontal?.direction).toBe(1);
|
|
255
177
|
expect(rtl.horizontal?.direction).toBe(-1);
|
|
256
178
|
});
|
|
257
179
|
|
|
258
180
|
it('resolves corner with both axes', () => {
|
|
259
|
-
const config = resolveHandleConfig('bottom-
|
|
260
|
-
expect(config.horizontal).toEqual({ origin: '
|
|
181
|
+
const config = resolveHandleConfig('bottom-end', 'ltr');
|
|
182
|
+
expect(config.horizontal).toEqual({ origin: 'end', direction: 1 });
|
|
261
183
|
expect(config.vertical).toEqual({ origin: 'bottom', direction: 1 });
|
|
262
184
|
});
|
|
263
185
|
|
|
264
|
-
it('
|
|
186
|
+
it('corner horizontal flips in RTL, vertical does not', () => {
|
|
265
187
|
const config = resolveHandleConfig('bottom-start', 'rtl');
|
|
266
188
|
expect(config.horizontal?.direction).toBe(1);
|
|
267
189
|
expect(config.vertical?.direction).toBe(1);
|
|
@@ -18,22 +18,22 @@ function start(
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
describe('ResizeHandleStrategy', () => {
|
|
21
|
-
describe('horizontal edge (
|
|
21
|
+
describe('horizontal edge (end)', () => {
|
|
22
22
|
it('computes positive resize when dragging right', () => {
|
|
23
|
-
const strategy = new ResizeHandleStrategy('
|
|
23
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
24
24
|
start(strategy);
|
|
25
25
|
|
|
26
26
|
const result = strategy.resize({ x: 150, y: 100 });
|
|
27
27
|
expect(result.horizontal).toBeDefined();
|
|
28
28
|
expect(result.horizontal?.newSize).toBe(350);
|
|
29
|
-
expect(result.horizontal?.origin).toBe('
|
|
29
|
+
expect(result.horizontal?.origin).toBe('end');
|
|
30
30
|
expect(result.horizontal?.totalDelta).toBe(50);
|
|
31
31
|
expect(result.horizontal?.currentDelta).toBe(50);
|
|
32
32
|
expect(result.vertical).toBeUndefined();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
it('computes negative resize when dragging left', () => {
|
|
36
|
-
const strategy = new ResizeHandleStrategy('
|
|
36
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
37
37
|
start(strategy);
|
|
38
38
|
|
|
39
39
|
const result = strategy.resize({ x: 50, y: 100 });
|
|
@@ -42,18 +42,18 @@ describe('ResizeHandleStrategy', () => {
|
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
describe('horizontal edge (
|
|
45
|
+
describe('horizontal edge (start, inverted)', () => {
|
|
46
46
|
it('shrinks when dragging right', () => {
|
|
47
|
-
const strategy = new ResizeHandleStrategy('
|
|
47
|
+
const strategy = new ResizeHandleStrategy('start');
|
|
48
48
|
start(strategy);
|
|
49
49
|
|
|
50
50
|
const result = strategy.resize({ x: 150, y: 100 });
|
|
51
51
|
expect(result.horizontal?.newSize).toBe(250);
|
|
52
|
-
expect(result.horizontal?.origin).toBe('
|
|
52
|
+
expect(result.horizontal?.origin).toBe('start');
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('grows when dragging left', () => {
|
|
56
|
-
const strategy = new ResizeHandleStrategy('
|
|
56
|
+
const strategy = new ResizeHandleStrategy('start');
|
|
57
57
|
start(strategy);
|
|
58
58
|
|
|
59
59
|
const result = strategy.resize({ x: 50, y: 100 });
|
|
@@ -74,20 +74,20 @@ describe('ResizeHandleStrategy', () => {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
describe('corner (bottom-
|
|
77
|
+
describe('corner (bottom-end)', () => {
|
|
78
78
|
it('computes both axes simultaneously', () => {
|
|
79
|
-
const strategy = new ResizeHandleStrategy('bottom-
|
|
79
|
+
const strategy = new ResizeHandleStrategy('bottom-end');
|
|
80
80
|
start(strategy);
|
|
81
81
|
|
|
82
82
|
const result = strategy.resize({ x: 160, y: 140 });
|
|
83
83
|
expect(result.horizontal?.newSize).toBe(360);
|
|
84
|
-
expect(result.horizontal?.origin).toBe('
|
|
84
|
+
expect(result.horizontal?.origin).toBe('end');
|
|
85
85
|
expect(result.vertical?.newSize).toBe(240);
|
|
86
86
|
expect(result.vertical?.origin).toBe('bottom');
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
describe('RTL
|
|
90
|
+
describe('RTL', () => {
|
|
91
91
|
it('start handle flips direction in RTL', () => {
|
|
92
92
|
const strategy = new ResizeHandleStrategy('start');
|
|
93
93
|
start(strategy, { languageDirection: 'rtl' });
|
|
@@ -104,8 +104,8 @@ describe('ResizeHandleStrategy', () => {
|
|
|
104
104
|
expect(result.horizontal?.newSize).toBe(250);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
it('
|
|
108
|
-
const strategy = new ResizeHandleStrategy('
|
|
107
|
+
it('end handle flips direction in RTL', () => {
|
|
108
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
109
109
|
start(strategy, { languageDirection: 'rtl' });
|
|
110
110
|
|
|
111
111
|
const result = strategy.resize({ x: 150, y: 100 });
|
|
@@ -115,7 +115,7 @@ describe('ResizeHandleStrategy', () => {
|
|
|
115
115
|
|
|
116
116
|
describe('commitResize — tracks applied dimensions', () => {
|
|
117
117
|
it('currentDelta tracks committed size', () => {
|
|
118
|
-
const strategy = new ResizeHandleStrategy('
|
|
118
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
119
119
|
start(strategy);
|
|
120
120
|
|
|
121
121
|
strategy.resize({ x: 150, y: 100 });
|
|
@@ -127,7 +127,7 @@ describe('ResizeHandleStrategy', () => {
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
it('currentDelta is correct when previous resize was clamped', () => {
|
|
130
|
-
const strategy = new ResizeHandleStrategy('
|
|
130
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
131
131
|
start(strategy);
|
|
132
132
|
|
|
133
133
|
strategy.resize({ x: 150, y: 100 });
|
|
@@ -141,23 +141,23 @@ describe('ResizeHandleStrategy', () => {
|
|
|
141
141
|
|
|
142
142
|
describe('endResize', () => {
|
|
143
143
|
it('returns committed sizes and origins', () => {
|
|
144
|
-
const strategy = new ResizeHandleStrategy('bottom-
|
|
144
|
+
const strategy = new ResizeHandleStrategy('bottom-end');
|
|
145
145
|
start(strategy);
|
|
146
146
|
|
|
147
147
|
strategy.resize({ x: 180, y: 160 });
|
|
148
148
|
strategy.commitResize({ width: 380, height: 260 });
|
|
149
149
|
|
|
150
150
|
const result = strategy.endResize();
|
|
151
|
-
expect(result.horizontal).toEqual({ width: 380, origin: '
|
|
151
|
+
expect(result.horizontal).toEqual({ width: 380, origin: 'end' });
|
|
152
152
|
expect(result.vertical).toEqual({ height: 260, origin: 'bottom' });
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
it('returns start sizes if no resize occurred', () => {
|
|
156
|
-
const strategy = new ResizeHandleStrategy('
|
|
156
|
+
const strategy = new ResizeHandleStrategy('end');
|
|
157
157
|
start(strategy);
|
|
158
158
|
|
|
159
159
|
const result = strategy.endResize();
|
|
160
|
-
expect(result.horizontal).toEqual({ width: 300, origin: '
|
|
160
|
+
expect(result.horizontal).toEqual({ width: 300, origin: 'end' });
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
import { makeContextHook } from '
|
|
2
|
+
import { makeContextHook } from '../../hooks/make_context_hook.js';
|
|
3
3
|
import type { ResizableContextValue } from './types.js';
|
|
4
4
|
|
|
5
5
|
export const ResizableContext = createContext<ResizableContextValue | undefined>(
|
|
@@ -15,17 +15,11 @@ import type {
|
|
|
15
15
|
|
|
16
16
|
const configs: Record<ResizeHandlePosition, HandleConfig> = {
|
|
17
17
|
// Edges — single axis
|
|
18
|
-
left: {
|
|
19
|
-
horizontal: { origin: 'left', invert: true, disableDirection: true },
|
|
20
|
-
},
|
|
21
|
-
right: {
|
|
22
|
-
horizontal: { origin: 'right', invert: false, disableDirection: true },
|
|
23
|
-
},
|
|
24
18
|
start: {
|
|
25
|
-
horizontal: { origin: '
|
|
19
|
+
horizontal: { origin: 'start', invert: true, disableDirection: false },
|
|
26
20
|
},
|
|
27
21
|
end: {
|
|
28
|
-
horizontal: { origin: '
|
|
22
|
+
horizontal: { origin: 'end', invert: false, disableDirection: false },
|
|
29
23
|
},
|
|
30
24
|
top: {
|
|
31
25
|
vertical: { origin: 'top', invert: true, disableDirection: true },
|
|
@@ -34,39 +28,21 @@ const configs: Record<ResizeHandlePosition, HandleConfig> = {
|
|
|
34
28
|
vertical: { origin: 'bottom', invert: false, disableDirection: true },
|
|
35
29
|
},
|
|
36
30
|
|
|
37
|
-
// Corners — dual axis
|
|
38
|
-
'top-left': {
|
|
39
|
-
horizontal: { origin: 'left', invert: true, disableDirection: true },
|
|
40
|
-
vertical: { origin: 'top', invert: true, disableDirection: true },
|
|
41
|
-
},
|
|
42
|
-
'top-right': {
|
|
43
|
-
horizontal: { origin: 'right', invert: false, disableDirection: true },
|
|
44
|
-
vertical: { origin: 'top', invert: true, disableDirection: true },
|
|
45
|
-
},
|
|
46
|
-
'bottom-left': {
|
|
47
|
-
horizontal: { origin: 'left', invert: true, disableDirection: true },
|
|
48
|
-
vertical: { origin: 'bottom', invert: false, disableDirection: true },
|
|
49
|
-
},
|
|
50
|
-
'bottom-right': {
|
|
51
|
-
horizontal: { origin: 'right', invert: false, disableDirection: true },
|
|
52
|
-
vertical: { origin: 'bottom', invert: false, disableDirection: true },
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// Corners — dual axis (logical, RTL-aware)
|
|
31
|
+
// Corners — dual axis
|
|
56
32
|
'top-start': {
|
|
57
|
-
horizontal: { origin: '
|
|
33
|
+
horizontal: { origin: 'start', invert: true, disableDirection: false },
|
|
58
34
|
vertical: { origin: 'top', invert: true, disableDirection: true },
|
|
59
35
|
},
|
|
60
36
|
'top-end': {
|
|
61
|
-
horizontal: { origin: '
|
|
37
|
+
horizontal: { origin: 'end', invert: false, disableDirection: false },
|
|
62
38
|
vertical: { origin: 'top', invert: true, disableDirection: true },
|
|
63
39
|
},
|
|
64
40
|
'bottom-start': {
|
|
65
|
-
horizontal: { origin: '
|
|
41
|
+
horizontal: { origin: 'start', invert: true, disableDirection: false },
|
|
66
42
|
vertical: { origin: 'bottom', invert: false, disableDirection: true },
|
|
67
43
|
},
|
|
68
44
|
'bottom-end': {
|
|
69
|
-
horizontal: { origin: '
|
|
45
|
+
horizontal: { origin: 'end', invert: false, disableDirection: false },
|
|
70
46
|
vertical: { origin: 'bottom', invert: false, disableDirection: true },
|
|
71
47
|
},
|
|
72
48
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useRef } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { useForkRef } from '
|
|
3
|
+
import { useForkRef } from '../../hooks/use_fork_ref.js';
|
|
4
4
|
import { ResizableContext } from './context.js';
|
|
5
5
|
import type {
|
|
6
6
|
OnWidthResize,
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
pointer-events: auto;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
/* Horizontal edges:
|
|
9
|
-
:where(.resize-handle[data-position="left"]),
|
|
10
|
-
:where(.resize-handle[data-position="right"]),
|
|
8
|
+
/* Horizontal edges: start, end */
|
|
11
9
|
:where(.resize-handle[data-position="start"]),
|
|
12
10
|
:where(.resize-handle[data-position="end"]) {
|
|
13
11
|
top: 0;
|
|
@@ -16,14 +14,6 @@
|
|
|
16
14
|
cursor: ew-resize;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
:where(.resize-handle[data-position="left"]) {
|
|
20
|
-
left: var(--resize-offset, 0px);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
:where(.resize-handle[data-position="right"]) {
|
|
24
|
-
right: var(--resize-offset, 0px);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
17
|
:where(.resize-handle[data-position="start"]:dir(ltr)) {
|
|
28
18
|
left: var(--resize-offset, 0px);
|
|
29
19
|
}
|
|
@@ -58,10 +48,6 @@
|
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
/* Corners: small square at intersection */
|
|
61
|
-
:where(.resize-handle[data-position="top-left"]),
|
|
62
|
-
:where(.resize-handle[data-position="top-right"]),
|
|
63
|
-
:where(.resize-handle[data-position="bottom-left"]),
|
|
64
|
-
:where(.resize-handle[data-position="bottom-right"]),
|
|
65
51
|
:where(.resize-handle[data-position="top-start"]),
|
|
66
52
|
:where(.resize-handle[data-position="top-end"]),
|
|
67
53
|
:where(.resize-handle[data-position="bottom-start"]),
|
|
@@ -70,32 +56,6 @@
|
|
|
70
56
|
height: 16px;
|
|
71
57
|
}
|
|
72
58
|
|
|
73
|
-
/* Physical corners */
|
|
74
|
-
:where(.resize-handle[data-position="top-left"]) {
|
|
75
|
-
top: var(--resize-offset, 0px);
|
|
76
|
-
left: var(--resize-offset, 0px);
|
|
77
|
-
cursor: nwse-resize;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:where(.resize-handle[data-position="top-right"]) {
|
|
81
|
-
top: var(--resize-offset, 0px);
|
|
82
|
-
right: var(--resize-offset, 0px);
|
|
83
|
-
cursor: nesw-resize;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:where(.resize-handle[data-position="bottom-left"]) {
|
|
87
|
-
bottom: var(--resize-offset, 0px);
|
|
88
|
-
left: var(--resize-offset, 0px);
|
|
89
|
-
cursor: nesw-resize;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
:where(.resize-handle[data-position="bottom-right"]) {
|
|
93
|
-
bottom: var(--resize-offset, 0px);
|
|
94
|
-
right: var(--resize-offset, 0px);
|
|
95
|
-
cursor: nwse-resize;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* Logical corners (RTL-aware) */
|
|
99
59
|
:where(.resize-handle[data-position="top-start"]:dir(ltr)) {
|
|
100
60
|
top: var(--resize-offset, 0px);
|
|
101
61
|
left: var(--resize-offset, 0px);
|
|
@@ -3,7 +3,7 @@ import { clsx } from 'clsx';
|
|
|
3
3
|
import { useResizable } from './context.js';
|
|
4
4
|
import { getHandleConfig } from './handle_config.js';
|
|
5
5
|
import { ResizeHandleStrategy } from './resize_strategy.js';
|
|
6
|
-
import { detectResizeBounds } from '
|
|
6
|
+
import { detectResizeBounds } from '../../../stacks/box/detect_resize_bounds.js';
|
|
7
7
|
import type { ResizeHandlePosition } from './types.js';
|
|
8
8
|
import styles from './resize_handle.module.css';
|
|
9
9
|
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
WidthResizeOrigin,
|
|
10
10
|
HeightResizeOrigin,
|
|
11
11
|
} from './types.js';
|
|
12
|
-
import type { Dimensions, Position, Rectangle } from '
|
|
12
|
+
import type { Dimensions, Position, Rectangle } from '../../types/dimensions.js';
|
|
13
13
|
|
|
14
14
|
export interface StartResizeParams {
|
|
15
15
|
rectangle: Rectangle;
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
OnHeightResizeEnd,
|
|
6
6
|
WidthResizeOrigin,
|
|
7
7
|
HeightResizeOrigin,
|
|
8
|
-
} from '
|
|
8
|
+
} from '../../../stacks/box/types.js';
|
|
9
9
|
|
|
10
10
|
export type {
|
|
11
11
|
OnWidthResize,
|
|
@@ -20,15 +20,9 @@ export type ResizeHandlePosition =
|
|
|
20
20
|
// Edges (single axis)
|
|
21
21
|
| 'top'
|
|
22
22
|
| 'bottom'
|
|
23
|
-
| 'left'
|
|
24
|
-
| 'right'
|
|
25
23
|
| 'start'
|
|
26
24
|
| 'end'
|
|
27
25
|
// Corners (dual axis)
|
|
28
|
-
| 'top-left'
|
|
29
|
-
| 'top-right'
|
|
30
|
-
| 'bottom-left'
|
|
31
|
-
| 'bottom-right'
|
|
32
26
|
| 'top-start'
|
|
33
27
|
| 'top-end'
|
|
34
28
|
| 'bottom-start'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createContext, useContext, useId } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LabelledByContextValue {
|
|
4
|
+
labelId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Context for wiring aria-labelledby between a parent container and a child
|
|
9
|
+
* label element.
|
|
10
|
+
*/
|
|
11
|
+
export const LabelledByContext = createContext<LabelledByContextValue | null>(null);
|
|
12
|
+
|
|
13
|
+
export const useLabelledBy = () => useContext(LabelledByContext);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Derives a stable label ID for aria-labelledby wiring.
|
|
17
|
+
*
|
|
18
|
+
* - If `ariaLabelledBy` is provided, it takes precedence (full override).
|
|
19
|
+
* - If `id` is provided, the label ID is deterministic (`${id}-legend`).
|
|
20
|
+
* - Otherwise, falls back to React's `useId()`.
|
|
21
|
+
*/
|
|
22
|
+
export function useLabelledById(id?: string, ariaLabelledBy?: string) {
|
|
23
|
+
const reactId = useId();
|
|
24
|
+
const baseId = id ?? reactId;
|
|
25
|
+
const labelId = ariaLabelledBy || `${baseId}-legend`;
|
|
26
|
+
return { baseId, labelId };
|
|
27
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './focus_redirect.js';
|
|
3
|
-
export * from './scroll_away_listener.js';
|
|
1
|
+
export * from './listeners/index.js';
|
|
4
2
|
|
|
5
|
-
export * from './
|
|
3
|
+
export * from './decorators/draggable/use_draggable.js';
|
|
6
4
|
export * from './hooks/make_context_hook.js';
|
|
7
5
|
export * from './hooks/use_fork_ref.js';
|
|
8
6
|
export * from './hooks/use_resize_observer.js';
|
|
9
7
|
export * from './hooks/use_media_query.js';
|
|
8
|
+
export * from './hooks/labelled_by_context.js';
|
|
10
9
|
|
|
11
10
|
export * from './default_value.js';
|
|
12
11
|
|
|
@@ -17,9 +16,10 @@ export * from './calendar/get_months_of_year.js';
|
|
|
17
16
|
export * from './calendar/month.js';
|
|
18
17
|
|
|
19
18
|
export * from './types/dimensions.js';
|
|
20
|
-
export * from './types/
|
|
19
|
+
export * from './types/sides.js';
|
|
20
|
+
export * from './system/index.js';
|
|
21
21
|
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
22
|
+
export * from './decorators/draggable/draggable.js';
|
|
23
|
+
export * from './decorators/draggable/drag_handle.js';
|
|
24
24
|
|
|
25
|
-
export * from './
|
|
25
|
+
export * from './decorators/resizable/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useCallback, useRef } from 'react';
|
|
2
|
-
import { useForkRef } from '
|
|
2
|
+
import { useForkRef } from '../hooks/use_fork_ref.js';
|
|
3
3
|
export interface ClickAwayListenerProps {
|
|
4
4
|
children: React.ReactElement;
|
|
5
5
|
onClickAway: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { useForkRef } from '
|
|
2
|
+
import { useForkRef } from '../hooks/use_fork_ref.js';
|
|
3
3
|
export interface ScrollAwayListenerProps {
|
|
4
4
|
children: React.ReactElement;
|
|
5
5
|
isException?: (target: HTMLElement) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './variations.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ButtonProps } from '../button/button.js';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated - use Button instead (utility=true)
|
|
5
|
-
* @param props - ButtonProps
|
|
6
|
-
* @returns SlimButton
|
|
7
|
-
*/
|
|
8
|
-
export declare const SlimButton: React.ForwardRefExoticComponent<Omit<Omit<ButtonProps, "utility">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
//# sourceMappingURL=slim_button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slim_button.d.ts","sourceRoot":"","sources":["../../../../src/actions/button/slim_button/slim_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;GAIG;AACH,eAAO,MAAM,UAAU,qHAcrB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import i from "react";
|
|
3
|
-
import { Button as n } from "../button/button.js";
|
|
4
|
-
import { clsx as l } from "clsx";
|
|
5
|
-
import '../../../slim_button.css';const u = "_slim-button_188fdc3", c = { "slim-button": u }, b = i.forwardRef(({ children: t, className: o, ...m }, r) => /* @__PURE__ */ s(
|
|
6
|
-
n,
|
|
7
|
-
{
|
|
8
|
-
ref: r,
|
|
9
|
-
className: l(c["slim-button"], "tcn-slim-button", o),
|
|
10
|
-
utility: !0,
|
|
11
|
-
...m,
|
|
12
|
-
children: t
|
|
13
|
-
}
|
|
14
|
-
));
|
|
15
|
-
export {
|
|
16
|
-
b as SlimButton
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=slim_button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slim_button.js","sources":["../../../../src/actions/button/slim_button/slim_button.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '../button/button.js';\nimport { clsx } from 'clsx';\n// Styles\nimport styles from './slim_button.module.css';\n\n/**\n * @deprecated - use Button instead (utility=true)\n * @param props - ButtonProps\n * @returns SlimButton\n */\nexport const SlimButton = React.forwardRef<\n HTMLButtonElement,\n Omit<ButtonProps, 'utility'>\n>(({ children, className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={clsx(styles['slim-button'], 'tcn-slim-button', className)}\n utility={true}\n {...props}\n >\n {children}\n </Button>\n );\n});\n"],"names":["SlimButton","React","children","className","props","ref","jsx","Button","clsx","styles"],"mappings":";;;;4DAWaA,IAAaC,EAAM,WAG9B,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAElC,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAKC,EAAO,aAAa,GAAG,mBAAmBN,CAAS;AAAA,IACnE,SAAS;AAAA,IACR,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AAAA,CAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draggable.module-BgelQsuJ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/frame.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer tcn-system{:where(._frame-dialog_2a77c1d){overflow:hidden}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer tcn-system{:where(._left-resize-handle_215501a){position:fixed;bottom:0;left:var(--resize-offset, -8px);height:100%;width:16px;z-index:1;cursor:ew-resize;pointer-events:auto}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.module-I6iyBAvM.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer tcn-system{:where(._right-resize-handle_7f232b9){position:fixed;bottom:0;right:var(--resize-offset, -8px);height:100%;width:16px;z-index:1;cursor:ew-resize;pointer-events:auto}}
|
package/dist/slim_button.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer tcn-system{:where(._slim-button_188fdc3){min-height:auto}:where(._slim-button_188fdc3[data-is-disabled=true]){pointer-events:none}}
|