@tcn/ui 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/button/base_button/base_button.js +8 -8
- package/dist/actions/button/base_button/base_button.js.map +1 -1
- package/dist/actions/button/button/button.js +5 -5
- package/dist/actions/button/button/button.js.map +1 -1
- package/dist/actions/button/button_group/button_group.d.ts.map +1 -1
- package/dist/actions/button/button_group/button_group.js +2 -5
- package/dist/actions/button/button_group/button_group.js.map +1 -1
- package/dist/actions/button/select_group/select_group.js +7 -7
- package/dist/actions/button/select_group/select_group.js.map +1 -1
- package/dist/actions/button/slim_button/slim_button.d.ts.map +1 -1
- package/dist/actions/button/slim_button/slim_button.js +4 -4
- package/dist/actions/button/slim_button/slim_button.js.map +1 -1
- package/dist/feedback/progress/progress_bar.js +1 -1
- package/dist/form/field/common/field_control/field_control.js +6 -6
- package/dist/form/field/common/field_control/field_control.js.map +1 -1
- package/dist/form/field/common/field_description.js +1 -1
- package/dist/form/field/common/field_error.js +3 -4
- package/dist/form/field/common/field_error.js.map +1 -1
- package/dist/form/field/common/field_header.js +8 -8
- package/dist/form/field/common/field_header.js.map +1 -1
- package/dist/form/field/common/field_label.js +1 -1
- package/dist/form/field/common/status_input/status_input.d.ts.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +9 -15
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/form/field/h_field/h_field.js +9 -9
- package/dist/form/field/h_field/h_field.js.map +1 -1
- package/dist/form/field/v_field/v_field.js +8 -8
- package/dist/form/field/v_field/v_field.js.map +1 -1
- package/dist/form/field_set/field_set.d.ts.map +1 -1
- package/dist/form/field_set/field_set.js +12 -19
- package/dist/form/field_set/field_set.js.map +1 -1
- package/dist/inputs/checkbox/checkbox.js +12 -12
- package/dist/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/inputs/color_input/color_input.d.ts.map +1 -1
- package/dist/inputs/color_input/color_input.js +13 -17
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +6 -6
- package/dist/inputs/color_input/color_picker.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +15 -15
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/date_picker/date_picker.js +6 -6
- package/dist/inputs/date_picker/date_picker.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_date.js +13 -13
- package/dist/inputs/date_picker/date_picker_date.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_day.js +1 -1
- package/dist/inputs/date_picker/date_picker_header.js +24 -24
- package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +19 -19
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_time_selector.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_time_selector.js +6 -9
- package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +3 -3
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +18 -24
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/input/input.js +4 -4
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/multi_combo_box/multi_combo_box.js +1 -1
- package/dist/inputs/multi_combo_box/multi_combo_box.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +8 -8
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +28 -31
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/radio/radio.js +14 -14
- package/dist/inputs/radio/radio.js.map +1 -1
- package/dist/inputs/select/select.js +16 -16
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/slider/slider.js +7 -7
- package/dist/inputs/slider/slider.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_item.js +3 -3
- package/dist/inputs/suggestions/suggestion_item.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +8 -8
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/switch/switch.js +14 -14
- package/dist/inputs/switch/switch.js.map +1 -1
- package/dist/inputs/textarea/textarea.js +6 -6
- package/dist/inputs/textarea/textarea.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +5 -5
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/layouts/body/h_body.js +10 -10
- package/dist/layouts/body/h_body.js.map +1 -1
- package/dist/layouts/body/v_body.js +8 -8
- package/dist/layouts/body/v_body.js.map +1 -1
- package/dist/layouts/column/column.js +16 -16
- package/dist/layouts/column/column.js.map +1 -1
- package/dist/layouts/divider/divider.js +9 -9
- package/dist/layouts/divider/divider.js.map +1 -1
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/footer/footer.js.map +1 -1
- package/dist/layouts/grid/grid.d.ts.map +1 -1
- package/dist/layouts/grid/grid.js +22 -31
- package/dist/layouts/grid/grid.js.map +1 -1
- package/dist/layouts/header/header.js +11 -11
- package/dist/layouts/header/header.js.map +1 -1
- package/dist/layouts/list/item.js +6 -6
- package/dist/layouts/list/item.js.map +1 -1
- package/dist/layouts/list/list.js +6 -6
- package/dist/layouts/list/list.js.map +1 -1
- package/dist/layouts/sidebar_end/sidebar_end.js +15 -15
- package/dist/layouts/sidebar_end/sidebar_end.js.map +1 -1
- package/dist/layouts/sidebar_start/sidebar_start.js +16 -16
- package/dist/layouts/sidebar_start/sidebar_start.js.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.js +14 -14
- package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
- package/dist/modal.css +1 -1
- package/dist/overlay/menu/menu.js +8 -8
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/tooltip/tooltip.js +10 -10
- package/dist/overlay/tooltip/tooltip.js.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js +9 -9
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.js +42 -42
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +6 -6
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.js +3 -3
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.js +8 -8
- package/dist/stacks/box/right_resize_handle.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/top_resize_handle.js +8 -8
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/h_collapsible_box.js +5 -5
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/h_stack.js +26 -26
- package/dist/stacks/h_stack.js.map +1 -1
- package/dist/stacks/spacer.js +5 -5
- package/dist/stacks/spacer.js.map +1 -1
- package/dist/stacks/story_components/circle.js +6 -6
- package/dist/stacks/story_components/circle.js.map +1 -1
- package/dist/stacks/story_components/picture_placeholder.js +8 -8
- package/dist/stacks/story_components/picture_placeholder.js.map +1 -1
- package/dist/stacks/story_components/rect.js +11 -11
- package/dist/stacks/story_components/rect.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +8 -8
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/stacks/v_stack.js +35 -35
- package/dist/stacks/v_stack.js.map +1 -1
- package/dist/stacks/z_stack.js +34 -34
- package/dist/stacks/z_stack.js.map +1 -1
- package/dist/surfaces/alert/alert.js +8 -8
- package/dist/surfaces/alert/alert.js.map +1 -1
- package/dist/surfaces/card/card.js +8 -8
- package/dist/surfaces/card/card.js.map +1 -1
- package/dist/surfaces/confirm/confirm.d.ts.map +1 -1
- package/dist/surfaces/confirm/confirm.js +13 -20
- package/dist/surfaces/confirm/confirm.js.map +1 -1
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js +5 -5
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js.map +1 -1
- package/dist/surfaces/drawers/drawer_end/drawer_end.js +8 -8
- package/dist/surfaces/drawers/drawer_end/drawer_end.js.map +1 -1
- package/dist/surfaces/drawers/drawer_start/drawer_start.js +4 -4
- package/dist/surfaces/drawers/drawer_start/drawer_start.js.map +1 -1
- package/dist/surfaces/drawers/drawer_top/drawer_top.js +4 -4
- package/dist/surfaces/drawers/drawer_top/drawer_top.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +2 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +16 -7
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/page/h_page.js +6 -6
- package/dist/surfaces/page/h_page.js.map +1 -1
- package/dist/surfaces/page/v_page.js +9 -9
- package/dist/surfaces/page/v_page.js.map +1 -1
- package/dist/surfaces/panel/h_panel.d.ts.map +1 -1
- package/dist/surfaces/panel/h_panel.js +18 -24
- package/dist/surfaces/panel/h_panel.js.map +1 -1
- package/dist/surfaces/panel/v_panel.js +9 -9
- package/dist/surfaces/panel/v_panel.js.map +1 -1
- package/dist/surfaces/popover/popover.js +34 -34
- package/dist/surfaces/popover/popover.js.map +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +6 -14
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/index.d.ts +0 -2
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +5 -266
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/tokens/badge/badge.js +13 -13
- package/dist/tokens/badge/badge.js.map +1 -1
- package/dist/tokens/bubble/bubble.js +16 -17
- package/dist/tokens/bubble/bubble.js.map +1 -1
- package/dist/tokens/chip/chip.js +10 -11
- package/dist/tokens/chip/chip.js.map +1 -1
- package/dist/typography/body_text/body_text.js +21 -21
- package/dist/typography/body_text/body_text.js.map +1 -1
- package/dist/typography/callout/callout.js +16 -16
- package/dist/typography/callout/callout.js.map +1 -1
- package/dist/typography/caption/caption.js +13 -13
- package/dist/typography/caption/caption.js.map +1 -1
- package/dist/typography/footnote/footnote.js +14 -14
- package/dist/typography/footnote/footnote.js.map +1 -1
- package/dist/typography/headline/headline.js +12 -12
- package/dist/typography/headline/headline.js.map +1 -1
- package/dist/typography/subheadline/subheadline.js +13 -13
- package/dist/typography/subheadline/subheadline.js.map +1 -1
- package/dist/typography/title/title.js +22 -22
- package/dist/typography/title/title.js.map +1 -1
- package/package.json +21 -2
- package/src/actions/button/__stories__/button.stories.tsx +1 -1
- package/src/actions/button/__stories__/button_group.stories.tsx +1 -1
- package/src/actions/button/__stories__/select_group.stories.tsx +1 -1
- package/src/actions/button/__stories__/slim_button.stories.tsx +1 -1
- package/src/actions/button/base_button/base_button.tsx +2 -2
- package/src/actions/button/button/button.tsx +3 -3
- package/src/actions/button/button_group/button_group.tsx +4 -7
- package/src/actions/button/select_group/select_group.tsx +3 -3
- package/src/actions/button/slim_button/slim_button.tsx +3 -2
- package/src/feedback/lazy/lazy.stories.tsx +1 -1
- package/src/feedback/loading/__storybook__/loading.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/form/field/common/field_control/field_control.tsx +2 -2
- package/src/form/field/common/field_header.tsx +2 -2
- package/src/form/field/common/status_input/status_input.tsx +3 -6
- package/src/form/field/field.stories.tsx +2 -1
- package/src/form/field/h_field/h_field.stories.tsx +10 -1
- package/src/form/field/h_field/h_field.tsx +2 -2
- package/src/form/field/v_field/v_field.stories.tsx +10 -1
- package/src/form/field/v_field/v_field.tsx +2 -2
- package/src/form/field_set/field_set.stories.tsx +9 -1
- package/src/form/field_set/field_set.tsx +4 -7
- package/src/inputs/checkbox/checkbox.stories.tsx +9 -1
- package/src/inputs/checkbox/checkbox.tsx +2 -2
- package/src/inputs/color_input/color_input.stories.tsx +9 -1
- package/src/inputs/color_input/color_input.tsx +2 -6
- package/src/inputs/color_input/color_picker.tsx +2 -2
- package/src/inputs/combo_box/combo_box.stories.tsx +14 -5
- package/src/inputs/combo_box/combo_box.tsx +2 -2
- package/src/inputs/date_picker/date_picker.stories.tsx +18 -10
- package/src/inputs/date_picker/date_picker.tsx +3 -3
- package/src/inputs/date_picker/date_picker_date.tsx +3 -3
- package/src/inputs/date_picker/date_picker_header.tsx +2 -2
- package/src/inputs/date_picker/date_picker_input.stories.tsx +15 -7
- package/src/inputs/date_picker/date_picker_input.tsx +3 -3
- package/src/inputs/date_picker/date_picker_time_selector.tsx +5 -8
- package/src/inputs/date_picker/date_picker_year_input.tsx +2 -2
- package/src/inputs/date_picker/date_picker_year_selector.tsx +3 -9
- package/src/inputs/input/input.stories.tsx +9 -1
- package/src/inputs/input/input.tsx +2 -2
- package/src/inputs/mask_input/key_capture_input.stories.tsx +9 -1
- package/src/inputs/mask_input/mask_input.stories.tsx +10 -1
- package/src/inputs/multi_combo_box/multi_combo_box.stories.tsx +10 -1
- package/src/inputs/multi_combo_box/multi_combo_box.tsx +2 -2
- package/src/inputs/multiselect/multiselect_values.tsx +2 -2
- package/src/inputs/multiselect/mutliselect.stories.tsx +10 -1
- package/src/inputs/phone_number_input/phone_number_input.stories.tsx +10 -1
- package/src/inputs/phone_number_input/phone_number_input.tsx +6 -9
- package/src/inputs/radio/radio.stories.tsx +14 -6
- package/src/inputs/radio/radio.tsx +2 -2
- package/src/inputs/select/select.stories.tsx +18 -9
- package/src/inputs/select/select.tsx +2 -2
- package/src/inputs/slider/slider.stories.tsx +9 -1
- package/src/inputs/slider/slider.tsx +2 -2
- package/src/inputs/suggestions/suggestion_item.tsx +2 -2
- package/src/inputs/suggestions/suggestion_list.stories.tsx +21 -12
- package/src/inputs/suggestions/suggestion_list.tsx +3 -3
- package/src/inputs/switch/switch.stories.tsx +9 -1
- package/src/inputs/switch/switch.tsx +4 -4
- package/src/inputs/textarea/textarea.stories.tsx +9 -1
- package/src/inputs/textarea/textarea.tsx +2 -2
- package/src/inputs/unit_input/unit_input.stories.tsx +9 -1
- package/src/inputs/unit_input/unit_input.tsx +4 -4
- package/src/layouts/body/h_body.tsx +2 -2
- package/src/layouts/body/v_body.tsx +2 -2
- package/src/layouts/column/column.tsx +3 -3
- package/src/layouts/divider/__stories__/divider.stories.tsx +59 -19
- package/src/layouts/divider/divider.tsx +3 -3
- package/src/layouts/footer/footer.tsx +2 -2
- package/src/layouts/grid/grid.stories.tsx +42 -34
- package/src/layouts/grid/grid.tsx +2 -7
- package/src/layouts/header/header.tsx +2 -2
- package/src/layouts/list/item.tsx +2 -2
- package/src/layouts/list/list.tsx +2 -2
- package/src/layouts/sidebar_end/sidebar_end.tsx +2 -2
- package/src/layouts/sidebar_start/sidebar_start.tsx +2 -2
- package/src/layouts/utility_bar/utility_bar.tsx +2 -2
- package/src/overlay/context_menu/context_menu.stories.tsx +13 -5
- package/src/overlay/menu/menu.stories.tsx +22 -14
- package/src/overlay/menu/menu.tsx +3 -3
- package/src/overlay/popper/popper.stories.tsx +43 -22
- package/src/overlay/portal/portal.stories.tsx +10 -1
- package/src/overlay/tooltip/tooltip.stories.tsx +9 -2
- package/src/overlay/tooltip/tooltip.tsx +2 -2
- package/src/stacks/box/bottom_resize_handle.tsx +2 -2
- package/src/stacks/box/box.tsx +2 -2
- package/src/stacks/box/end_resize_handle.tsx +2 -2
- package/src/stacks/box/left_resize_handle.tsx +2 -2
- package/src/stacks/box/right_resize_handle.tsx +2 -2
- package/src/stacks/box/start_resize_handle.tsx +2 -2
- package/src/stacks/box/top_resize_handle.tsx +2 -2
- package/src/stacks/collapsible_box.stories.tsx +10 -1
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/h_stack.stories.tsx +104 -59
- package/src/stacks/h_stack.tsx +2 -2
- package/src/stacks/spacer.tsx +2 -2
- package/src/stacks/story_components/circle.tsx +2 -2
- package/src/stacks/story_components/picture_placeholder.tsx +2 -2
- package/src/stacks/story_components/rect.tsx +2 -2
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/stacks/v_stack.stories.tsx +91 -10
- package/src/stacks/v_stack.tsx +2 -2
- package/src/stacks/z_stack.stories.tsx +9 -1
- package/src/stacks/z_stack.tsx +2 -2
- package/src/surfaces/alert/alert.stories.tsx +4 -4
- package/src/surfaces/alert/alert.tsx +2 -2
- package/src/surfaces/card/card.tsx +2 -2
- package/src/surfaces/confirm/confirm.stories.tsx +4 -4
- package/src/surfaces/confirm/confirm.tsx +3 -6
- package/src/surfaces/drawers/__stories__/drawers.stories.tsx +1 -1
- package/src/surfaces/drawers/drawer_bottom/drawer_bottom.tsx +2 -2
- package/src/surfaces/drawers/drawer_end/drawer_end.tsx +2 -2
- package/src/surfaces/drawers/drawer_start/drawer_start.tsx +2 -2
- package/src/surfaces/drawers/drawer_top/drawer_top.tsx +2 -2
- package/src/surfaces/modal/__stories__/modal.stories.tsx +54 -0
- package/src/surfaces/modal/modal.module.css +2 -1
- package/src/surfaces/modal/modal.tsx +9 -6
- package/src/surfaces/page/h_page.tsx +2 -2
- package/src/surfaces/page/v_page.tsx +2 -2
- package/src/surfaces/panel/h_panel.tsx +3 -9
- package/src/surfaces/panel/v_panel.tsx +3 -3
- package/src/surfaces/popover/popover.tsx +2 -2
- package/src/surfaces/window/window.stories.tsx +1 -1
- package/src/surfaces/window/window.tsx +2 -6
- package/src/themes/index.ts +0 -2
- package/src/themes/stories/themes.stories.tsx +1 -1
- package/src/themes/themes/ergo/ergo_theme.css +70 -0
- package/src/tokens/badge/badge.stories.tsx +6 -6
- package/src/tokens/badge/badge.tsx +3 -3
- package/src/tokens/bubble/bubble.stories.tsx +16 -9
- package/src/tokens/bubble/bubble.tsx +2 -2
- package/src/tokens/chip/chip.stories.tsx +1 -1
- package/src/tokens/chip/chip.tsx +2 -2
- package/src/typography/body_text/body_text.tsx +2 -2
- package/src/typography/callout/callout.tsx +2 -2
- package/src/typography/caption/caption.tsx +2 -2
- package/src/typography/footnote/footnote.tsx +2 -2
- package/src/typography/headline/headline.tsx +2 -2
- package/src/typography/subheadline/subheadline.tsx +2 -2
- package/src/typography/title/title.tsx +2 -2
- package/src/typography/typography-showcase.stories.tsx +2 -2
- package/src/utils/click_away_listener.stories.tsx +21 -11
- package/src/utils/responsive/responsive_renderer.stories.tsx +7 -7
- package/src/utils/scroll_away_listener.stories.tsx +11 -1
- package/src/surfaces/modal/modal.stories.tsx +0 -15
|
@@ -5,11 +5,19 @@ import { VStack } from '../../stacks/v_stack.js';
|
|
|
5
5
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { useState } from 'react';
|
|
8
|
-
import { ContextMenu } from './context_menu.js';
|
|
8
|
+
import { ContextMenu as ContextMenuComponent } from './context_menu.js';
|
|
9
9
|
import { MenuItem } from '../menu/menu.js';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
title: 'Context Menu',
|
|
12
|
+
title: 'Overlays/Context Menu',
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: 'A context menu component that displays a menu when triggered.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
13
21
|
};
|
|
14
22
|
|
|
15
23
|
function Example() {
|
|
@@ -41,7 +49,7 @@ function Example() {
|
|
|
41
49
|
Right Click Me
|
|
42
50
|
</ZStack>
|
|
43
51
|
|
|
44
|
-
<
|
|
52
|
+
<ContextMenuComponent open={open} position={position} onClose={close}>
|
|
45
53
|
<MenuItem label="Option 1" />
|
|
46
54
|
<MenuItem
|
|
47
55
|
label="Option 2"
|
|
@@ -63,12 +71,12 @@ function Example() {
|
|
|
63
71
|
<MenuItem label="Option 4" />
|
|
64
72
|
</MenuItem>
|
|
65
73
|
</MenuItem>
|
|
66
|
-
</
|
|
74
|
+
</ContextMenuComponent>
|
|
67
75
|
</>
|
|
68
76
|
);
|
|
69
77
|
}
|
|
70
78
|
|
|
71
|
-
export function
|
|
79
|
+
export function ContextMenu() {
|
|
72
80
|
return (
|
|
73
81
|
<VStack height="100%">
|
|
74
82
|
<Example />
|
|
@@ -7,15 +7,23 @@ import { HStack } from '../../stacks/h_stack.js';
|
|
|
7
7
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
8
8
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
9
9
|
import { Checkbox } from '../../inputs/checkbox/checkbox.js';
|
|
10
|
-
import { Menu, MenuItem } from './menu.js';
|
|
10
|
+
import { Menu as MenuComponent, MenuItem } from './menu.js';
|
|
11
11
|
import { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';
|
|
12
12
|
import { Button } from '../../actions/index.js';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: 'Menu',
|
|
15
|
+
title: 'Overlays/Menu',
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: 'A menu component that displays a list of options.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
16
24
|
};
|
|
17
25
|
|
|
18
|
-
export function
|
|
26
|
+
export function Menu() {
|
|
19
27
|
const [isOpen, setIsOpen] = useState(false);
|
|
20
28
|
const [anchorElement, setAnchorElement] = useState<HTMLElement | null>(null);
|
|
21
29
|
const containerRef = useRef<HTMLButtonElement | null>(null);
|
|
@@ -39,8 +47,8 @@ export function Baseline() {
|
|
|
39
47
|
|
|
40
48
|
return (
|
|
41
49
|
<VStack>
|
|
42
|
-
<Button onClick={open}>Open Menu
|
|
43
|
-
<
|
|
50
|
+
<Button onClick={open}>Open Menu</Button>
|
|
51
|
+
<MenuComponent
|
|
44
52
|
veil
|
|
45
53
|
minWidth="150px"
|
|
46
54
|
anchorElement={anchorElement}
|
|
@@ -123,12 +131,12 @@ export function Baseline() {
|
|
|
123
131
|
<MenuItem label="Third" />
|
|
124
132
|
</MenuItem>
|
|
125
133
|
</MenuItem>
|
|
126
|
-
</
|
|
134
|
+
</MenuComponent>
|
|
127
135
|
</VStack>
|
|
128
136
|
);
|
|
129
137
|
}
|
|
130
138
|
|
|
131
|
-
export function
|
|
139
|
+
export function MenuFromTop() {
|
|
132
140
|
const [isOpen, setIsOpen] = useState(false);
|
|
133
141
|
const [anchorElement, setAnchorElement] = useState<HTMLElement | null>(null);
|
|
134
142
|
const containerRef = useRef<HTMLButtonElement | null>(null);
|
|
@@ -152,8 +160,8 @@ export function FromTop() {
|
|
|
152
160
|
|
|
153
161
|
return (
|
|
154
162
|
<VStack>
|
|
155
|
-
<Button onClick={open}>Open Menu
|
|
156
|
-
<
|
|
163
|
+
<Button onClick={open}>Open Menu</Button>
|
|
164
|
+
<MenuComponent
|
|
157
165
|
veil
|
|
158
166
|
anchorElement={anchorElement}
|
|
159
167
|
horizontalAnchor="end"
|
|
@@ -245,12 +253,12 @@ export function FromTop() {
|
|
|
245
253
|
<MenuItem label="Third" />
|
|
246
254
|
</MenuItem>
|
|
247
255
|
</MenuItem>
|
|
248
|
-
</
|
|
256
|
+
</MenuComponent>
|
|
249
257
|
</VStack>
|
|
250
258
|
);
|
|
251
259
|
}
|
|
252
260
|
|
|
253
|
-
export function
|
|
261
|
+
export function MenuFromBottom() {
|
|
254
262
|
const [isOpen, setIsOpen] = useState(false);
|
|
255
263
|
const [anchorElement, setAnchorElement] = useState<HTMLElement | null>(null);
|
|
256
264
|
const containerRef = useRef<HTMLButtonElement | null>(null);
|
|
@@ -275,8 +283,8 @@ export function FromBottom() {
|
|
|
275
283
|
return (
|
|
276
284
|
<VStack height="100%">
|
|
277
285
|
<Spacer />
|
|
278
|
-
<Button onClick={open}>Open Menu
|
|
279
|
-
<
|
|
286
|
+
<Button onClick={open}>Open Menu</Button>
|
|
287
|
+
<MenuComponent
|
|
280
288
|
veil
|
|
281
289
|
anchorElement={anchorElement}
|
|
282
290
|
horizontalAnchor="end"
|
|
@@ -339,7 +347,7 @@ export function FromBottom() {
|
|
|
339
347
|
<MenuItem label="Third" />
|
|
340
348
|
</MenuItem>
|
|
341
349
|
</MenuItem>
|
|
342
|
-
</
|
|
350
|
+
</MenuComponent>
|
|
343
351
|
</VStack>
|
|
344
352
|
);
|
|
345
353
|
}
|
|
@@ -7,7 +7,7 @@ import type { VStackProps } from '../../stacks/v_stack.js';
|
|
|
7
7
|
import { Popper, type PopperProps } from '../../overlay/popper/popper.js';
|
|
8
8
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
9
9
|
import styles from './menu.module.css';
|
|
10
|
-
import
|
|
10
|
+
import { clsx } from 'clsx';
|
|
11
11
|
|
|
12
12
|
export type MenuProps = Omit<PopperProps & VStackProps, 'children'> & {
|
|
13
13
|
children?: React.ReactNode;
|
|
@@ -105,7 +105,7 @@ export const Menu = React.forwardRef(function Menu(
|
|
|
105
105
|
restoreFocus={restoreFocus}
|
|
106
106
|
veil={veil}
|
|
107
107
|
>
|
|
108
|
-
<VStack ref={ref} className={
|
|
108
|
+
<VStack ref={ref} className={clsx(styles.menu, className, 'menu')} {...props}>
|
|
109
109
|
{clonedChildren}
|
|
110
110
|
</VStack>
|
|
111
111
|
</Popper>
|
|
@@ -235,7 +235,7 @@ export const MenuItem = React.forwardRef(function MenuItem(
|
|
|
235
235
|
ref={forkedRef}
|
|
236
236
|
data-is-selected={Boolean(selected)}
|
|
237
237
|
data-has-children={Boolean(hasSubmenu)}
|
|
238
|
-
className={
|
|
238
|
+
className={clsx(className, styles['menu-item'], 'menu-item')}
|
|
239
239
|
data-is-open={open}
|
|
240
240
|
{...props}
|
|
241
241
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-vite';
|
|
2
2
|
import { BodyText } from '../../typography/index.js';
|
|
3
3
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
-
import { Popper, PopperProps } from './popper.js';
|
|
4
|
+
import { Popper as PopperComponent, PopperProps } from './popper.js';
|
|
5
5
|
import { HStack } from '../../stacks/h_stack.js';
|
|
6
6
|
import { StyleBox } from '../../stacks/story_components/style_box.js';
|
|
7
7
|
import { VStack } from '../../stacks/v_stack.js';
|
|
@@ -11,52 +11,73 @@ type PopoverStoryProps = Omit<PopperProps, 'anchorElement' | 'open' | 'onClose'>
|
|
|
11
11
|
clickAwayRefs?: React.RefObject<HTMLElement | null>[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const meta: Meta<typeof
|
|
15
|
-
title: '
|
|
16
|
-
component:
|
|
14
|
+
const meta: Meta<typeof PopperComponent> = {
|
|
15
|
+
title: 'Overlays/Popper',
|
|
16
|
+
component: PopperComponent,
|
|
17
17
|
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: 'A popper component that displays a content in a portal.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
18
25
|
argTypes: {
|
|
19
|
-
children: {
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
children: {
|
|
27
|
+
table: { disable: true },
|
|
28
|
+
description: 'The content to display in the popper.',
|
|
29
|
+
},
|
|
30
|
+
open: { table: { disable: true }, description: 'Whether the popper is open.' },
|
|
31
|
+
onClose: {
|
|
32
|
+
table: { disable: true },
|
|
33
|
+
description: 'The function to call when the popper is closed.',
|
|
34
|
+
},
|
|
22
35
|
verticalAnchor: {
|
|
23
36
|
options: ['top', 'center', 'bottom'],
|
|
24
37
|
control: { type: 'radio' },
|
|
38
|
+
description: 'The anchor to position the popper vertically.',
|
|
25
39
|
},
|
|
26
40
|
horizontalAnchor: {
|
|
27
41
|
options: ['start', 'center', 'end'],
|
|
28
42
|
control: { type: 'radio' },
|
|
43
|
+
description: 'The anchor to position the popper horizontally.',
|
|
29
44
|
},
|
|
30
45
|
verticalOrigin: {
|
|
31
46
|
options: ['top', 'center', 'bottom'],
|
|
32
47
|
control: { type: 'radio' },
|
|
48
|
+
description: 'The origin to position the popper vertically.',
|
|
33
49
|
},
|
|
34
50
|
horizontalOrigin: {
|
|
35
51
|
options: ['start', 'center', 'end'],
|
|
36
52
|
control: { type: 'radio' },
|
|
53
|
+
description: 'The origin to position the popper horizontally.',
|
|
37
54
|
},
|
|
38
55
|
verticalOffset: {
|
|
39
56
|
control: { type: 'number' },
|
|
40
57
|
defaultValue: 0,
|
|
58
|
+
description: 'The offset to position the popper vertically.',
|
|
41
59
|
},
|
|
42
60
|
horizontalOffset: {
|
|
43
61
|
control: { type: 'number' },
|
|
44
62
|
defaultValue: 0,
|
|
63
|
+
description: 'The offset to position the popper horizontally.',
|
|
45
64
|
},
|
|
46
65
|
restoreFocus: {
|
|
47
66
|
control: { type: 'boolean' },
|
|
48
67
|
defaultValue: false,
|
|
68
|
+
description: 'Whether to restore focus when the popper is closed.',
|
|
49
69
|
},
|
|
50
70
|
veil: {
|
|
51
71
|
control: { type: 'boolean' },
|
|
52
72
|
defaultValue: false,
|
|
73
|
+
description: 'Whether to display a veil when the popper is open.',
|
|
53
74
|
},
|
|
54
75
|
},
|
|
55
76
|
};
|
|
56
77
|
|
|
57
78
|
export default meta;
|
|
58
79
|
|
|
59
|
-
export function
|
|
80
|
+
export function Popper(props: PopoverStoryProps) {
|
|
60
81
|
const [isOpen, setIsOpen] = useState(false);
|
|
61
82
|
const [anchorElement, setAnchorElement] = useState<HTMLElement | null>(null);
|
|
62
83
|
|
|
@@ -73,7 +94,7 @@ export function Baseline(props: PopoverStoryProps) {
|
|
|
73
94
|
return (
|
|
74
95
|
<VStack height="100%" width="100%" minHeight="600px" hAlign="center" vAlign="center">
|
|
75
96
|
<button onClick={open}>Open</button>
|
|
76
|
-
<
|
|
97
|
+
<PopperComponent
|
|
77
98
|
anchorElement={anchorElement}
|
|
78
99
|
open={isOpen}
|
|
79
100
|
onClose={close}
|
|
@@ -94,7 +115,7 @@ export function Baseline(props: PopoverStoryProps) {
|
|
|
94
115
|
>
|
|
95
116
|
<BodyText selectable>Hello World</BodyText>
|
|
96
117
|
</StyleBox>
|
|
97
|
-
</
|
|
118
|
+
</PopperComponent>
|
|
98
119
|
</VStack>
|
|
99
120
|
);
|
|
100
121
|
}
|
|
@@ -123,7 +144,7 @@ export function Focus(props: PopoverStoryProps) {
|
|
|
123
144
|
return (
|
|
124
145
|
<VStack height="100%" width="100%" minHeight="600px" hAlign="center" vAlign="center">
|
|
125
146
|
<button onClick={open}>Open</button>
|
|
126
|
-
<
|
|
147
|
+
<PopperComponent
|
|
127
148
|
anchorElement={anchorElement}
|
|
128
149
|
open={isOpen}
|
|
129
150
|
onClose={close}
|
|
@@ -145,7 +166,7 @@ export function Focus(props: PopoverStoryProps) {
|
|
|
145
166
|
>
|
|
146
167
|
<button ref={containerRef}>Hello World</button>
|
|
147
168
|
</StyleBox>
|
|
148
|
-
</
|
|
169
|
+
</PopperComponent>
|
|
149
170
|
</VStack>
|
|
150
171
|
);
|
|
151
172
|
}
|
|
@@ -174,7 +195,7 @@ export function ScrollTest(props: PopoverStoryProps) {
|
|
|
174
195
|
>
|
|
175
196
|
<VStack height="4000px" hAlign="center" vAlign="center">
|
|
176
197
|
<button onClick={open}>Open</button>
|
|
177
|
-
<
|
|
198
|
+
<PopperComponent
|
|
178
199
|
anchorElement={anchorElement}
|
|
179
200
|
open={isOpen}
|
|
180
201
|
onClose={close}
|
|
@@ -195,7 +216,7 @@ export function ScrollTest(props: PopoverStoryProps) {
|
|
|
195
216
|
>
|
|
196
217
|
<BodyText selectable>Hello World</BodyText>
|
|
197
218
|
</StyleBox>
|
|
198
|
-
</
|
|
219
|
+
</PopperComponent>
|
|
199
220
|
</VStack>
|
|
200
221
|
</VStack>
|
|
201
222
|
);
|
|
@@ -225,7 +246,7 @@ export function ScrollWithinPopover(props: PopoverStoryProps) {
|
|
|
225
246
|
>
|
|
226
247
|
<VStack height="4000px" hAlign="center" vAlign="center">
|
|
227
248
|
<button onClick={open}>Open</button>
|
|
228
|
-
<
|
|
249
|
+
<PopperComponent
|
|
229
250
|
anchorElement={anchorElement}
|
|
230
251
|
open={isOpen}
|
|
231
252
|
onClose={close}
|
|
@@ -249,7 +270,7 @@ export function ScrollWithinPopover(props: PopoverStoryProps) {
|
|
|
249
270
|
>
|
|
250
271
|
<ZStack height="1000px">Hello</ZStack>
|
|
251
272
|
</StyleBox>
|
|
252
|
-
</
|
|
273
|
+
</PopperComponent>
|
|
253
274
|
</VStack>
|
|
254
275
|
</VStack>
|
|
255
276
|
);
|
|
@@ -304,7 +325,7 @@ export function ClickAwayRefs(props: PopoverStoryProps) {
|
|
|
304
325
|
Also safe to click
|
|
305
326
|
</div>
|
|
306
327
|
</HStack>
|
|
307
|
-
<
|
|
328
|
+
<PopperComponent
|
|
308
329
|
anchorElement={anchorElement}
|
|
309
330
|
open={isOpen}
|
|
310
331
|
onClose={close}
|
|
@@ -328,7 +349,7 @@ export function ClickAwayRefs(props: PopoverStoryProps) {
|
|
|
328
349
|
Click outside to close, but the gray boxes are safe to click!
|
|
329
350
|
</BodyText>
|
|
330
351
|
</StyleBox>
|
|
331
|
-
</
|
|
352
|
+
</PopperComponent>
|
|
332
353
|
</VStack>
|
|
333
354
|
);
|
|
334
355
|
}
|
|
@@ -353,7 +374,7 @@ export function DisableClickAway(props: PopoverStoryProps) {
|
|
|
353
374
|
<button onClick={open}>Open Popover</button>
|
|
354
375
|
<button onClick={close}>Close Popover</button>
|
|
355
376
|
</HStack>
|
|
356
|
-
<
|
|
377
|
+
<PopperComponent
|
|
357
378
|
anchorElement={anchorElement}
|
|
358
379
|
open={isOpen}
|
|
359
380
|
onClose={close}
|
|
@@ -378,7 +399,7 @@ export function DisableClickAway(props: PopoverStoryProps) {
|
|
|
378
399
|
it.
|
|
379
400
|
</BodyText>
|
|
380
401
|
</StyleBox>
|
|
381
|
-
</
|
|
402
|
+
</PopperComponent>
|
|
382
403
|
</VStack>
|
|
383
404
|
);
|
|
384
405
|
}
|
|
@@ -402,7 +423,7 @@ export function VeilClick(props: PopoverStoryProps) {
|
|
|
402
423
|
<HStack gap="16px">
|
|
403
424
|
<button onClick={open}>Open Popover</button>
|
|
404
425
|
</HStack>
|
|
405
|
-
<
|
|
426
|
+
<PopperComponent
|
|
406
427
|
anchorElement={anchorElement}
|
|
407
428
|
open={isOpen}
|
|
408
429
|
onClose={close}
|
|
@@ -425,7 +446,7 @@ export function VeilClick(props: PopoverStoryProps) {
|
|
|
425
446
|
>
|
|
426
447
|
<BodyText selectable>This popover will close on clicking the veil.</BodyText>
|
|
427
448
|
</StyleBox>
|
|
428
|
-
</
|
|
449
|
+
</PopperComponent>
|
|
429
450
|
</VStack>
|
|
430
451
|
);
|
|
431
452
|
}
|
|
@@ -5,7 +5,16 @@ import { StyleBox } from '../../stacks/story_components/style_box.js';
|
|
|
5
5
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title: 'Portal',
|
|
8
|
+
title: 'Overlays/Portal',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'A baseline generic portal component that can be used to create a portal with click away listener functionality.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
9
18
|
};
|
|
10
19
|
|
|
11
20
|
export function ClickAwayListenerPortal() {
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { Tooltip } from './tooltip.js';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Tooltip',
|
|
4
|
+
title: 'Overlays/Tooltip',
|
|
5
5
|
component: Tooltip,
|
|
6
6
|
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: 'A tooltip component that displays a tooltip when hovered.',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
7
14
|
};
|
|
8
15
|
|
|
9
16
|
export const TooltipStory = () => {
|
|
10
17
|
return (
|
|
11
18
|
<Tooltip>
|
|
12
|
-
<>
|
|
19
|
+
<>TODO: TOOLTIP</>
|
|
13
20
|
</Tooltip>
|
|
14
21
|
);
|
|
15
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VStack, type VStackProps } from '../../stacks/v_stack.js';
|
|
2
|
-
import
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styles from './tooltip.module.css';
|
|
5
5
|
|
|
@@ -15,7 +15,7 @@ export const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(function VPan
|
|
|
15
15
|
<VStack
|
|
16
16
|
ref={ref}
|
|
17
17
|
as="span"
|
|
18
|
-
className={
|
|
18
|
+
className={clsx(className, styles.tooltip, 'tooltip')}
|
|
19
19
|
{...props}
|
|
20
20
|
>
|
|
21
21
|
{children}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './bottom_resize_handle.module.css';
|
|
3
3
|
import { createVerticalResizeHandler } from './resize_handlers.js';
|
|
4
|
-
import
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
5
|
import type { HandleProps } from './handle_props.js';
|
|
6
6
|
|
|
7
7
|
export interface BottomResizeHandleProps {
|
|
@@ -32,7 +32,7 @@ export function BottomResizeHandle({
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div
|
|
35
|
-
className={
|
|
35
|
+
className={clsx(styles['bottom-resize-handle'], 'bottom-resize-handle')}
|
|
36
36
|
onMouseDown={resizeHandler}
|
|
37
37
|
style={bottomResizeHandleStyle}
|
|
38
38
|
>
|
package/src/stacks/box/box.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { BottomResizeHandle } from './bottom_resize_handle.js';
|
|
|
6
6
|
import { EndResizeHandle } from './end_resize_handle.js';
|
|
7
7
|
import { StartResizeHandle } from './start_resize_handle.js';
|
|
8
8
|
import { TopResizeHandle } from './top_resize_handle.js';
|
|
9
|
-
import
|
|
9
|
+
import { clsx } from 'clsx';
|
|
10
10
|
import { isCustomSizeProp } from '../utils/isCustomSizeProp.js';
|
|
11
11
|
import { removeUndefinedProperties } from '../utils/remove_undefined_properties.js';
|
|
12
12
|
import styles from '../stack.module.css';
|
|
@@ -157,7 +157,7 @@ export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
|
|
|
157
157
|
...removeUndefinedProperties(propStyles),
|
|
158
158
|
...style,
|
|
159
159
|
}}
|
|
160
|
-
className={
|
|
160
|
+
className={clsx(
|
|
161
161
|
styles['box'],
|
|
162
162
|
className,
|
|
163
163
|
isFlexing && 'stack-flex',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './end_resize_handle.module.css';
|
|
3
3
|
import { createHorizontalResizeHandler } from './resize_handlers.js';
|
|
4
|
-
import
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
5
|
import type { HandleProps } from './handle_props.js';
|
|
6
6
|
|
|
7
7
|
export interface EndResizeHandleProps {
|
|
@@ -32,7 +32,7 @@ export function EndResizeHandle({
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div
|
|
35
|
-
className={
|
|
35
|
+
className={clsx(styles['end-resize-handle'], 'end-resize-handle')}
|
|
36
36
|
onMouseDown={resizeHandler}
|
|
37
37
|
style={endResizeHandleStyle}
|
|
38
38
|
>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { HandleProps } from './handle_props.js';
|
|
3
3
|
import styles from './left_resize_handle.module.css';
|
|
4
4
|
import { createHorizontalResizeHandler } from './resize_handlers.js';
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export interface LeftResizeHandleProps {
|
|
8
8
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
@@ -33,7 +33,7 @@ export function LeftResizeHandle({
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<div
|
|
36
|
-
className={
|
|
36
|
+
className={clsx(styles['left-resize-handle'], 'left-resize-handle')}
|
|
37
37
|
onMouseDown={resizeHandler}
|
|
38
38
|
style={leftResizeHandleStyle}
|
|
39
39
|
>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { HandleProps } from './handle_props.js';
|
|
3
3
|
import { createHorizontalResizeHandler } from './resize_handlers.js';
|
|
4
4
|
import styles from './right_resize_handle.module.css';
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export interface RightResizeHandleProps {
|
|
8
8
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
@@ -33,7 +33,7 @@ export function RightResizeHandle({
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<div
|
|
36
|
-
className={
|
|
36
|
+
className={clsx(styles['right-resize-handle'], 'right-resize-handle')}
|
|
37
37
|
onMouseDown={resizeHandler}
|
|
38
38
|
style={rightResizeHandleStyle}
|
|
39
39
|
>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { HandleProps } from './handle_props.js';
|
|
3
3
|
import { createHorizontalResizeHandler } from './resize_handlers.js';
|
|
4
4
|
import styles from './start_resize_handle.module.css';
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export interface StartResizeHandleProps {
|
|
8
8
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
@@ -32,7 +32,7 @@ export function StartResizeHandle({
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div
|
|
35
|
-
className={
|
|
35
|
+
className={clsx(styles['start-resize-handle'], 'start-resize-handle')}
|
|
36
36
|
onMouseDown={resizeHandler}
|
|
37
37
|
style={startResizeHandleStyle}
|
|
38
38
|
>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { HandleProps } from './handle_props.js';
|
|
3
3
|
import { createVerticalResizeHandler } from './resize_handlers.js';
|
|
4
4
|
import styles from './top_resize_handle.module.css';
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export interface TopResizeHandleProps {
|
|
8
8
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
@@ -31,7 +31,7 @@ export function TopResizeHandle({
|
|
|
31
31
|
};
|
|
32
32
|
return (
|
|
33
33
|
<div
|
|
34
|
-
className={
|
|
34
|
+
className={clsx(styles['top-resize-handle'], 'top-resize-handle')}
|
|
35
35
|
onMouseDown={resizeHandler}
|
|
36
36
|
style={topResizeHandleStyle}
|
|
37
37
|
>
|
|
@@ -10,7 +10,16 @@ import { ChevronLeftIcon as ChevronLeft } from '@tcn/icons/chevron_left_icon.js'
|
|
|
10
10
|
import { PlusIcon as Plus } from '@tcn/icons/plus_icon.js';
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
|
-
title: '
|
|
13
|
+
title: 'Stacks/Collapsible Box',
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component:
|
|
19
|
+
'A basic box element that can be collapsed horizontally or vertically.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
14
23
|
};
|
|
15
24
|
|
|
16
25
|
function MyPanel() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useLayoutEffect } from 'react';
|
|
2
2
|
import { useForkRef } from '../utils/index.js';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { Box, BoxProps } from './box/box.js';
|
|
5
5
|
import styles from './collapsible_box.module.css';
|
|
6
6
|
import { useIsCollapsed } from './utils/use_is_collapsed.js';
|
|
@@ -41,7 +41,7 @@ export const HCollapsibleBox = React.forwardRef(function CollapsibleBox(
|
|
|
41
41
|
props.onWidthResizeEnd?.(width);
|
|
42
42
|
collapsibleRef.current?.style.setProperty('--collapsible-size', `${width}px`);
|
|
43
43
|
}}
|
|
44
|
-
className={
|
|
44
|
+
className={clsx(props.className, styles['collapsible-box'])}
|
|
45
45
|
children={children}
|
|
46
46
|
/>
|
|
47
47
|
);
|