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