@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone_number_context.js","sources":["../../../src/inputs/phone_number_input/phone_number_context.tsx"],"sourcesContent":["import React from 'react';\nimport { makeContextHook } from '../../utils/index.js';\nimport { OptionProps } from '../options/option.js';\nimport type { CountryCode } from 'libphonenumber-js';\n\nexport interface PhoneContext {\n allowSip: boolean;\n phoneBook: React.ReactElement<OptionProps>[];\n ariaPhoneBookButtonLabel?: string;\n ariaSelectLabel?: string;\n value: string;\n setValue: (value: string) => void;\n setCountry: (country: CountryCode) => void;\n sipAddress: string;\n setSipAddress: (address: string) => void;\n disabled?: boolean;\n focusNumberInput: boolean;\n setFocusNumberInput: (focus: boolean) => void;\n}\n\nexport const PhoneBookContext = React.createContext<PhoneContext | undefined>(undefined);\nexport const usePhoneContext = makeContextHook(PhoneBookContext, 'PhoneBookContext');\n\nexport function PhoneBookProvider({\n children,\n value,\n}: {\n value: PhoneContext;\n children: React.ReactNode;\n}) {\n return <PhoneBookContext.Provider value={value}>{children}</PhoneBookContext.Provider>;\n}\n"],"names":["PhoneBookContext","React","usePhoneContext","makeContextHook","PhoneBookProvider","children","value","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone_number_context.js","sources":["../../../src/inputs/phone_number_input/phone_number_context.tsx"],"sourcesContent":["import React from 'react';\nimport { makeContextHook } from '../../utils/index.js';\nimport { OptionProps } from '../options/option.js';\nimport type { CountryCode } from 'libphonenumber-js';\n\nexport interface PhoneContext {\n allowSip: boolean;\n phoneBook: React.ReactElement<OptionProps>[];\n ariaPhoneBookButtonLabel?: string;\n ariaSelectLabel?: string;\n value: string;\n setValue: (value: string) => void;\n setCountry: (country: CountryCode) => void;\n sipAddress: string;\n setSipAddress: (address: string) => void;\n disabled?: boolean;\n focusNumberInput: boolean;\n setFocusNumberInput: (focus: boolean) => void;\n}\n\nexport const PhoneBookContext = React.createContext<PhoneContext | undefined>(undefined);\nexport const usePhoneContext = makeContextHook(PhoneBookContext, 'PhoneBookContext');\n\nexport function PhoneBookProvider({\n children,\n value,\n}: {\n value: PhoneContext;\n children: React.ReactNode;\n}) {\n return <PhoneBookContext.Provider value={value}>{children}</PhoneBookContext.Provider>;\n}\n"],"names":["PhoneBookContext","React","usePhoneContext","makeContextHook","PhoneBookProvider","children","value","jsx"],"mappings":";;;;;;;;;;;;;;AAoBO,MAAMA,IAAmBC,EAAM,cAAwC,MAAS,GAC1EC,IAAkBC,EAAgBH,GAAkB,kBAAkB;AAE5E,SAASI,EAAkB;AAAA,EAChC,UAAAC;AAAA,EACA,OAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACP,EAAiB,UAAjB,EAA0B,OAAAM,GAAe,UAAAD,EAAA,CAAS;AAC5D;"}
|
|
@@ -4,7 +4,6 @@ import f from "clsx";
|
|
|
4
4
|
import { forwardRef as F, useState as R, useRef as y, useCallback as z, useLayoutEffect as E } from "react";
|
|
5
5
|
import "../../actions/button/base_button/base_button.js";
|
|
6
6
|
import "../../actions/button/button_group/button_group.js";
|
|
7
|
-
import "../../actions/button/slim_button/slim_button.js";
|
|
8
7
|
import { Button as L } from "../../actions/button/button/button.js";
|
|
9
8
|
import "../../actions/toggle/toggle.js";
|
|
10
9
|
import { SuggestionList as w } from "../suggestions/suggestion_list.js";
|
|
@@ -12,7 +11,7 @@ import { usePhoneContext as j } from "./phone_number_context.js";
|
|
|
12
11
|
import { getCountryFromValue as T } from "./phone_number_country_select_adapter.js";
|
|
13
12
|
import { Input as V } from "../input/input.js";
|
|
14
13
|
import { useForkRef as q } from "../../utils/hooks/use_fork_ref.js";
|
|
15
|
-
const
|
|
14
|
+
const oo = F(function({ onChange: n, value: t = "", className: a, ...h }, g) {
|
|
16
15
|
t = t.toString();
|
|
17
16
|
const [s, r] = R(
|
|
18
17
|
null
|
|
@@ -93,6 +92,6 @@ const to = F(function({ onChange: n, value: t = "", className: a, ...h }, g) {
|
|
|
93
92
|
] });
|
|
94
93
|
});
|
|
95
94
|
export {
|
|
96
|
-
|
|
95
|
+
oo as PhoneNumberInputAdapter
|
|
97
96
|
};
|
|
98
97
|
//# sourceMappingURL=phone_number_input_adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone_number_input_adapter.js","sources":["../../../src/inputs/phone_number_input/phone_number_input_adapter.tsx"],"sourcesContent":["import { NotebookIcon } from '@tcn/icons/notebook_icon.js';\nimport clsx from 'clsx';\nimport { forwardRef, useState, useCallback, useLayoutEffect, useRef } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\nimport { usePhoneContext } from './phone_number_context.js';\nimport { getCountryFromValue } from './phone_number_country_select_adapter.js';\nimport { Input } from '../input/input.js';\nimport { useForkRef } from '../../utils/hooks/use_fork_ref.js';\n\n/**\n * Bridges `@tcn/ui/inputs` Input (onChange: (value, event?) => void)\n * with react-phone-number-input's expectation (onChange: (event) => void).\n */\nexport const PhoneNumberInputAdapter = forwardRef<\n HTMLInputElement,\n React.InputHTMLAttributes<HTMLInputElement>\n>(function InputAdapter({ onChange, value = '', className, ...rest }, ref) {\n value = value.toString();\n const [phoneBookElement, setPhoneBookElement] = useState<HTMLButtonElement | null>(\n null\n );\n const isPhoneBookOpen = phoneBookElement != null;\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const forkedRef = useForkRef(ref, internalInputRef);\n\n const {\n phoneBook: phoneBookOptions,\n setValue,\n ariaPhoneBookButtonLabel,\n disabled,\n setFocusNumberInput,\n focusNumberInput,\n } = usePhoneContext();\n\n const showPhoneBook = phoneBookOptions.length > 0;\n\n function togglePhoneBook(e: React.MouseEvent<HTMLButtonElement>) {\n if (isPhoneBookOpen) {\n setPhoneBookElement(null);\n } else {\n setPhoneBookElement(e.currentTarget);\n }\n }\n\n function closePhoneBook() {\n setPhoneBookElement(null);\n }\n\n function handlePhoneBookOptionSelect(value: string) {\n closePhoneBook();\n setFocusNumberInput(true);\n setValue(value);\n }\n\n const handleChange = useCallback(\n (value: string, event?: React.ChangeEvent<HTMLInputElement>) => {\n if (!onChange) return;\n const e =\n event ??\n ({\n target: { value },\n currentTarget: { value },\n } as React.ChangeEvent<HTMLInputElement>);\n onChange(e);\n },\n [onChange]\n );\n\n if (value.startsWith('+')) {\n const country = getCountryFromValue(value);\n const prefixLength = country?.prefix?.length || 0;\n value = value.substring(prefixLength);\n }\n\n useLayoutEffect(() => {\n const input = internalInputRef?.current;\n\n if (input == null || !focusNumberInput) {\n return;\n }\n\n requestAnimationFrame(() => {\n if (input.value.length > 0) {\n input.select();\n } else {\n input.focus();\n }\n });\n }, [focusNumberInput]);\n\n return (\n <>\n <Input\n ref={forkedRef}\n value={value}\n {...(rest as any)}\n className={clsx(className, 'tcn-control-set-item')}\n onChange={handleChange}\n />\n {showPhoneBook && (\n <Button\n disabled={disabled}\n className={clsx('tcn-control-set-item', 'tcn-phone-number-phone-book')}\n aria-label={ariaPhoneBookButtonLabel}\n onClick={togglePhoneBook}\n size=\"md\"\n >\n <NotebookIcon size=\"md\" />\n </Button>\n )}\n <SuggestionList\n open={isPhoneBookOpen}\n anchorElement={phoneBookElement}\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n width=\"300px\"\n onOptionSelect={handlePhoneBookOptionSelect}\n onClose={closePhoneBook}\n noSuggestionMessage=\"No phone numbers found\"\n >\n {phoneBookOptions}\n </SuggestionList>\n </>\n );\n});\n"],"names":["PhoneNumberInputAdapter","forwardRef","onChange","value","className","rest","ref","phoneBookElement","setPhoneBookElement","useState","isPhoneBookOpen","internalInputRef","useRef","forkedRef","useForkRef","phoneBookOptions","setValue","ariaPhoneBookButtonLabel","disabled","setFocusNumberInput","focusNumberInput","usePhoneContext","showPhoneBook","togglePhoneBook","e","closePhoneBook","handlePhoneBookOptionSelect","handleChange","useCallback","event","prefixLength","getCountryFromValue","useLayoutEffect","input","jsxs","Fragment","jsx","Input","clsx","Button","NotebookIcon","SuggestionList"],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone_number_input_adapter.js","sources":["../../../src/inputs/phone_number_input/phone_number_input_adapter.tsx"],"sourcesContent":["import { NotebookIcon } from '@tcn/icons/notebook_icon.js';\nimport clsx from 'clsx';\nimport { forwardRef, useState, useCallback, useLayoutEffect, useRef } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\nimport { usePhoneContext } from './phone_number_context.js';\nimport { getCountryFromValue } from './phone_number_country_select_adapter.js';\nimport { Input } from '../input/input.js';\nimport { useForkRef } from '../../utils/hooks/use_fork_ref.js';\n\n/**\n * Bridges `@tcn/ui/inputs` Input (onChange: (value, event?) => void)\n * with react-phone-number-input's expectation (onChange: (event) => void).\n */\nexport const PhoneNumberInputAdapter = forwardRef<\n HTMLInputElement,\n React.InputHTMLAttributes<HTMLInputElement>\n>(function InputAdapter({ onChange, value = '', className, ...rest }, ref) {\n value = value.toString();\n const [phoneBookElement, setPhoneBookElement] = useState<HTMLButtonElement | null>(\n null\n );\n const isPhoneBookOpen = phoneBookElement != null;\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const forkedRef = useForkRef(ref, internalInputRef);\n\n const {\n phoneBook: phoneBookOptions,\n setValue,\n ariaPhoneBookButtonLabel,\n disabled,\n setFocusNumberInput,\n focusNumberInput,\n } = usePhoneContext();\n\n const showPhoneBook = phoneBookOptions.length > 0;\n\n function togglePhoneBook(e: React.MouseEvent<HTMLButtonElement>) {\n if (isPhoneBookOpen) {\n setPhoneBookElement(null);\n } else {\n setPhoneBookElement(e.currentTarget);\n }\n }\n\n function closePhoneBook() {\n setPhoneBookElement(null);\n }\n\n function handlePhoneBookOptionSelect(value: string) {\n closePhoneBook();\n setFocusNumberInput(true);\n setValue(value);\n }\n\n const handleChange = useCallback(\n (value: string, event?: React.ChangeEvent<HTMLInputElement>) => {\n if (!onChange) return;\n const e =\n event ??\n ({\n target: { value },\n currentTarget: { value },\n } as React.ChangeEvent<HTMLInputElement>);\n onChange(e);\n },\n [onChange]\n );\n\n if (value.startsWith('+')) {\n const country = getCountryFromValue(value);\n const prefixLength = country?.prefix?.length || 0;\n value = value.substring(prefixLength);\n }\n\n useLayoutEffect(() => {\n const input = internalInputRef?.current;\n\n if (input == null || !focusNumberInput) {\n return;\n }\n\n requestAnimationFrame(() => {\n if (input.value.length > 0) {\n input.select();\n } else {\n input.focus();\n }\n });\n }, [focusNumberInput]);\n\n return (\n <>\n <Input\n ref={forkedRef}\n value={value}\n {...(rest as any)}\n className={clsx(className, 'tcn-control-set-item')}\n onChange={handleChange}\n />\n {showPhoneBook && (\n <Button\n disabled={disabled}\n className={clsx('tcn-control-set-item', 'tcn-phone-number-phone-book')}\n aria-label={ariaPhoneBookButtonLabel}\n onClick={togglePhoneBook}\n size=\"md\"\n >\n <NotebookIcon size=\"md\" />\n </Button>\n )}\n <SuggestionList\n open={isPhoneBookOpen}\n anchorElement={phoneBookElement}\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n width=\"300px\"\n onOptionSelect={handlePhoneBookOptionSelect}\n onClose={closePhoneBook}\n noSuggestionMessage=\"No phone numbers found\"\n >\n {phoneBookOptions}\n </SuggestionList>\n </>\n );\n});\n"],"names":["PhoneNumberInputAdapter","forwardRef","onChange","value","className","rest","ref","phoneBookElement","setPhoneBookElement","useState","isPhoneBookOpen","internalInputRef","useRef","forkedRef","useForkRef","phoneBookOptions","setValue","ariaPhoneBookButtonLabel","disabled","setFocusNumberInput","focusNumberInput","usePhoneContext","showPhoneBook","togglePhoneBook","e","closePhoneBook","handlePhoneBookOptionSelect","handleChange","useCallback","event","prefixLength","getCountryFromValue","useLayoutEffect","input","jsxs","Fragment","jsx","Input","clsx","Button","NotebookIcon","SuggestionList"],"mappings":";;;;;;;;;;;;;AAcO,MAAMA,KAA0BC,EAGrC,SAAsB,EAAE,UAAAC,GAAU,OAAAC,IAAQ,IAAI,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AACzE,EAAAH,IAAQA,EAAM,SAAA;AACd,QAAM,CAACI,GAAkBC,CAAmB,IAAIC;AAAA,IAC9C;AAAA,EAAA,GAEIC,IAAkBH,KAAoB,MACtCI,IAAmBC,EAAgC,IAAI,GACvDC,IAAYC,EAAWR,GAAKK,CAAgB,GAE5C;AAAA,IACJ,WAAWI;AAAA,IACX,UAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,UAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEC,EAAA,GAEEC,IAAgBP,EAAiB,SAAS;AAEhD,WAASQ,EAAgBC,GAAwC;AAC/D,IACEhB,EADEE,IACkB,OAEAc,EAAE,aAFE;AAAA,EAI5B;AAEA,WAASC,IAAiB;AACxB,IAAAjB,EAAoB,IAAI;AAAA,EAC1B;AAEA,WAASkB,EAA4BvB,GAAe;AAClD,IAAAsB,EAAA,GACAN,EAAoB,EAAI,GACxBH,EAASb,CAAK;AAAA,EAChB;AAEA,QAAMwB,IAAeC;AAAA,IACnB,CAACzB,GAAe0B,MAAgD;AAC9D,UAAI,CAAC3B,EAAU;AAOf,MAAAA,EALE2B,KACC;AAAA,QACC,QAAQ,EAAE,OAAA1B,EAAAA;AAAAA,QACV,eAAe,EAAE,OAAAA,EAAAA;AAAAA,MAAM,CAEjB;AAAA,IACZ;AAAA,IACA,CAACD,CAAQ;AAAA,EAAA;AAGX,MAAIC,EAAM,WAAW,GAAG,GAAG;AAEzB,UAAM2B,IADUC,EAAoB5B,CAAK,GACX,QAAQ,UAAU;AAChD,IAAAA,IAAQA,EAAM,UAAU2B,CAAY;AAAA,EACtC;AAEA,SAAAE,EAAgB,MAAM;AACpB,UAAMC,IAAQtB,GAAkB;AAEhC,IAAIsB,KAAS,QAAQ,CAACb,KAItB,sBAAsB,MAAM;AAC1B,MAAIa,EAAM,MAAM,SAAS,IACvBA,EAAM,OAAA,IAENA,EAAM,MAAA;AAAA,IAEV,CAAC;AAAA,EACH,GAAG,CAACb,CAAgB,CAAC,GAGnB,gBAAAc,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAKxB;AAAA,QACL,OAAAV;AAAA,QACC,GAAIE;AAAA,QACL,WAAWiC,EAAKlC,GAAW,sBAAsB;AAAA,QACjD,UAAUuB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEXL,KACC,gBAAAc;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,UAAArB;AAAA,QACA,WAAWoB,EAAK,wBAAwB,6BAA6B;AAAA,QACrE,cAAYrB;AAAA,QACZ,SAASM;AAAA,QACT,MAAK;AAAA,QAEL,UAAA,gBAAAa,EAACI,GAAA,EAAa,MAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,IAG5B,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAM/B;AAAA,QACN,eAAeH;AAAA,QACf,kBAAiB;AAAA,QACjB,kBAAiB;AAAA,QACjB,gBAAe;AAAA,QACf,gBAAe;AAAA,QACf,OAAM;AAAA,QACN,gBAAgBmB;AAAA,QAChB,SAASD;AAAA,QACT,qBAAoB;AAAA,QAEnB,UAAAV;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ,CAAC;"}
|
|
@@ -4,7 +4,6 @@ import { NotebookIcon as L } from "@tcn/icons/notebook_icon.js";
|
|
|
4
4
|
import { Input as R } from "../input/input.js";
|
|
5
5
|
import "../../actions/button/base_button/base_button.js";
|
|
6
6
|
import "../../actions/button/button_group/button_group.js";
|
|
7
|
-
import "../../actions/button/slim_button/slim_button.js";
|
|
8
7
|
import { Button as j } from "../../actions/button/button/button.js";
|
|
9
8
|
import "../../actions/toggle/toggle.js";
|
|
10
9
|
import { ControlSet as w } from "../control_set/control_set.js";
|
|
@@ -12,7 +11,7 @@ import y from "clsx";
|
|
|
12
11
|
import { usePhoneContext as V } from "./phone_number_context.js";
|
|
13
12
|
import { PhoneNumberCountrySelectAdapter as _ } from "./phone_number_country_select_adapter.js";
|
|
14
13
|
import { SuggestionList as q } from "../suggestions/suggestion_list.js";
|
|
15
|
-
function
|
|
14
|
+
function Z({
|
|
16
15
|
disabled: n,
|
|
17
16
|
countries: d,
|
|
18
17
|
name: k,
|
|
@@ -27,8 +26,8 @@ function oo({
|
|
|
27
26
|
setCountry: C,
|
|
28
27
|
ariaPhoneBookButtonLabel: I,
|
|
29
28
|
sipAddress: p,
|
|
30
|
-
setSipAddress:
|
|
31
|
-
focusNumberInput:
|
|
29
|
+
setSipAddress: c,
|
|
30
|
+
focusNumberInput: m,
|
|
32
31
|
setFocusNumberInput: a
|
|
33
32
|
} = V(), x = s.length > 0;
|
|
34
33
|
function A(o) {
|
|
@@ -45,17 +44,17 @@ function oo({
|
|
|
45
44
|
label: o
|
|
46
45
|
})) || [];
|
|
47
46
|
function v(o) {
|
|
48
|
-
o !== "SIP" && (
|
|
47
|
+
o !== "SIP" && (c(p), a(!0), r(""), C(o || "US"));
|
|
49
48
|
}
|
|
50
49
|
function z(o) {
|
|
51
|
-
|
|
50
|
+
c(o), r(`sip:${o}`);
|
|
52
51
|
}
|
|
53
52
|
return F(() => {
|
|
54
53
|
const o = i.current;
|
|
55
|
-
o == null || !
|
|
54
|
+
o == null || !m || requestAnimationFrame(() => {
|
|
56
55
|
o.value.length > 0 ? o.select() : o.focus();
|
|
57
56
|
});
|
|
58
|
-
}, [
|
|
57
|
+
}, [m]), /* @__PURE__ */ f(E, { children: [
|
|
59
58
|
/* @__PURE__ */ f(w, { children: [
|
|
60
59
|
/* @__PURE__ */ e(
|
|
61
60
|
_,
|
|
@@ -111,6 +110,6 @@ function oo({
|
|
|
111
110
|
] });
|
|
112
111
|
}
|
|
113
112
|
export {
|
|
114
|
-
|
|
113
|
+
Z as SipInput
|
|
115
114
|
};
|
|
116
115
|
//# sourceMappingURL=sip_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sip_input.js","sources":["../../../src/inputs/phone_number_input/sip_input.tsx"],"sourcesContent":["import React, { useLayoutEffect } from 'react';\nimport { NotebookIcon } from '@tcn/icons/notebook_icon.js';\nimport { Input } from '../input/input.js';\nimport { Button } from '../../actions/index.js';\nimport { ControlSet } from '../control_set/control_set.js';\nimport clsx from 'clsx';\nimport { usePhoneContext } from './phone_number_context.js';\nimport type { CountryCode } from 'libphonenumber-js';\nimport {\n PhoneNumberCountrySelectAdapter,\n type CountryOption,\n} from './phone_number_country_select_adapter.js';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\n\nexport interface SipInputProps {\n onChange: (value: string) => void;\n sipAutoComplete?: string;\n countries?: CountryCode[];\n disabled?: boolean;\n name?: string;\n 'aria-label'?: string;\n autoFocus?: boolean;\n placeholder?: string;\n}\n\nexport function SipInput({\n disabled,\n countries,\n name,\n 'aria-label': ariaLabel,\n autoFocus,\n placeholder,\n sipAutoComplete = 'on',\n}: SipInputProps) {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [phoneBookElement, setPhoneBookElement] =\n React.useState<HTMLButtonElement | null>(null);\n const isPhoneBookOpen = phoneBookElement != null;\n\n const {\n phoneBook: phoneBookOptions,\n setValue,\n setCountry,\n ariaPhoneBookButtonLabel,\n sipAddress,\n setSipAddress,\n focusNumberInput,\n setFocusNumberInput,\n } = usePhoneContext();\n\n const showPhoneBook = phoneBookOptions.length > 0;\n\n function togglePhoneBook(e: React.MouseEvent<HTMLButtonElement>) {\n if (isPhoneBookOpen) {\n setPhoneBookElement(null);\n } else {\n setPhoneBookElement(e.currentTarget);\n }\n }\n\n function closePhoneBook() {\n setPhoneBookElement(null);\n }\n\n function handlePhoneBookOptionSelect(value: string) {\n closePhoneBook();\n setFocusNumberInput(true);\n setValue(value);\n }\n\n const options: CountryOption[] =\n countries?.map(country => ({\n value: country,\n label: country,\n })) || [];\n\n function selectCountry(countryCode?: string) {\n if (countryCode !== 'SIP') {\n setSipAddress(sipAddress);\n setFocusNumberInput(true);\n setValue('');\n setCountry((countryCode as CountryCode) || 'US');\n }\n }\n\n function updateSipValue(value: string) {\n setSipAddress(value);\n setValue(`sip:${value}`);\n }\n\n useLayoutEffect(() => {\n const input = inputRef.current;\n\n if (input == null || !focusNumberInput) {\n return;\n }\n\n requestAnimationFrame(() => {\n if (input.value.length > 0) {\n input.select();\n } else {\n input.focus();\n }\n });\n }, [focusNumberInput]);\n\n return (\n <>\n <ControlSet>\n <PhoneNumberCountrySelectAdapter\n value=\"SIP\"\n onChange={selectCountry}\n options={options}\n disabled={disabled}\n />\n <Input\n ref={inputRef}\n value={sipAddress}\n disabled={disabled}\n onChange={updateSipValue}\n name={name}\n aria-label={ariaLabel}\n autoFocus={autoFocus}\n placeholder={placeholder}\n autoComplete={sipAutoComplete}\n />\n {showPhoneBook && (\n <Button\n disabled={disabled}\n className={clsx('tcn-control-set-item', 'tcn-phone-number-phone-book')}\n aria-label={ariaPhoneBookButtonLabel}\n onClick={togglePhoneBook}\n size=\"md\"\n >\n <NotebookIcon size=\"md\" />\n </Button>\n )}\n </ControlSet>\n <SuggestionList\n open={isPhoneBookOpen}\n anchorElement={phoneBookElement}\n onOptionSelect={handlePhoneBookOptionSelect}\n onClose={closePhoneBook}\n width=\"300px\"\n noSuggestionMessage=\"No phone numbers found\"\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n >\n {phoneBookOptions}\n </SuggestionList>\n </>\n );\n}\n"],"names":["SipInput","disabled","countries","name","ariaLabel","autoFocus","placeholder","sipAutoComplete","inputRef","React","phoneBookElement","setPhoneBookElement","isPhoneBookOpen","phoneBookOptions","setValue","setCountry","ariaPhoneBookButtonLabel","sipAddress","setSipAddress","focusNumberInput","setFocusNumberInput","usePhoneContext","showPhoneBook","togglePhoneBook","e","closePhoneBook","handlePhoneBookOptionSelect","value","options","country","selectCountry","countryCode","updateSipValue","useLayoutEffect","input","jsxs","Fragment","ControlSet","jsx","PhoneNumberCountrySelectAdapter","Input","Button","clsx","NotebookIcon","SuggestionList"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sip_input.js","sources":["../../../src/inputs/phone_number_input/sip_input.tsx"],"sourcesContent":["import React, { useLayoutEffect } from 'react';\nimport { NotebookIcon } from '@tcn/icons/notebook_icon.js';\nimport { Input } from '../input/input.js';\nimport { Button } from '../../actions/index.js';\nimport { ControlSet } from '../control_set/control_set.js';\nimport clsx from 'clsx';\nimport { usePhoneContext } from './phone_number_context.js';\nimport type { CountryCode } from 'libphonenumber-js';\nimport {\n PhoneNumberCountrySelectAdapter,\n type CountryOption,\n} from './phone_number_country_select_adapter.js';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\n\nexport interface SipInputProps {\n onChange: (value: string) => void;\n sipAutoComplete?: string;\n countries?: CountryCode[];\n disabled?: boolean;\n name?: string;\n 'aria-label'?: string;\n autoFocus?: boolean;\n placeholder?: string;\n}\n\nexport function SipInput({\n disabled,\n countries,\n name,\n 'aria-label': ariaLabel,\n autoFocus,\n placeholder,\n sipAutoComplete = 'on',\n}: SipInputProps) {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [phoneBookElement, setPhoneBookElement] =\n React.useState<HTMLButtonElement | null>(null);\n const isPhoneBookOpen = phoneBookElement != null;\n\n const {\n phoneBook: phoneBookOptions,\n setValue,\n setCountry,\n ariaPhoneBookButtonLabel,\n sipAddress,\n setSipAddress,\n focusNumberInput,\n setFocusNumberInput,\n } = usePhoneContext();\n\n const showPhoneBook = phoneBookOptions.length > 0;\n\n function togglePhoneBook(e: React.MouseEvent<HTMLButtonElement>) {\n if (isPhoneBookOpen) {\n setPhoneBookElement(null);\n } else {\n setPhoneBookElement(e.currentTarget);\n }\n }\n\n function closePhoneBook() {\n setPhoneBookElement(null);\n }\n\n function handlePhoneBookOptionSelect(value: string) {\n closePhoneBook();\n setFocusNumberInput(true);\n setValue(value);\n }\n\n const options: CountryOption[] =\n countries?.map(country => ({\n value: country,\n label: country,\n })) || [];\n\n function selectCountry(countryCode?: string) {\n if (countryCode !== 'SIP') {\n setSipAddress(sipAddress);\n setFocusNumberInput(true);\n setValue('');\n setCountry((countryCode as CountryCode) || 'US');\n }\n }\n\n function updateSipValue(value: string) {\n setSipAddress(value);\n setValue(`sip:${value}`);\n }\n\n useLayoutEffect(() => {\n const input = inputRef.current;\n\n if (input == null || !focusNumberInput) {\n return;\n }\n\n requestAnimationFrame(() => {\n if (input.value.length > 0) {\n input.select();\n } else {\n input.focus();\n }\n });\n }, [focusNumberInput]);\n\n return (\n <>\n <ControlSet>\n <PhoneNumberCountrySelectAdapter\n value=\"SIP\"\n onChange={selectCountry}\n options={options}\n disabled={disabled}\n />\n <Input\n ref={inputRef}\n value={sipAddress}\n disabled={disabled}\n onChange={updateSipValue}\n name={name}\n aria-label={ariaLabel}\n autoFocus={autoFocus}\n placeholder={placeholder}\n autoComplete={sipAutoComplete}\n />\n {showPhoneBook && (\n <Button\n disabled={disabled}\n className={clsx('tcn-control-set-item', 'tcn-phone-number-phone-book')}\n aria-label={ariaPhoneBookButtonLabel}\n onClick={togglePhoneBook}\n size=\"md\"\n >\n <NotebookIcon size=\"md\" />\n </Button>\n )}\n </ControlSet>\n <SuggestionList\n open={isPhoneBookOpen}\n anchorElement={phoneBookElement}\n onOptionSelect={handlePhoneBookOptionSelect}\n onClose={closePhoneBook}\n width=\"300px\"\n noSuggestionMessage=\"No phone numbers found\"\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n >\n {phoneBookOptions}\n </SuggestionList>\n </>\n );\n}\n"],"names":["SipInput","disabled","countries","name","ariaLabel","autoFocus","placeholder","sipAutoComplete","inputRef","React","phoneBookElement","setPhoneBookElement","isPhoneBookOpen","phoneBookOptions","setValue","setCountry","ariaPhoneBookButtonLabel","sipAddress","setSipAddress","focusNumberInput","setFocusNumberInput","usePhoneContext","showPhoneBook","togglePhoneBook","e","closePhoneBook","handlePhoneBookOptionSelect","value","options","country","selectCountry","countryCode","updateSipValue","useLayoutEffect","input","jsxs","Fragment","ControlSet","jsx","PhoneNumberCountrySelectAdapter","Input","Button","clsx","NotebookIcon","SuggestionList"],"mappings":"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"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as G, Fragment as H, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import "../../utils/click_away_listener.js";
|
|
3
|
-
import "../../utils/focus_redirect.js";
|
|
4
|
-
import "../../utils/scroll_away_listener.js";
|
|
2
|
+
import "../../utils/listeners/click_away_listener.js";
|
|
3
|
+
import "../../utils/listeners/focus_redirect.js";
|
|
4
|
+
import "../../utils/listeners/scroll_away_listener.js";
|
|
5
5
|
import F, { useRef as c, useState as w } from "react";
|
|
6
6
|
import { useForkRef as J } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import "../../utils/
|
|
8
|
+
import "../../utils/hooks/labelled_by_context.js";
|
|
9
|
+
import "../../utils/decorators/draggable/context.js";
|
|
9
10
|
import { clsx as L } from "clsx";
|
|
10
|
-
import "../../draggable.module-
|
|
11
|
-
import "../../utils/
|
|
12
|
-
import "../../resizable.module-
|
|
13
|
-
import "../../utils/
|
|
11
|
+
import "../../draggable.module-DFYR5n3n.js";
|
|
12
|
+
import "../../utils/decorators/resizable/context.js";
|
|
13
|
+
import "../../resizable.module-ur5FBfxo.js";
|
|
14
|
+
import "../../utils/decorators/resizable/resize_handle.js";
|
|
14
15
|
import { SuggestionList as Q } from "../suggestions/suggestion_list.js";
|
|
15
16
|
import "../../actions/button/base_button/base_button.js";
|
|
16
17
|
import "../../actions/button/button_group/button_group.js";
|
|
17
|
-
import "../../actions/button/slim_button/slim_button.js";
|
|
18
18
|
import { Button as W } from "../../actions/button/button/button.js";
|
|
19
19
|
import "../../actions/toggle/toggle.js";
|
|
20
20
|
import '../../select.css';const X = "_select_aabe288", Y = "_selectedLabel_b92ff3e", O = { select: X, selectedLabel: Y };
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as m } from "clsx";
|
|
3
3
|
import g, { useRef as v, useLayoutEffect as y } from "react";
|
|
4
|
-
import "../../utils/click_away_listener.js";
|
|
5
|
-
import "../../utils/focus_redirect.js";
|
|
6
|
-
import "../../utils/scroll_away_listener.js";
|
|
4
|
+
import "../../utils/listeners/click_away_listener.js";
|
|
5
|
+
import "../../utils/listeners/focus_redirect.js";
|
|
6
|
+
import "../../utils/listeners/scroll_away_listener.js";
|
|
7
7
|
import { useForkRef as R } from "../../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
9
|
-
import "../../utils/
|
|
10
|
-
import "../../draggable.
|
|
11
|
-
import "../../
|
|
12
|
-
import "../../resizable.
|
|
13
|
-
import "../../
|
|
14
|
-
import
|
|
9
|
+
import "../../utils/hooks/labelled_by_context.js";
|
|
10
|
+
import "../../utils/decorators/draggable/context.js";
|
|
11
|
+
import "../../draggable.module-DFYR5n3n.js";
|
|
12
|
+
import "../../utils/decorators/resizable/context.js";
|
|
13
|
+
import "../../resizable.module-ur5FBfxo.js";
|
|
14
|
+
import "../../utils/decorators/resizable/resize_handle.js";
|
|
15
|
+
import '../../slider.css';const S = "_slider_eb84151", _ = { slider: S }, B = g.forwardRef(function({ style: l, className: a, width: p, min: e = 0, max: r = 100, onChange: s, ...i }, u) {
|
|
15
16
|
const n = v(null), c = R(u, n);
|
|
16
17
|
return y(() => {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
18
|
+
const t = n.current;
|
|
19
|
+
if (t == null) return;
|
|
19
20
|
const o = () => {
|
|
20
|
-
const d = (parseFloat(
|
|
21
|
-
|
|
21
|
+
const d = (parseFloat(t.value) - e) / (r - e) * 100;
|
|
22
|
+
t.style.setProperty("--progress", `${d}%`);
|
|
22
23
|
};
|
|
23
|
-
return
|
|
24
|
-
|
|
24
|
+
return t.addEventListener("input", o), o(), () => {
|
|
25
|
+
t.removeEventListener("input", o);
|
|
25
26
|
};
|
|
26
|
-
}, [
|
|
27
|
+
}, [e, r]), /* @__PURE__ */ f(
|
|
27
28
|
"input",
|
|
28
29
|
{
|
|
29
30
|
type: "range",
|
|
30
31
|
className: m(a, _.slider, "tcn-slider"),
|
|
31
32
|
"data-is-disabled": i.disabled || !1,
|
|
32
33
|
ref: c,
|
|
33
|
-
onChange: (
|
|
34
|
-
s && s(
|
|
34
|
+
onChange: (t) => {
|
|
35
|
+
s && s(t.currentTarget.value, t);
|
|
35
36
|
},
|
|
36
37
|
...i,
|
|
37
|
-
min: String(
|
|
38
|
+
min: String(e),
|
|
38
39
|
max: String(r),
|
|
39
40
|
"data-width": "100%",
|
|
40
41
|
style: { width: p, ...l }
|
|
@@ -42,6 +43,6 @@ import '../../slider.css';const S = "_slider_eb84151", _ = { slider: S }, A = g.
|
|
|
42
43
|
);
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
B as Slider
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=slider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sources":["../../../src/inputs/slider/slider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef } from 'react';\nimport { HTMLAttributes } from 'react';\nimport styles from './slider.module.css';\nimport { useForkRef } from '../../utils/index.js';\n\nexport interface SliderProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {\n width?: string;\n disabled?: boolean;\n min?: number;\n max?: number;\n value?: string;\n list?: string;\n onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Slider = React.forwardRef(function Slider(\n { style, className, width, min = 0, max = 100, onChange, ...props }: SliderProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const localRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, localRef);\n\n useLayoutEffect(() => {\n const range = localRef.current;\n if (range == null) return;\n const updateProgress = () => {\n const value = parseFloat(range.value);\n const percent = ((value - min) / (max - min)) * 100;\n range.style.setProperty('--progress', `${percent}%`);\n };\n\n range.addEventListener('input', updateProgress);\n updateProgress();\n\n return () => {\n range.removeEventListener('input', updateProgress);\n };\n }, [min, max]);\n\n return (\n <input\n type=\"range\"\n className={clsx(className, styles.slider, 'tcn-slider')}\n data-is-disabled={props.disabled || false}\n ref={forkedRef}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n min={String(min)}\n max={String(max)}\n data-width=\"100%\"\n style={{ width, ...style }}\n />\n );\n});\n"],"names":["Slider","React","style","className","width","min","max","onChange","props","ref","localRef","useRef","forkedRef","useForkRef","useLayoutEffect","range","updateProgress","percent","jsx","clsx","styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.js","sources":["../../../src/inputs/slider/slider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef } from 'react';\nimport { HTMLAttributes } from 'react';\nimport styles from './slider.module.css';\nimport { useForkRef } from '../../utils/index.js';\n\nexport interface SliderProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {\n width?: string;\n disabled?: boolean;\n min?: number;\n max?: number;\n value?: string;\n list?: string;\n onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Slider = React.forwardRef(function Slider(\n { style, className, width, min = 0, max = 100, onChange, ...props }: SliderProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const localRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, localRef);\n\n useLayoutEffect(() => {\n const range = localRef.current;\n if (range == null) return;\n const updateProgress = () => {\n const value = parseFloat(range.value);\n const percent = ((value - min) / (max - min)) * 100;\n range.style.setProperty('--progress', `${percent}%`);\n };\n\n range.addEventListener('input', updateProgress);\n updateProgress();\n\n return () => {\n range.removeEventListener('input', updateProgress);\n };\n }, [min, max]);\n\n return (\n <input\n type=\"range\"\n className={clsx(className, styles.slider, 'tcn-slider')}\n data-is-disabled={props.disabled || false}\n ref={forkedRef}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n min={String(min)}\n max={String(max)}\n data-width=\"100%\"\n style={{ width, ...style }}\n />\n );\n});\n"],"names":["Slider","React","style","className","width","min","max","onChange","props","ref","localRef","useRef","forkedRef","useForkRef","useLayoutEffect","range","updateProgress","percent","jsx","clsx","styles","e"],"mappings":";;;;;;;;;;;;;;gDAgBaA,IAASC,EAAM,WAAW,SACrC,EAAE,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,KAAAC,IAAM,GAAG,KAAAC,IAAM,KAAK,UAAAC,GAAU,GAAGC,EAAA,GAC5DC,GACA;AACA,QAAMC,IAAWC,EAAyB,IAAI,GACxCC,IAAYC,EAAWJ,GAAKC,CAAQ;AAE1C,SAAAI,EAAgB,MAAM;AACpB,UAAMC,IAAQL,EAAS;AACvB,QAAIK,KAAS,KAAM;AACnB,UAAMC,IAAiB,MAAM;AAE3B,YAAMC,KADQ,WAAWF,EAAM,KAAK,IACVV,MAAQC,IAAMD,KAAQ;AAChD,MAAAU,EAAM,MAAM,YAAY,cAAc,GAAGE,CAAO,GAAG;AAAA,IACrD;AAEA,WAAAF,EAAM,iBAAiB,SAASC,CAAc,GAC9CA,EAAA,GAEO,MAAM;AACX,MAAAD,EAAM,oBAAoB,SAASC,CAAc;AAAA,IACnD;AAAA,EACF,GAAG,CAACX,GAAKC,CAAG,CAAC,GAGX,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAWC,EAAKhB,GAAWiB,EAAO,QAAQ,YAAY;AAAA,MACtD,oBAAkBZ,EAAM,YAAY;AAAA,MACpC,KAAKI;AAAA,MACL,UAAU,CAAAS,MAAK;AACb,QAAAd,KAAYA,EAASc,EAAE,cAAc,OAAOA,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGb;AAAA,MACJ,KAAK,OAAOH,CAAG;AAAA,MACf,KAAK,OAAOC,CAAG;AAAA,MACf,cAAW;AAAA,MACX,OAAO,EAAE,OAAAF,GAAO,GAAGF,EAAA;AAAA,IAAM;AAAA,EAAA;AAG/B,CAAC;"}
|
|
@@ -10,20 +10,20 @@ import { VStack as q } from "../../stacks/v_stack.js";
|
|
|
10
10
|
import { ZStack as ye } from "../../stacks/z_stack.js";
|
|
11
11
|
import { clsx as F } from "clsx";
|
|
12
12
|
import O, { Children as Se, isValidElement as Me, useState as a, useRef as H, useLayoutEffect as m } from "react";
|
|
13
|
-
import "../../utils/click_away_listener.js";
|
|
14
|
-
import { FocusRedirect as Ie } from "../../utils/focus_redirect.js";
|
|
15
|
-
import "../../utils/scroll_away_listener.js";
|
|
13
|
+
import "../../utils/listeners/click_away_listener.js";
|
|
14
|
+
import { FocusRedirect as Ie } from "../../utils/listeners/focus_redirect.js";
|
|
15
|
+
import "../../utils/listeners/scroll_away_listener.js";
|
|
16
16
|
import "../../utils/hooks/use_resize_observer.js";
|
|
17
|
-
import "../../utils/
|
|
18
|
-
import "../../draggable.
|
|
19
|
-
import "../../
|
|
20
|
-
import "../../resizable.
|
|
21
|
-
import "../../
|
|
17
|
+
import "../../utils/hooks/labelled_by_context.js";
|
|
18
|
+
import "../../utils/decorators/draggable/context.js";
|
|
19
|
+
import "../../draggable.module-DFYR5n3n.js";
|
|
20
|
+
import "../../utils/decorators/resizable/context.js";
|
|
21
|
+
import "../../resizable.module-ur5FBfxo.js";
|
|
22
|
+
import "../../utils/decorators/resizable/resize_handle.js";
|
|
22
23
|
import { SuggestionItem as Ce } from "./suggestion_item.js";
|
|
23
24
|
import { Option as Z } from "../options/option.js";
|
|
24
25
|
import "../../actions/button/base_button/base_button.js";
|
|
25
26
|
import "../../actions/button/button_group/button_group.js";
|
|
26
|
-
import "../../actions/button/slim_button/slim_button.js";
|
|
27
27
|
import { Button as Re } from "../../actions/button/button/button.js";
|
|
28
28
|
import "../../actions/toggle/toggle.js";
|
|
29
29
|
import { Popper as ve } from "../../overlay/popper/legacy/popper.js";
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { jsxs as F, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import R, { useState as k, useRef as B } from "react";
|
|
3
|
-
import "../../utils/click_away_listener.js";
|
|
4
|
-
import "../../utils/focus_redirect.js";
|
|
5
|
-
import "../../utils/scroll_away_listener.js";
|
|
3
|
+
import "../../utils/listeners/click_away_listener.js";
|
|
4
|
+
import "../../utils/listeners/focus_redirect.js";
|
|
5
|
+
import "../../utils/listeners/scroll_away_listener.js";
|
|
6
6
|
import { useForkRef as y } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import "../../utils/
|
|
8
|
+
import "../../utils/hooks/labelled_by_context.js";
|
|
9
|
+
import "../../utils/decorators/draggable/context.js";
|
|
9
10
|
import { clsx as s } from "clsx";
|
|
10
|
-
import "../../draggable.module-
|
|
11
|
-
import "../../utils/
|
|
12
|
-
import "../../resizable.module-
|
|
13
|
-
import "../../utils/
|
|
11
|
+
import "../../draggable.module-DFYR5n3n.js";
|
|
12
|
+
import "../../utils/decorators/resizable/context.js";
|
|
13
|
+
import "../../resizable.module-ur5FBfxo.js";
|
|
14
|
+
import "../../utils/decorators/resizable/resize_handle.js";
|
|
14
15
|
import { CheckIcon as S } from "@tcn/icons/check_icon.js";
|
|
15
16
|
import { CrossIcon as N } from "@tcn/icons/cross_icon.js";
|
|
16
|
-
import '../../switch.css';const g = "_switch-wrapper_db1838e", j = "_switch_bf6748b", C = "_switch-icon_d615789", i = { "switch-wrapper": g, switch: j, "switch-icon": C },
|
|
17
|
+
import '../../switch.css';const g = "_switch-wrapper_db1838e", j = "_switch_bf6748b", C = "_switch-icon_d615789", i = { "switch-wrapper": g, switch: j, "switch-icon": C }, U = R.forwardRef(function({
|
|
17
18
|
checked: o,
|
|
18
19
|
backgroundColor: e,
|
|
19
20
|
style: f,
|
|
20
21
|
className: u,
|
|
21
22
|
inputRef: d,
|
|
22
23
|
omitIcons: m = !1,
|
|
23
|
-
onChange:
|
|
24
|
+
onChange: r,
|
|
24
25
|
...t
|
|
25
26
|
}, w) {
|
|
26
|
-
const [h,
|
|
27
|
+
const [h, n] = k(!1), p = B(null), b = y(d, p), a = {};
|
|
27
28
|
function _(c) {
|
|
28
|
-
t.onBlur && t.onBlur(c),
|
|
29
|
+
t.onBlur && t.onBlur(c), n(!1);
|
|
29
30
|
}
|
|
30
31
|
function I(c) {
|
|
31
|
-
t.onFocus && t.onFocus(c),
|
|
32
|
+
t.onFocus && t.onFocus(c), n(!0);
|
|
32
33
|
}
|
|
33
34
|
e != null && (a["--accent-color"] = e);
|
|
34
35
|
const x = o ? S : N;
|
|
@@ -61,7 +62,7 @@ import '../../switch.css';const g = "_switch-wrapper_db1838e", j = "_switch_bf67
|
|
|
61
62
|
checked: o,
|
|
62
63
|
"data-is-disabled": t.disabled || !1,
|
|
63
64
|
onChange: (c) => {
|
|
64
|
-
|
|
65
|
+
r && r(!!c.currentTarget.checked, c);
|
|
65
66
|
},
|
|
66
67
|
...t
|
|
67
68
|
}
|
|
@@ -71,6 +72,6 @@ import '../../switch.css';const g = "_switch-wrapper_db1838e", j = "_switch_bf67
|
|
|
71
72
|
);
|
|
72
73
|
});
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
U as Switch
|
|
75
76
|
};
|
|
76
77
|
//# sourceMappingURL=switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sources":["../../../src/inputs/switch/switch.tsx"],"sourcesContent":["import React, { useRef, useState, HTMLAttributes, ChangeEvent } from 'react';\nimport { useForkRef } from '../../utils/index.js';\nimport { clsx } from 'clsx';\nimport styles from './switch.module.css';\nimport { CheckIcon } from '@tcn/icons/check_icon.js';\nimport { CrossIcon } from '@tcn/icons/cross_icon.js';\n\nexport interface SwitchProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {\n checked?: boolean;\n backgroundColor?: string;\n inputRef?: React.Ref<HTMLInputElement>;\n disabled?: boolean;\n onChange?: (value: boolean, event: ChangeEvent<HTMLInputElement>) => void;\n omitIcons?: boolean;\n}\n\nexport const Switch = React.forwardRef(function Switch(\n {\n checked,\n backgroundColor: onColor,\n style,\n className,\n inputRef,\n omitIcons = false,\n onChange,\n ...props\n }: SwitchProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const [isFocused, setIsFocused] = useState(false);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const forkedInputRef = useForkRef(inputRef, internalInputRef);\n const customStyles: any = {};\n\n function blur(event: React.FocusEvent<HTMLInputElement>) {\n props.onBlur && props.onBlur(event);\n setIsFocused(false);\n }\n\n function focus(event: React.FocusEvent<HTMLInputElement>) {\n props.onFocus && props.onFocus(event);\n setIsFocused(true);\n }\n\n if (onColor != null) {\n customStyles['--accent-color'] = onColor;\n }\n\n const Icon = checked ? CheckIcon : CrossIcon;\n\n return (\n <div\n ref={ref}\n data-focused={isFocused}\n data-is-checked={Boolean(checked)}\n data-is-disabled={props.disabled || false}\n data-width=\"fixed\"\n className={clsx(styles['switch-wrapper'], className, 'tcn-switch-wrapper')}\n >\n {!omitIcons && (\n <Icon\n className={clsx(styles['switch-icon'], 'tcn-switch-icon')}\n data-is-checked={checked}\n />\n )}\n <input\n ref={forkedInputRef}\n type=\"checkbox\"\n className={clsx(styles.switch, 'tcn-switch')}\n onBlur={blur}\n onFocus={focus}\n style={{ ...style, ...customStyles }}\n checked={checked}\n data-is-disabled={props.disabled || false}\n onChange={e => {\n onChange && onChange(Boolean(e.currentTarget.checked), e);\n }}\n {...props}\n />\n </div>\n );\n});\n"],"names":["Switch","React","checked","onColor","style","className","inputRef","omitIcons","onChange","props","ref","isFocused","setIsFocused","useState","internalInputRef","useRef","forkedInputRef","useForkRef","customStyles","blur","event","focus","Icon","CheckIcon","CrossIcon","jsxs","clsx","styles","jsx","e"],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../src/inputs/switch/switch.tsx"],"sourcesContent":["import React, { useRef, useState, HTMLAttributes, ChangeEvent } from 'react';\nimport { useForkRef } from '../../utils/index.js';\nimport { clsx } from 'clsx';\nimport styles from './switch.module.css';\nimport { CheckIcon } from '@tcn/icons/check_icon.js';\nimport { CrossIcon } from '@tcn/icons/cross_icon.js';\n\nexport interface SwitchProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {\n checked?: boolean;\n backgroundColor?: string;\n inputRef?: React.Ref<HTMLInputElement>;\n disabled?: boolean;\n onChange?: (value: boolean, event: ChangeEvent<HTMLInputElement>) => void;\n omitIcons?: boolean;\n}\n\nexport const Switch = React.forwardRef(function Switch(\n {\n checked,\n backgroundColor: onColor,\n style,\n className,\n inputRef,\n omitIcons = false,\n onChange,\n ...props\n }: SwitchProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const [isFocused, setIsFocused] = useState(false);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const forkedInputRef = useForkRef(inputRef, internalInputRef);\n const customStyles: any = {};\n\n function blur(event: React.FocusEvent<HTMLInputElement>) {\n props.onBlur && props.onBlur(event);\n setIsFocused(false);\n }\n\n function focus(event: React.FocusEvent<HTMLInputElement>) {\n props.onFocus && props.onFocus(event);\n setIsFocused(true);\n }\n\n if (onColor != null) {\n customStyles['--accent-color'] = onColor;\n }\n\n const Icon = checked ? CheckIcon : CrossIcon;\n\n return (\n <div\n ref={ref}\n data-focused={isFocused}\n data-is-checked={Boolean(checked)}\n data-is-disabled={props.disabled || false}\n data-width=\"fixed\"\n className={clsx(styles['switch-wrapper'], className, 'tcn-switch-wrapper')}\n >\n {!omitIcons && (\n <Icon\n className={clsx(styles['switch-icon'], 'tcn-switch-icon')}\n data-is-checked={checked}\n />\n )}\n <input\n ref={forkedInputRef}\n type=\"checkbox\"\n className={clsx(styles.switch, 'tcn-switch')}\n onBlur={blur}\n onFocus={focus}\n style={{ ...style, ...customStyles }}\n checked={checked}\n data-is-disabled={props.disabled || false}\n onChange={e => {\n onChange && onChange(Boolean(e.currentTarget.checked), e);\n }}\n {...props}\n />\n </div>\n );\n});\n"],"names":["Switch","React","checked","onColor","style","className","inputRef","omitIcons","onChange","props","ref","isFocused","setIsFocused","useState","internalInputRef","useRef","forkedInputRef","useForkRef","customStyles","blur","event","focus","Icon","CheckIcon","CrossIcon","jsxs","clsx","styles","jsx","e"],"mappings":";;;;;;;;;;;;;;;;kJAgBaA,IAASC,EAAM,WAAW,SACrC;AAAA,EACE,SAAAC;AAAA,EACA,iBAAiBC;AAAA,EACjB,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAmBC,EAAgC,IAAI,GACvDC,IAAiBC,EAAWX,GAAUQ,CAAgB,GACtDI,IAAoB,CAAA;AAE1B,WAASC,EAAKC,GAA2C;AACvD,IAAAX,EAAM,UAAUA,EAAM,OAAOW,CAAK,GAClCR,EAAa,EAAK;AAAA,EACpB;AAEA,WAASS,EAAMD,GAA2C;AACxD,IAAAX,EAAM,WAAWA,EAAM,QAAQW,CAAK,GACpCR,EAAa,EAAI;AAAA,EACnB;AAEA,EAAIT,KAAW,SACbe,EAAa,gBAAgB,IAAIf;AAGnC,QAAMmB,IAAOpB,IAAUqB,IAAYC;AAEnC,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAf;AAAA,MACA,gBAAcC;AAAA,MACd,mBAAiB,EAAQT;AAAA,MACzB,oBAAkBO,EAAM,YAAY;AAAA,MACpC,cAAW;AAAA,MACX,WAAWiB,EAAKC,EAAO,gBAAgB,GAAGtB,GAAW,oBAAoB;AAAA,MAExE,UAAA;AAAA,QAAA,CAACE,KACA,gBAAAqB;AAAA,UAACN;AAAA,UAAA;AAAA,YACC,WAAWI,EAAKC,EAAO,aAAa,GAAG,iBAAiB;AAAA,YACxD,mBAAiBzB;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrB,gBAAA0B;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKZ;AAAA,YACL,MAAK;AAAA,YACL,WAAWU,EAAKC,EAAO,QAAQ,YAAY;AAAA,YAC3C,QAAQR;AAAA,YACR,SAASE;AAAA,YACT,OAAO,EAAE,GAAGjB,GAAO,GAAGc,EAAA;AAAA,YACtB,SAAAhB;AAAA,YACA,oBAAkBO,EAAM,YAAY;AAAA,YACpC,UAAU,CAAAoB,MAAK;AACb,cAAArB,KAAYA,EAAS,EAAQqB,EAAE,cAAc,SAAUA,CAAC;AAAA,YAC1D;AAAA,YACC,GAAGpB;AAAA,UAAA;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsxs as g, jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import y, { useRef as E } from "react";
|
|
3
3
|
import { clsx as o } from "clsx";
|
|
4
|
-
import "../../utils/click_away_listener.js";
|
|
5
|
-
import "../../utils/focus_redirect.js";
|
|
6
|
-
import "../../utils/scroll_away_listener.js";
|
|
4
|
+
import "../../utils/listeners/click_away_listener.js";
|
|
5
|
+
import "../../utils/listeners/focus_redirect.js";
|
|
6
|
+
import "../../utils/listeners/scroll_away_listener.js";
|
|
7
7
|
import { useForkRef as V } from "../../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
9
|
-
import "../../utils/
|
|
10
|
-
import "../../draggable.
|
|
11
|
-
import "../../
|
|
12
|
-
import "../../resizable.
|
|
13
|
-
import "../../
|
|
9
|
+
import "../../utils/hooks/labelled_by_context.js";
|
|
10
|
+
import "../../utils/decorators/draggable/context.js";
|
|
11
|
+
import "../../draggable.module-DFYR5n3n.js";
|
|
12
|
+
import "../../utils/decorators/resizable/context.js";
|
|
13
|
+
import "../../resizable.module-ur5FBfxo.js";
|
|
14
|
+
import "../../utils/decorators/resizable/resize_handle.js";
|
|
14
15
|
import { Input as v } from "../input/input.js";
|
|
15
16
|
import { Select as w } from "../select/select.js";
|
|
16
17
|
import { ControlSet as h } from "../control_set/control_set.js";
|
|
@@ -18,7 +19,7 @@ import '../../unit_input.css';const j = "_unit-input_4bd8bc8", k = "_unit-input-
|
|
|
18
19
|
function U(p) {
|
|
19
20
|
return p.replace(/[^.\d-]/g, "").replace(/(?!^)-/g, "").replace(/(\..*?)\.+/g, "$1");
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
+
const Z = y.forwardRef(function({
|
|
22
23
|
value: A,
|
|
23
24
|
unit: r,
|
|
24
25
|
children: d,
|
|
@@ -83,6 +84,6 @@ const Y = y.forwardRef(function({
|
|
|
83
84
|
);
|
|
84
85
|
});
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
Z as UnitInput
|
|
87
88
|
};
|
|
88
89
|
//# sourceMappingURL=unit_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit_input.js","sources":["../../../src/inputs/unit_input/unit_input.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useForkRef } from '../../utils/index.js';\nimport { type HStackProps } from '../../stacks/h_stack.js';\nimport { Input } from '../input/input.js';\nimport { Select } from '../select/select.js';\nimport { OptionProps } from '../options/option.js';\nimport styles from './unit_input.module.css';\n\nimport { ControlSet } from '../control_set/control_set.js';\n\nfunction getDisplayValue(value: string) {\n return value\n .replace(/[^.\\d-]/g, '') // Remove invalid characters\n .replace(/(?!^)-/g, '') // Ensure `-` only at the start\n .replace(/(\\..*?)\\.+/g, '$1'); // Allow only one dot\n}\n\nexport interface UnitInputProps extends Omit<HStackProps, 'onChange' | 'children'> {\n value?: number | null;\n unit?: string;\n children: React.ReactElement<OptionProps> | React.ReactElement<OptionProps>[];\n onChange?: (value: number | null, unit: string) => void;\n inputRef?: React.Ref<HTMLInputElement>;\n unitRef?: React.Ref<HTMLButtonElement>;\n disabled?: boolean;\n}\n\nexport const UnitInput = React.forwardRef(function UnitInput(\n {\n value,\n unit,\n children,\n onChange,\n inputRef,\n unitRef,\n disabled,\n ...props\n }: UnitInputProps,\n ref: React.Ref<HTMLElement>\n) {\n const internalInputRef = useRef<HTMLInputElement>(null);\n const forkedInputRef = useForkRef(inputRef, internalInputRef);\n\n function valueHandler(value: string, event?: React.ChangeEvent<HTMLInputElement>) {\n if (event == null) {\n return;\n }\n\n const input = event.currentTarget;\n const cursorPosition = input.selectionStart || 0;\n const displayValue = getDisplayValue(value);\n const potentialValue = Number(displayValue);\n\n input.value = displayValue;\n\n if (displayValue.length < value.length) {\n input.setSelectionRange(cursorPosition - 1, cursorPosition - 1);\n }\n\n if (displayValue === '') {\n onChange && onChange(null, unit || '');\n } else if (!isNaN(potentialValue)) {\n onChange && onChange(potentialValue, unit || '');\n }\n }\n\n function unitHandler(unit: string) {\n const input = internalInputRef.current;\n if (input == null) {\n return;\n }\n\n const potentialValue = Number(input.value);\n if (isNaN(potentialValue)) {\n onChange && onChange(null, unit);\n } else {\n onChange && onChange(potentialValue, unit);\n }\n }\n\n return (\n <ControlSet\n ref={ref}\n className={clsx(styles['unit-input'], 'tcn-unit-input')}\n height=\"auto\"\n {...props}\n >\n <Input\n width=\"flex\"\n className={clsx(styles['unit-input-number'], 'tcn-unit-input-number')}\n ref={forkedInputRef}\n onChange={valueHandler}\n disabled={disabled}\n style={{\n borderEndEndRadius: 0,\n borderStartEndRadius: 0,\n textAlign: 'start',\n }}\n />\n\n <Select\n className={clsx(styles['unit-input-select'], 'tcn-unit-input-select')}\n ref={unitRef}\n width=\"auto\"\n value={unit}\n onChange={unitHandler}\n disabled={disabled}\n style={{ borderStartStartRadius: 0, borderEndStartRadius: 0 }}\n >\n {children}\n </Select>\n </ControlSet>\n );\n});\n"],"names":["getDisplayValue","value","UnitInput","React","unit","children","onChange","inputRef","unitRef","disabled","props","ref","internalInputRef","useRef","forkedInputRef","useForkRef","valueHandler","event","input","cursorPosition","displayValue","potentialValue","unitHandler","jsxs","ControlSet","clsx","styles","jsx","Input","Select"],"mappings":"
|
|
1
|
+
{"version":3,"file":"unit_input.js","sources":["../../../src/inputs/unit_input/unit_input.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useForkRef } from '../../utils/index.js';\nimport { type HStackProps } from '../../stacks/h_stack.js';\nimport { Input } from '../input/input.js';\nimport { Select } from '../select/select.js';\nimport { OptionProps } from '../options/option.js';\nimport styles from './unit_input.module.css';\n\nimport { ControlSet } from '../control_set/control_set.js';\n\nfunction getDisplayValue(value: string) {\n return value\n .replace(/[^.\\d-]/g, '') // Remove invalid characters\n .replace(/(?!^)-/g, '') // Ensure `-` only at the start\n .replace(/(\\..*?)\\.+/g, '$1'); // Allow only one dot\n}\n\nexport interface UnitInputProps extends Omit<HStackProps, 'onChange' | 'children'> {\n value?: number | null;\n unit?: string;\n children: React.ReactElement<OptionProps> | React.ReactElement<OptionProps>[];\n onChange?: (value: number | null, unit: string) => void;\n inputRef?: React.Ref<HTMLInputElement>;\n unitRef?: React.Ref<HTMLButtonElement>;\n disabled?: boolean;\n}\n\nexport const UnitInput = React.forwardRef(function UnitInput(\n {\n value,\n unit,\n children,\n onChange,\n inputRef,\n unitRef,\n disabled,\n ...props\n }: UnitInputProps,\n ref: React.Ref<HTMLElement>\n) {\n const internalInputRef = useRef<HTMLInputElement>(null);\n const forkedInputRef = useForkRef(inputRef, internalInputRef);\n\n function valueHandler(value: string, event?: React.ChangeEvent<HTMLInputElement>) {\n if (event == null) {\n return;\n }\n\n const input = event.currentTarget;\n const cursorPosition = input.selectionStart || 0;\n const displayValue = getDisplayValue(value);\n const potentialValue = Number(displayValue);\n\n input.value = displayValue;\n\n if (displayValue.length < value.length) {\n input.setSelectionRange(cursorPosition - 1, cursorPosition - 1);\n }\n\n if (displayValue === '') {\n onChange && onChange(null, unit || '');\n } else if (!isNaN(potentialValue)) {\n onChange && onChange(potentialValue, unit || '');\n }\n }\n\n function unitHandler(unit: string) {\n const input = internalInputRef.current;\n if (input == null) {\n return;\n }\n\n const potentialValue = Number(input.value);\n if (isNaN(potentialValue)) {\n onChange && onChange(null, unit);\n } else {\n onChange && onChange(potentialValue, unit);\n }\n }\n\n return (\n <ControlSet\n ref={ref}\n className={clsx(styles['unit-input'], 'tcn-unit-input')}\n height=\"auto\"\n {...props}\n >\n <Input\n width=\"flex\"\n className={clsx(styles['unit-input-number'], 'tcn-unit-input-number')}\n ref={forkedInputRef}\n onChange={valueHandler}\n disabled={disabled}\n style={{\n borderEndEndRadius: 0,\n borderStartEndRadius: 0,\n textAlign: 'start',\n }}\n />\n\n <Select\n className={clsx(styles['unit-input-select'], 'tcn-unit-input-select')}\n ref={unitRef}\n width=\"auto\"\n value={unit}\n onChange={unitHandler}\n disabled={disabled}\n style={{ borderStartStartRadius: 0, borderEndStartRadius: 0 }}\n >\n {children}\n </Select>\n </ControlSet>\n );\n});\n"],"names":["getDisplayValue","value","UnitInput","React","unit","children","onChange","inputRef","unitRef","disabled","props","ref","internalInputRef","useRef","forkedInputRef","useForkRef","valueHandler","event","input","cursorPosition","displayValue","potentialValue","unitHandler","jsxs","ControlSet","clsx","styles","jsx","Input","Select"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,SAASA,EAAgBC,GAAe;AACtC,SAAOA,EACJ,QAAQ,YAAY,EAAE,EACtB,QAAQ,WAAW,EAAE,EACrB,QAAQ,eAAe,IAAI;AAChC;AAYO,MAAMC,IAAYC,EAAM,WAAW,SACxC;AAAA,EACE,OAAAF;AAAA,EACA,MAAAG;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAmBC,EAAyB,IAAI,GAChDC,IAAiBC,EAAWR,GAAUK,CAAgB;AAE5D,WAASI,EAAaf,GAAegB,GAA6C;AAChF,QAAIA,KAAS;AACX;AAGF,UAAMC,IAAQD,EAAM,eACdE,IAAiBD,EAAM,kBAAkB,GACzCE,IAAepB,EAAgBC,CAAK,GACpCoB,IAAiB,OAAOD,CAAY;AAE1C,IAAAF,EAAM,QAAQE,GAEVA,EAAa,SAASnB,EAAM,UAC9BiB,EAAM,kBAAkBC,IAAiB,GAAGA,IAAiB,CAAC,GAG5DC,MAAiB,KACnBd,KAAYA,EAAS,MAAMF,KAAQ,EAAE,IAC3B,MAAMiB,CAAc,KAC9Bf,KAAYA,EAASe,GAAgBjB,KAAQ,EAAE;AAAA,EAEnD;AAEA,WAASkB,EAAYlB,GAAc;AACjC,UAAMc,IAAQN,EAAiB;AAC/B,QAAIM,KAAS;AACX;AAGF,UAAMG,IAAiB,OAAOH,EAAM,KAAK;AACzC,IAAI,MAAMG,CAAc,IACtBf,KAAYA,EAAS,MAAMF,CAAI,IAE/BE,KAAYA,EAASe,GAAgBjB,CAAI;AAAA,EAE7C;AAEA,SACE,gBAAAmB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAb;AAAA,MACA,WAAWc,EAAKC,EAAO,YAAY,GAAG,gBAAgB;AAAA,MACtD,QAAO;AAAA,MACN,GAAGhB;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,WAAWH,EAAKC,EAAO,mBAAmB,GAAG,uBAAuB;AAAA,YACpE,KAAKZ;AAAA,YACL,UAAUE;AAAA,YACV,UAAAP;AAAA,YACA,OAAO;AAAA,cACL,oBAAoB;AAAA,cACpB,sBAAsB;AAAA,cACtB,WAAW;AAAA,YAAA;AAAA,UACb;AAAA,QAAA;AAAA,QAGF,gBAAAkB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,WAAWJ,EAAKC,EAAO,mBAAmB,GAAG,uBAAuB;AAAA,YACpE,KAAKlB;AAAA,YACL,OAAM;AAAA,YACN,OAAOJ;AAAA,YACP,UAAUkB;AAAA,YACV,UAAAb;AAAA,YACA,OAAO,EAAE,wBAAwB,GAAG,sBAAsB,EAAA;AAAA,YAEzD,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -9,20 +9,21 @@ import { MobileDatePickerYearSelector as j } from "./mobile_date_picker_year_sel
|
|
|
9
9
|
import { MobileButton as n } from "../../actions/button/mobile_button.js";
|
|
10
10
|
import { MobilePortal as x } from "../../portal/mobile_portal.js";
|
|
11
11
|
import { MobileOverlayHeader as O } from "./mobile_overlay_header.js";
|
|
12
|
-
import "../../../utils/click_away_listener.js";
|
|
13
|
-
import { FocusRedirect as q } from "../../../utils/focus_redirect.js";
|
|
14
|
-
import "../../../utils/scroll_away_listener.js";
|
|
12
|
+
import "../../../utils/listeners/click_away_listener.js";
|
|
13
|
+
import { FocusRedirect as q } from "../../../utils/listeners/focus_redirect.js";
|
|
14
|
+
import "../../../utils/listeners/scroll_away_listener.js";
|
|
15
15
|
import "../../../utils/hooks/use_resize_observer.js";
|
|
16
|
-
import "../../../utils/
|
|
16
|
+
import "../../../utils/hooks/labelled_by_context.js";
|
|
17
|
+
import "../../../utils/decorators/draggable/context.js";
|
|
17
18
|
import { clsx as z } from "clsx";
|
|
18
|
-
import "../../../draggable.module-
|
|
19
|
-
import "../../../utils/
|
|
20
|
-
import "../../../resizable.module-
|
|
21
|
-
import "../../../utils/
|
|
19
|
+
import "../../../draggable.module-DFYR5n3n.js";
|
|
20
|
+
import "../../../utils/decorators/resizable/context.js";
|
|
21
|
+
import "../../../resizable.module-ur5FBfxo.js";
|
|
22
|
+
import "../../../utils/decorators/resizable/resize_handle.js";
|
|
22
23
|
import { ChevronLeftIcon as E } from "@tcn/icons/chevron_left_icon.js";
|
|
23
24
|
import { ChevronRightIcon as T } from "@tcn/icons/chevron_right_icon.js";
|
|
24
25
|
import '../../../mobile_date_picker_header.css';const W = "_mobile-date-picker-header_0678759", G = "_mobile-date-picker-overlay_d1d8dc4", J = "_mobile-month-list_1081f6a", Q = "_mobile-year-overlay_daba362", l = { "mobile-date-picker-header": W, "mobile-date-picker-overlay": G, "mobile-month-list": J, "mobile-year-overlay": Q };
|
|
25
|
-
function
|
|
26
|
+
function ke({
|
|
26
27
|
presenter: r,
|
|
27
28
|
countryCode: a,
|
|
28
29
|
selectMonthMessage: R = "Select Month",
|
|
@@ -161,6 +162,6 @@ function ve({
|
|
|
161
162
|
] });
|
|
162
163
|
}
|
|
163
164
|
export {
|
|
164
|
-
|
|
165
|
+
ke as MobileDatePickerHeader
|
|
165
166
|
};
|
|
166
167
|
//# sourceMappingURL=mobile_date_picker_header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile_date_picker_header.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_header.tsx"],"sourcesContent":["import { useSignalValue } from '@tcn/state';\nimport { HStack } from '../../../stacks/h_stack.js';\nimport { VStack } from '../../../stacks/v_stack.js';\nimport { Spacer } from '../../../stacks/spacer.js';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { getMonthsOfYear } from '../../../utils/calendar/get_months_of_year.js';\nimport { DatePickerPresenter } from '../../../inputs/date_picker/date_picker_presenter.js';\nimport { MobileDatePickerYearSelector } from './mobile_date_picker_year_selector.js';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { MobilePortal } from '../../portal/mobile_portal.js';\nimport { MobileOverlayHeader } from './mobile_overlay_header.js';\nimport { FocusRedirect } from '../../../utils/index.js';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { clsx } from 'clsx';\nimport styles from './mobile_date_picker_header.module.css';\n\nexport interface MobileDatePickerHeaderProps {\n presenter: DatePickerPresenter;\n countryCode: string;\n selectMonthMessage?: string;\n selectYearMessage?: string;\n}\n\nexport function MobileDatePickerHeader({\n presenter,\n countryCode,\n selectMonthMessage = 'Select Month',\n selectYearMessage = 'Select Year',\n}: MobileDatePickerHeaderProps) {\n const state = useSignalValue(presenter.stateBroadcast);\n const [monthOpen, setMonthOpen] = useState(false);\n const [yearOpen, setYearOpen] = useState(false);\n const monthButtonRef = useRef<HTMLButtonElement | null>(null);\n const yearButtonRef = useRef<HTMLButtonElement | null>(null);\n const monthListRef = useRef<HTMLDivElement | null>(null);\n\n const longMonths = useMemo(() => getMonthsOfYear(countryCode, 'long'), [countryCode]);\n const shortMonths = useMemo(() => getMonthsOfYear(countryCode, 'short'), [countryCode]);\n\n function selectMonth(value: string) {\n presenter.setVisibleMonth(Number(value));\n }\n\n function previous() {\n presenter.setVisibleMonth(state.visibleMonth - 1);\n }\n\n function next() {\n presenter.setVisibleMonth(state.visibleMonth + 1);\n }\n\n function openMonths() {\n setMonthOpen(true);\n }\n\n function closeMonths() {\n setMonthOpen(false);\n requestAnimationFrame(() => monthButtonRef.current?.focus());\n }\n\n function openYears() {\n setYearOpen(true);\n }\n\n function closeYears() {\n setYearOpen(false);\n requestAnimationFrame(() => yearButtonRef.current?.focus());\n }\n\n function handleMonthKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeMonths();\n }\n }\n\n function handleYearKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeYears();\n }\n }\n\n function handleMonthRedirect() {\n monthListRef.current?.focus();\n }\n\n return (\n <>\n <HStack\n className={clsx(\n styles['mobile-date-picker-header'],\n 'tcn-mobile-date-picker-header'\n )}\n minWidth=\"35px\"\n width=\"100%\"\n >\n <MobileButton\n disabled={!state.canNavigateToPreviousMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={previous}\n >\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </MobileButton>\n <Spacer />\n <HStack hAlign=\"center\" gap=\"4px\" width=\"auto\">\n <MobileButton\n ref={monthButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openMonths}\n >\n {shortMonths[state.visibleMonth]}\n </MobileButton>\n <MobileButton\n ref={yearButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openYears}\n >\n {String(state.visibleYear)}\n </MobileButton>\n </HStack>\n <Spacer />\n <MobileButton\n disabled={!state.canNavigateToNextMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={next}\n >\n <ChevronRightIcon flipOnRtl size=\"md\" />\n </MobileButton>\n </HStack>\n\n {monthOpen && (\n <MobilePortal>\n <VStack\n className={styles['mobile-date-picker-overlay']}\n onKeyDown={handleMonthKeyDown}\n >\n <MobileOverlayHeader title={selectMonthMessage} onClose={closeMonths} />\n <VStack\n ref={monthListRef}\n tabIndex={0}\n padding=\"16px\"\n gap=\"8px\"\n height=\"flex\"\n overflowY=\"auto\"\n className={styles['mobile-month-list']}\n >\n {longMonths.map((month, index) => (\n <MobileButton\n key={index}\n hierarchy={index === state.visibleMonth ? 'primary' : 'secondary'}\n width=\"100%\"\n onClick={() => {\n selectMonth(String(index));\n closeMonths();\n }}\n >\n {month}\n </MobileButton>\n ))}\n <FocusRedirect onRedirect={handleMonthRedirect} />\n </VStack>\n </VStack>\n </MobilePortal>\n )}\n\n {yearOpen && (\n <MobilePortal>\n <VStack className={styles['mobile-year-overlay']} onKeyDown={handleYearKeyDown}>\n <MobileOverlayHeader title={selectYearMessage} onClose={closeYears} />\n <MobileDatePickerYearSelector presenter={presenter} onClose={closeYears} />\n </VStack>\n </MobilePortal>\n )}\n </>\n );\n}\n"],"names":["MobileDatePickerHeader","presenter","countryCode","selectMonthMessage","selectYearMessage","state","useSignalValue","monthOpen","setMonthOpen","useState","yearOpen","setYearOpen","monthButtonRef","useRef","yearButtonRef","monthListRef","longMonths","useMemo","getMonthsOfYear","shortMonths","selectMonth","value","previous","next","openMonths","closeMonths","openYears","closeYears","handleMonthKeyDown","event","handleYearKeyDown","handleMonthRedirect","jsxs","Fragment","HStack","clsx","styles","jsx","MobileButton","ChevronLeftIcon","Spacer","ChevronRightIcon","MobilePortal","VStack","MobileOverlayHeader","month","index","FocusRedirect","MobileDatePickerYearSelector"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_header.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_header.tsx"],"sourcesContent":["import { useSignalValue } from '@tcn/state';\nimport { HStack } from '../../../stacks/h_stack.js';\nimport { VStack } from '../../../stacks/v_stack.js';\nimport { Spacer } from '../../../stacks/spacer.js';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { getMonthsOfYear } from '../../../utils/calendar/get_months_of_year.js';\nimport { DatePickerPresenter } from '../../../inputs/date_picker/date_picker_presenter.js';\nimport { MobileDatePickerYearSelector } from './mobile_date_picker_year_selector.js';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { MobilePortal } from '../../portal/mobile_portal.js';\nimport { MobileOverlayHeader } from './mobile_overlay_header.js';\nimport { FocusRedirect } from '../../../utils/index.js';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { clsx } from 'clsx';\nimport styles from './mobile_date_picker_header.module.css';\n\nexport interface MobileDatePickerHeaderProps {\n presenter: DatePickerPresenter;\n countryCode: string;\n selectMonthMessage?: string;\n selectYearMessage?: string;\n}\n\nexport function MobileDatePickerHeader({\n presenter,\n countryCode,\n selectMonthMessage = 'Select Month',\n selectYearMessage = 'Select Year',\n}: MobileDatePickerHeaderProps) {\n const state = useSignalValue(presenter.stateBroadcast);\n const [monthOpen, setMonthOpen] = useState(false);\n const [yearOpen, setYearOpen] = useState(false);\n const monthButtonRef = useRef<HTMLButtonElement | null>(null);\n const yearButtonRef = useRef<HTMLButtonElement | null>(null);\n const monthListRef = useRef<HTMLDivElement | null>(null);\n\n const longMonths = useMemo(() => getMonthsOfYear(countryCode, 'long'), [countryCode]);\n const shortMonths = useMemo(() => getMonthsOfYear(countryCode, 'short'), [countryCode]);\n\n function selectMonth(value: string) {\n presenter.setVisibleMonth(Number(value));\n }\n\n function previous() {\n presenter.setVisibleMonth(state.visibleMonth - 1);\n }\n\n function next() {\n presenter.setVisibleMonth(state.visibleMonth + 1);\n }\n\n function openMonths() {\n setMonthOpen(true);\n }\n\n function closeMonths() {\n setMonthOpen(false);\n requestAnimationFrame(() => monthButtonRef.current?.focus());\n }\n\n function openYears() {\n setYearOpen(true);\n }\n\n function closeYears() {\n setYearOpen(false);\n requestAnimationFrame(() => yearButtonRef.current?.focus());\n }\n\n function handleMonthKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeMonths();\n }\n }\n\n function handleYearKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeYears();\n }\n }\n\n function handleMonthRedirect() {\n monthListRef.current?.focus();\n }\n\n return (\n <>\n <HStack\n className={clsx(\n styles['mobile-date-picker-header'],\n 'tcn-mobile-date-picker-header'\n )}\n minWidth=\"35px\"\n width=\"100%\"\n >\n <MobileButton\n disabled={!state.canNavigateToPreviousMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={previous}\n >\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </MobileButton>\n <Spacer />\n <HStack hAlign=\"center\" gap=\"4px\" width=\"auto\">\n <MobileButton\n ref={monthButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openMonths}\n >\n {shortMonths[state.visibleMonth]}\n </MobileButton>\n <MobileButton\n ref={yearButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openYears}\n >\n {String(state.visibleYear)}\n </MobileButton>\n </HStack>\n <Spacer />\n <MobileButton\n disabled={!state.canNavigateToNextMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={next}\n >\n <ChevronRightIcon flipOnRtl size=\"md\" />\n </MobileButton>\n </HStack>\n\n {monthOpen && (\n <MobilePortal>\n <VStack\n className={styles['mobile-date-picker-overlay']}\n onKeyDown={handleMonthKeyDown}\n >\n <MobileOverlayHeader title={selectMonthMessage} onClose={closeMonths} />\n <VStack\n ref={monthListRef}\n tabIndex={0}\n padding=\"16px\"\n gap=\"8px\"\n height=\"flex\"\n overflowY=\"auto\"\n className={styles['mobile-month-list']}\n >\n {longMonths.map((month, index) => (\n <MobileButton\n key={index}\n hierarchy={index === state.visibleMonth ? 'primary' : 'secondary'}\n width=\"100%\"\n onClick={() => {\n selectMonth(String(index));\n closeMonths();\n }}\n >\n {month}\n </MobileButton>\n ))}\n <FocusRedirect onRedirect={handleMonthRedirect} />\n </VStack>\n </VStack>\n </MobilePortal>\n )}\n\n {yearOpen && (\n <MobilePortal>\n <VStack className={styles['mobile-year-overlay']} onKeyDown={handleYearKeyDown}>\n <MobileOverlayHeader title={selectYearMessage} onClose={closeYears} />\n <MobileDatePickerYearSelector presenter={presenter} onClose={closeYears} />\n </VStack>\n </MobilePortal>\n )}\n </>\n );\n}\n"],"names":["MobileDatePickerHeader","presenter","countryCode","selectMonthMessage","selectYearMessage","state","useSignalValue","monthOpen","setMonthOpen","useState","yearOpen","setYearOpen","monthButtonRef","useRef","yearButtonRef","monthListRef","longMonths","useMemo","getMonthsOfYear","shortMonths","selectMonth","value","previous","next","openMonths","closeMonths","openYears","closeYears","handleMonthKeyDown","event","handleYearKeyDown","handleMonthRedirect","jsxs","Fragment","HStack","clsx","styles","jsx","MobileButton","ChevronLeftIcon","Spacer","ChevronRightIcon","MobilePortal","VStack","MobileOverlayHeader","month","index","FocusRedirect","MobileDatePickerYearSelector"],"mappings":"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"}
|