@tcn/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bar.css +1 -0
- package/dist/body.css +1 -1
- package/dist/body.module-BbFZ7KNP.js +5 -0
- package/dist/body.module-BbFZ7KNP.js.map +1 -0
- package/dist/divider.css +1 -1
- package/dist/footer.css +1 -1
- package/dist/form/field/h_field/h_field.d.ts.map +1 -1
- package/dist/form/field/h_field/h_field.js +33 -35
- package/dist/form/field/h_field/h_field.js.map +1 -1
- package/dist/form/field/v_field/v_field.d.ts.map +1 -1
- package/dist/form/field/v_field/v_field.js +34 -36
- package/dist/form/field/v_field/v_field.js.map +1 -1
- package/dist/frame.css +1 -1
- package/dist/inputs/color_input/color_input.d.ts.map +1 -1
- package/dist/inputs/color_input/color_input.js +47 -46
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.d.ts.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +61 -58
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/index.d.ts +1 -0
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/index.js +34 -31
- package/dist/inputs/index.js.map +1 -1
- package/dist/inputs/input/input.js +9 -9
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/input_group/input_group.d.ts +5 -0
- package/dist/inputs/input_group/input_group.d.ts.map +1 -0
- package/dist/inputs/input_group/input_group.js +20 -0
- package/dist/inputs/input_group/input_group.js.map +1 -0
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts +2 -2
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/countries_phone_information.js +5 -353
- package/dist/inputs/phone_number_input/countries_phone_information.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.d.ts +24 -0
- package/dist/inputs/phone_number_input/phone_number_context.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_context.js +23 -0
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts +19 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js +77 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input.d.ts +16 -14
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +104 -274
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts +6 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +95 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts +12 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.js +111 -0
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -0
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/inputs/select/select.js +3 -2
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts +4 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +120 -111
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/textarea/textarea.js +8 -8
- package/dist/inputs/textarea/textarea.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.d.ts.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +39 -39
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/layouts/bar/bar.d.ts +5 -0
- package/dist/layouts/bar/bar.d.ts.map +1 -0
- package/dist/layouts/bar/bar.js +20 -0
- package/dist/layouts/bar/bar.js.map +1 -0
- package/dist/layouts/body/body.d.ts +2 -2
- package/dist/layouts/body/body.d.ts.map +1 -1
- package/dist/layouts/body/body.js +12 -12
- package/dist/layouts/body/body.js.map +1 -1
- package/dist/layouts/body/h_body.d.ts.map +1 -1
- package/dist/layouts/body/h_body.js +18 -12
- package/dist/layouts/body/h_body.js.map +1 -1
- package/dist/layouts/body/v_body.d.ts.map +1 -1
- package/dist/layouts/body/v_body.js +16 -10
- package/dist/layouts/body/v_body.js.map +1 -1
- package/dist/layouts/footer/footer.d.ts +2 -3
- package/dist/layouts/footer/footer.d.ts.map +1 -1
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/footer/footer.js.map +1 -1
- package/dist/layouts/header/header.d.ts +2 -2
- package/dist/layouts/header/header.d.ts.map +1 -1
- package/dist/layouts/header/header.js +13 -21
- package/dist/layouts/header/header.js.map +1 -1
- package/dist/layouts/index.d.ts +0 -1
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +17 -19
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/rail/rail.js +41 -41
- package/dist/layouts/rail/rail.js.map +1 -1
- package/dist/layouts/rail/side/side.d.ts.map +1 -1
- package/dist/layouts/rail/side/side.js +1 -1
- package/dist/layouts/rail/side/side.js.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
- package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
- package/dist/layouts/scaffold/scaffold.js +32 -32
- package/dist/layouts/scaffold/scaffold.js.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
- package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.js +17 -19
- package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts +8 -4
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +87 -23
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.d.ts.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +52 -50
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/panel.css +1 -0
- package/dist/phone_number_input.css +1 -1
- package/dist/rail.css +1 -1
- package/dist/scaffold.css +1 -1
- package/dist/side.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js +12 -10
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +4 -4
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js +26 -26
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -2
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +6 -5
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -2
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js +10 -9
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +2 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +32 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -2
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js +6 -5
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -2
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +6 -6
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -2
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js +6 -5
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/suggestion_list.css +1 -1
- package/dist/surfaces/index.d.ts +1 -2
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +18 -20
- package/dist/surfaces/index.js.map +1 -1
- package/dist/surfaces/panel/panel.d.ts +5 -0
- package/dist/surfaces/panel/panel.d.ts.map +1 -0
- package/dist/surfaces/panel/panel.js +19 -0
- package/dist/surfaces/panel/panel.js.map +1 -0
- package/dist/surfaces/pop_confirm/pop_confirm.js +2 -3
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -10
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/stylesheets/reset.css +1 -1
- package/dist/themes/stylesheets/reset.js +8 -1
- package/dist/themes/stylesheets/reset.js.map +1 -1
- package/dist/themes/theme.d.ts +2 -1
- package/dist/themes/theme.d.ts.map +1 -1
- package/dist/themes/theme.js +16 -9
- package/dist/themes/theme.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +210 -18
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/typography/body_text/body_text.d.ts.map +1 -1
- package/dist/typography/body_text/body_text.js +12 -10
- package/dist/typography/body_text/body_text.js.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.js +22 -19
- package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
- package/package.json +4 -2
- package/src/form/field/h_field/h_field.tsx +0 -4
- package/src/form/field/v_field/v_field.stories.tsx +8 -0
- package/src/form/field/v_field/v_field.tsx +1 -4
- package/src/form/field_set/field_set.stories.tsx +2 -1
- package/src/inputs/__docs__/inputs.mdx +81 -0
- package/src/inputs/__docs__/inputs.stories.tsx +268 -0
- package/src/inputs/color_input/color_input.tsx +17 -17
- package/src/inputs/combo_box/combo_box.tsx +17 -13
- package/src/inputs/index.ts +2 -0
- package/src/inputs/input/input.tsx +1 -1
- package/src/inputs/input_group/input_group.tsx +26 -0
- package/src/inputs/phone_number_input/countries_phone_information.ts +6 -353
- package/src/inputs/phone_number_input/phone_number_context.tsx +32 -0
- package/src/inputs/phone_number_input/phone_number_country_select_adapter.tsx +126 -0
- package/src/inputs/phone_number_input/phone_number_input.module.css +5 -63
- package/src/inputs/phone_number_input/phone_number_input.stories.tsx +180 -150
- package/src/inputs/phone_number_input/phone_number_input.tsx +133 -400
- package/src/inputs/phone_number_input/phone_number_input_adapter.tsx +123 -0
- package/src/inputs/phone_number_input/sip_input.tsx +147 -0
- package/src/inputs/select/select.tsx +13 -14
- package/src/inputs/suggestions/suggestion_list.module.css +1 -0
- package/src/inputs/suggestions/suggestion_list.stories.tsx +12 -8
- package/src/inputs/suggestions/suggestion_list.tsx +24 -3
- package/src/inputs/textarea/textarea.tsx +1 -1
- package/src/inputs/unit_input/unit_input.tsx +17 -17
- package/src/layouts/__stories__/composed.stories.tsx +0 -55
- package/src/layouts/__stories__/rail.stories.tsx +78 -0
- package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
- package/src/layouts/__stories__/utils/content.tsx +27 -0
- package/src/layouts/__stories__/utils/layout_theme.css +88 -0
- package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
- package/src/layouts/__stories__/utils.tsx +6 -6
- package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
- package/src/layouts/bar/bar.tsx +23 -0
- package/src/layouts/body/body.module.css +9 -4
- package/src/layouts/body/body.tsx +7 -6
- package/src/layouts/body/h_body.module.css +1 -2
- package/src/layouts/body/h_body.tsx +9 -4
- package/src/layouts/body/v_body.tsx +9 -4
- package/src/layouts/divider/divider.module.css +1 -1
- package/src/layouts/footer/footer.module.css +0 -3
- package/src/layouts/footer/footer.tsx +5 -6
- package/src/layouts/header/header.tsx +6 -15
- package/src/layouts/index.ts +0 -1
- package/src/layouts/rail/rail.module.css +9 -5
- package/src/layouts/rail/rail.tsx +1 -1
- package/src/layouts/rail/side/side.module.css +0 -1
- package/src/layouts/rail/side/side.tsx +1 -2
- package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
- package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
- package/src/layouts/scaffold/scaffold.module.css +10 -7
- package/src/layouts/scaffold/scaffold.tsx +1 -1
- package/src/layouts/utility_bar/utility_bar.tsx +6 -9
- package/src/overlay/frame/frame.module.css +2 -4
- package/src/overlay/frame/frame.stories.tsx +13 -10
- package/src/overlay/frame/frame.tsx +124 -16
- package/src/overlay/popper/base/dismissal_decorator.tsx +1 -1
- package/src/overlay/popper/legacy/popper.tsx +5 -1
- package/src/stacks/box/bottom_resize_handle.tsx +12 -5
- package/src/stacks/box/box.tsx +18 -14
- package/src/stacks/box/end_resize_handle.tsx +11 -6
- package/src/stacks/box/left_resize_handle.tsx +9 -3
- package/src/stacks/box/resize_handlers.ts +27 -13
- package/src/stacks/box/right_resize_handle.tsx +9 -3
- package/src/stacks/box/start_resize_handle.tsx +9 -4
- package/src/stacks/box/top_resize_handle.tsx +10 -4
- package/src/stacks/collapsible_box.stories.tsx +11 -11
- package/src/stacks/h_collapsible_box.tsx +5 -5
- package/src/stacks/v_collapsible_box.tsx +4 -4
- package/src/surfaces/index.ts +1 -2
- package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
- package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
- package/src/surfaces/panel/panel.module.css +1 -6
- package/src/surfaces/panel/panel.tsx +22 -0
- package/src/surfaces/window/window.tsx +14 -4
- package/src/themes/stories/controls_fieldset.tsx +1 -1
- package/src/themes/stylesheets/reset.css +8 -1
- package/src/themes/theme.tsx +6 -2
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
- package/src/themes/themes/ergo/ergo_theme.css +210 -18
- package/src/typography/body_text/body_text.tsx +2 -0
- package/src/utils/dnd/__stories__/draggable.stories.tsx +14 -8
- package/src/utils/dnd/hooks/use_drag_container.ts +13 -3
- package/dist/h_body.css +0 -1
- package/dist/h_panel.css +0 -1
- package/dist/header.css +0 -1
- package/dist/layouts/rail/main/main.d.ts +0 -6
- package/dist/layouts/rail/main/main.d.ts.map +0 -1
- package/dist/layouts/rail/main/main.js +0 -21
- package/dist/layouts/rail/main/main.js.map +0 -1
- package/dist/main.css +0 -1
- package/dist/surfaces/panel/h_panel.d.ts +0 -9
- package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/h_panel.js +0 -60
- package/dist/surfaces/panel/h_panel.js.map +0 -1
- package/dist/surfaces/panel/v_panel.d.ts +0 -5
- package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/v_panel.js +0 -19
- package/dist/surfaces/panel/v_panel.js.map +0 -1
- package/dist/utility_bar.css +0 -1
- package/dist/v_body.css +0 -1
- package/src/inputs/phone_number_input/__tests__/utils.test.ts +0 -52
- package/src/layouts/header/header.module.css +0 -8
- package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
- package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
- package/src/layouts/rail/main/main.module.css +0 -7
- package/src/layouts/rail/main/main.tsx +0 -26
- package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
- package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
- package/src/surfaces/panel/h_panel.tsx +0 -65
- package/src/surfaces/panel/v_panel.tsx +0 -20
package/dist/stacks/box/box.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as O } from "clsx";
|
|
3
|
+
import oo, { useRef as ro } from "react";
|
|
2
4
|
import "../../utils/click_away_listener.js";
|
|
3
5
|
import "../../utils/focus_redirect.js";
|
|
4
6
|
import "../../utils/scroll_away_listener.js";
|
|
5
|
-
import
|
|
6
|
-
import { useForkRef as ro } from "../../utils/hooks/use_fork_ref.js";
|
|
7
|
+
import { useForkRef as to } from "../../utils/hooks/use_fork_ref.js";
|
|
7
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
9
|
import "../../utils/dnd/context.js";
|
|
9
|
-
import { clsx as to } from "clsx";
|
|
10
10
|
import "../../draggable.module-BgelQsuJ.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
const Bo =
|
|
11
|
+
import { s as y } from "../../stack.module-CBV1f12Z.js";
|
|
12
|
+
import { isCustomSizeProp as k } from "../utils/isCustomSizeProp.js";
|
|
13
|
+
import { removeUndefinedProperties as ao } from "../utils/remove_undefined_properties.js";
|
|
14
|
+
import { BottomResizeHandle as eo } from "./bottom_resize_handle.js";
|
|
15
|
+
import { EndResizeHandle as fo } from "./end_resize_handle.js";
|
|
16
|
+
import { LeftResizeHandle as so } from "./left_resize_handle.js";
|
|
17
|
+
import { RightResizeHandle as lo } from "./right_resize_handle.js";
|
|
18
|
+
import { StartResizeHandle as mo } from "./start_resize_handle.js";
|
|
19
|
+
import { TopResizeHandle as no } from "./top_resize_handle.js";
|
|
20
|
+
const Bo = oo.forwardRef(function({
|
|
21
21
|
style: v,
|
|
22
22
|
className: P,
|
|
23
23
|
as: _ = "div",
|
|
@@ -56,13 +56,13 @@ const Bo = O.forwardRef(function({
|
|
|
56
56
|
verticalHandleProps: x,
|
|
57
57
|
...X
|
|
58
58
|
}, Z) {
|
|
59
|
-
const $ = _, o =
|
|
59
|
+
const $ = _, o = ro(null), L = to(Z, o), R = l || n || c || p, T = m || s, z = R, E = T, g = z && r === "flex", S = E && t === "flex", F = !g && !S && (r === "flex" || t === "flex");
|
|
60
60
|
g && (r = "100%", console.warn("You cannot have a resizable box and flex simultaneously")), S && (t = "auto", console.warn("You cannot have a resizable box and flex simultaneously"));
|
|
61
61
|
const W = {
|
|
62
|
-
width:
|
|
62
|
+
width: k(r) ? void 0 : r,
|
|
63
63
|
minWidth: V,
|
|
64
64
|
maxWidth: b,
|
|
65
|
-
height:
|
|
65
|
+
height: k(t) ? void 0 : t,
|
|
66
66
|
minHeight: j,
|
|
67
67
|
maxHeight: w,
|
|
68
68
|
padding: A,
|
|
@@ -93,21 +93,21 @@ const Bo = O.forwardRef(function({
|
|
|
93
93
|
"data-width": r,
|
|
94
94
|
ref: L,
|
|
95
95
|
style: {
|
|
96
|
-
...
|
|
96
|
+
...ao(W),
|
|
97
97
|
...v
|
|
98
98
|
},
|
|
99
|
-
className:
|
|
100
|
-
|
|
99
|
+
className: O(
|
|
100
|
+
y.box,
|
|
101
101
|
P,
|
|
102
102
|
F && "stack-flex",
|
|
103
|
-
F &&
|
|
103
|
+
F && y["stack-flex"],
|
|
104
104
|
"tcn-box"
|
|
105
105
|
),
|
|
106
106
|
...X,
|
|
107
107
|
children: [
|
|
108
108
|
H,
|
|
109
109
|
s && /* @__PURE__ */ a(
|
|
110
|
-
|
|
110
|
+
no,
|
|
111
111
|
{
|
|
112
112
|
onHeightResize: d,
|
|
113
113
|
onHeightResizeEnd: u,
|
|
@@ -116,7 +116,7 @@ const Bo = O.forwardRef(function({
|
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
m && /* @__PURE__ */ a(
|
|
119
|
-
|
|
119
|
+
eo,
|
|
120
120
|
{
|
|
121
121
|
onHeightResize: d,
|
|
122
122
|
onHeightResizeEnd: u,
|
|
@@ -125,7 +125,7 @@ const Bo = O.forwardRef(function({
|
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
n && /* @__PURE__ */ a(
|
|
128
|
-
|
|
128
|
+
mo,
|
|
129
129
|
{
|
|
130
130
|
onWidthResize: e,
|
|
131
131
|
onWidthResizeEnd: f,
|
|
@@ -134,7 +134,7 @@ const Bo = O.forwardRef(function({
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
l && /* @__PURE__ */ a(
|
|
137
|
-
|
|
137
|
+
fo,
|
|
138
138
|
{
|
|
139
139
|
onWidthResize: e,
|
|
140
140
|
onWidthResizeEnd: f,
|
|
@@ -143,7 +143,7 @@ const Bo = O.forwardRef(function({
|
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
c && /* @__PURE__ */ a(
|
|
146
|
-
|
|
146
|
+
so,
|
|
147
147
|
{
|
|
148
148
|
onWidthResize: e,
|
|
149
149
|
onWidthResizeEnd: f,
|
|
@@ -152,7 +152,7 @@ const Bo = O.forwardRef(function({
|
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
154
|
p && /* @__PURE__ */ a(
|
|
155
|
-
|
|
155
|
+
lo,
|
|
156
156
|
{
|
|
157
157
|
onWidthResize: e,
|
|
158
158
|
onWidthResizeEnd: f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.js","sources":["../../../src/stacks/box/box.tsx"],"sourcesContent":["import { useForkRef } from '../../utils/index.js';\nimport React, { CSSProperties, HTMLAttributes, useRef } from 'react';\nimport { LeftResizeHandle } from './left_resize_handle.js';\nimport { RightResizeHandle } from './right_resize_handle.js';\nimport { BottomResizeHandle } from './bottom_resize_handle.js';\nimport { EndResizeHandle } from './end_resize_handle.js';\nimport { StartResizeHandle } from './start_resize_handle.js';\nimport { TopResizeHandle } from './top_resize_handle.js';\nimport { clsx } from 'clsx';\nimport { isCustomSizeProp } from '../utils/isCustomSizeProp.js';\nimport { removeUndefinedProperties } from '../utils/remove_undefined_properties.js';\nimport styles from '../stack.module.css';\nimport { HandleProps } from './handle_props.js';\n\nexport interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttributes<T> {\n as?: string;\n style?: React.CSSProperties;\n className?: string;\n children?: React.ReactNode;\n width?: 'default' | 'flex' | 'auto' | string | number;\n minWidth?: CSSProperties['minWidth'];\n maxWidth?: CSSProperties['maxWidth'];\n height?: 'default' | 'flex' | 'auto' | string | number;\n minHeight?: CSSProperties['minHeight'];\n maxHeight?: CSSProperties['maxHeight'];\n zIndex?: number;\n padding?: CSSProperties['padding'];\n paddingInline?: CSSProperties['paddingInline'];\n paddingBlock?: CSSProperties['paddingBlock'];\n margin?: CSSProperties['margin'];\n marginBlock?: CSSProperties['marginBlock'];\n marginInline?: CSSProperties['marginInline'];\n marginInlineStart?: CSSProperties['marginInlineStart'];\n marginInlineEnd?: CSSProperties['marginInlineEnd'];\n marginTop?: CSSProperties['marginTop'];\n marginBottom?: CSSProperties['marginBottom'];\n overflow?: React.CSSProperties['overflow'];\n overflowX?: React.CSSProperties['overflowX'];\n overflowY?: React.CSSProperties['overflowY'];\n enableResizeOnTop?: boolean;\n enableResizeOnEnd?: boolean;\n enableResizeOnBottom?: boolean;\n enableResizeOnStart?: boolean;\n enableResizeOnLeft?: boolean;\n enableResizeOnRight?: boolean;\n horizontalHandleProps?: HandleProps;\n verticalHandleProps?: HandleProps;\n onWidthResize?: (\n width: number\n // origin: 'left' | 'right'\n ) => void;\n onHeightResize?: (\n height: number\n // origin: 'top' | 'bottom'\n ) => void;\n onWidthResizeEnd?: (width: number) => void;\n onHeightResizeEnd?: (width: number) => void;\n}\n\nexport const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(\n {\n style,\n className,\n as = 'div',\n children,\n width = 'default',\n minWidth,\n maxWidth,\n height = 'default',\n minHeight,\n maxHeight,\n zIndex,\n padding,\n paddingInline,\n paddingBlock,\n margin,\n marginBlock,\n marginInline,\n marginInlineStart,\n marginInlineEnd,\n marginTop,\n marginBottom,\n overflow,\n overflowX,\n overflowY,\n enableResizeOnTop = false,\n enableResizeOnEnd = false,\n enableResizeOnBottom = false,\n enableResizeOnStart = false,\n enableResizeOnLeft = false,\n enableResizeOnRight = false,\n onWidthResize,\n onHeightResize,\n onWidthResizeEnd,\n onHeightResizeEnd,\n horizontalHandleProps,\n verticalHandleProps,\n ...otherProps\n }: BoxProps,\n ref\n) {\n const As = as as React.ElementType;\n const boxRef = useRef<HTMLElement | null>(null);\n const forkedRef = useForkRef(ref, boxRef);\n const hasHorizontalResize =\n enableResizeOnEnd || enableResizeOnStart || enableResizeOnLeft || enableResizeOnRight;\n const hasVerticalResize = enableResizeOnBottom || enableResizeOnTop;\n\n const cannotHorizontalFlex = hasHorizontalResize;\n const cannotVerticalFlex = hasVerticalResize;\n const warnHorizontalFlex = cannotHorizontalFlex && width === 'flex';\n const warnVerticalFlex = cannotVerticalFlex && height === 'flex';\n const isFlexing =\n !warnHorizontalFlex && !warnVerticalFlex && (width === 'flex' || height === 'flex');\n\n if (warnHorizontalFlex) {\n width = '100%';\n // biome-ignore lint/suspicious/noConsole: Need to warn the developer\n console.warn('You cannot have a resizable box and flex simultaneously');\n }\n\n if (warnVerticalFlex) {\n height = 'auto';\n // biome-ignore lint/suspicious/noConsole: Need to warn the developer\n console.warn('You cannot have a resizable box and flex simultaneously');\n }\n\n const propStyles = {\n width: !isCustomSizeProp(width) ? width : undefined,\n minWidth,\n maxWidth,\n height: !isCustomSizeProp(height) ? height : undefined,\n minHeight,\n maxHeight,\n padding,\n paddingInline,\n paddingBlock,\n margin,\n marginBlock,\n marginInline,\n marginInlineStart,\n marginInlineEnd,\n marginTop,\n marginBottom,\n overflow,\n overflowX,\n overflowY,\n zIndex,\n };\n\n return (\n <As\n data-enabled-resize-on-start={String(enableResizeOnStart)}\n data-enabled-resize-on-end={String(enableResizeOnEnd)}\n data-enabled-resize-on-top={String(enableResizeOnTop)}\n data-enabled-resize-on-bottom={String(enableResizeOnBottom)}\n data_enabled-resize-on-left={String(enableResizeOnLeft)}\n data_enabled-resize-on-right={String(enableResizeOnRight)}\n data-height={height}\n data-width={width}\n ref={forkedRef}\n style={{\n ...removeUndefinedProperties(propStyles),\n ...style,\n }}\n className={clsx(\n styles['box'],\n className,\n isFlexing && 'stack-flex',\n isFlexing && styles['stack-flex'],\n 'tcn-box'\n )}\n {...otherProps}\n >\n {children}\n {enableResizeOnTop && (\n <TopResizeHandle\n onHeightResize={onHeightResize}\n onHeightResizeEnd={onHeightResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnBottom && (\n <BottomResizeHandle\n onHeightResize={onHeightResize}\n onHeightResizeEnd={onHeightResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n {enableResizeOnStart && (\n <StartResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnEnd && (\n <EndResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnLeft && (\n <LeftResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n {enableResizeOnRight && (\n <RightResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n </As>\n );\n});\n"],"names":["Box","React","style","className","as","children","width","minWidth","maxWidth","height","minHeight","maxHeight","zIndex","padding","paddingInline","paddingBlock","margin","marginBlock","marginInline","marginInlineStart","marginInlineEnd","marginTop","marginBottom","overflow","overflowX","overflowY","enableResizeOnTop","enableResizeOnEnd","enableResizeOnBottom","enableResizeOnStart","enableResizeOnLeft","enableResizeOnRight","onWidthResize","onHeightResize","onWidthResizeEnd","onHeightResizeEnd","horizontalHandleProps","verticalHandleProps","otherProps","ref","As","boxRef","useRef","forkedRef","useForkRef","hasHorizontalResize","hasVerticalResize","cannotHorizontalFlex","cannotVerticalFlex","warnHorizontalFlex","warnVerticalFlex","isFlexing","propStyles","isCustomSizeProp","jsxs","removeUndefinedProperties","clsx","styles","jsx","TopResizeHandle","BottomResizeHandle","StartResizeHandle","EndResizeHandle","LeftResizeHandle","RightResizeHandle"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"box.js","sources":["../../../src/stacks/box/box.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { CSSProperties, HTMLAttributes, useRef } from 'react';\nimport { useForkRef } from '../../utils/index.js';\nimport styles from '../stack.module.css';\nimport { isCustomSizeProp } from '../utils/isCustomSizeProp.js';\nimport { removeUndefinedProperties } from '../utils/remove_undefined_properties.js';\nimport { BottomResizeHandle } from './bottom_resize_handle.js';\nimport { EndResizeHandle } from './end_resize_handle.js';\nimport { HandleProps } from './handle_props.js';\nimport { LeftResizeHandle } from './left_resize_handle.js';\nimport { RightResizeHandle } from './right_resize_handle.js';\nimport { StartResizeHandle } from './start_resize_handle.js';\nimport { TopResizeHandle } from './top_resize_handle.js';\n\nexport interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttributes<T> {\n as?: string;\n style?: React.CSSProperties;\n className?: string;\n children?: React.ReactNode;\n width?: 'default' | 'flex' | 'auto' | string | number;\n minWidth?: CSSProperties['minWidth'];\n maxWidth?: CSSProperties['maxWidth'];\n height?: 'default' | 'flex' | 'auto' | string | number;\n minHeight?: CSSProperties['minHeight'];\n maxHeight?: CSSProperties['maxHeight'];\n zIndex?: number;\n padding?: CSSProperties['padding'];\n paddingInline?: CSSProperties['paddingInline'];\n paddingBlock?: CSSProperties['paddingBlock'];\n margin?: CSSProperties['margin'];\n marginBlock?: CSSProperties['marginBlock'];\n marginInline?: CSSProperties['marginInline'];\n marginInlineStart?: CSSProperties['marginInlineStart'];\n marginInlineEnd?: CSSProperties['marginInlineEnd'];\n marginTop?: CSSProperties['marginTop'];\n marginBottom?: CSSProperties['marginBottom'];\n overflow?: React.CSSProperties['overflow'];\n overflowX?: React.CSSProperties['overflowX'];\n overflowY?: React.CSSProperties['overflowY'];\n enableResizeOnTop?: boolean;\n enableResizeOnEnd?: boolean;\n enableResizeOnBottom?: boolean;\n enableResizeOnStart?: boolean;\n enableResizeOnLeft?: boolean;\n enableResizeOnRight?: boolean;\n horizontalHandleProps?: HandleProps;\n verticalHandleProps?: HandleProps;\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onHeightResize?: (\n height: number,\n origin: 'top' | 'bottom',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;\n onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void;\n}\n\nexport const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(\n {\n style,\n className,\n as = 'div',\n children,\n width = 'default',\n minWidth,\n maxWidth,\n height = 'default',\n minHeight,\n maxHeight,\n zIndex,\n padding,\n paddingInline,\n paddingBlock,\n margin,\n marginBlock,\n marginInline,\n marginInlineStart,\n marginInlineEnd,\n marginTop,\n marginBottom,\n overflow,\n overflowX,\n overflowY,\n enableResizeOnTop = false,\n enableResizeOnEnd = false,\n enableResizeOnBottom = false,\n enableResizeOnStart = false,\n enableResizeOnLeft = false,\n enableResizeOnRight = false,\n onWidthResize,\n onHeightResize,\n onWidthResizeEnd,\n onHeightResizeEnd,\n horizontalHandleProps,\n verticalHandleProps,\n ...otherProps\n }: BoxProps,\n ref\n) {\n const As = as as React.ElementType;\n const boxRef = useRef<HTMLElement | null>(null);\n const forkedRef = useForkRef(ref, boxRef);\n const hasHorizontalResize =\n enableResizeOnEnd || enableResizeOnStart || enableResizeOnLeft || enableResizeOnRight;\n const hasVerticalResize = enableResizeOnBottom || enableResizeOnTop;\n\n const cannotHorizontalFlex = hasHorizontalResize;\n const cannotVerticalFlex = hasVerticalResize;\n const warnHorizontalFlex = cannotHorizontalFlex && width === 'flex';\n const warnVerticalFlex = cannotVerticalFlex && height === 'flex';\n const isFlexing =\n !warnHorizontalFlex && !warnVerticalFlex && (width === 'flex' || height === 'flex');\n\n if (warnHorizontalFlex) {\n width = '100%';\n // biome-ignore lint/suspicious/noConsole: Need to warn the developer\n console.warn('You cannot have a resizable box and flex simultaneously');\n }\n\n if (warnVerticalFlex) {\n height = 'auto';\n // biome-ignore lint/suspicious/noConsole: Need to warn the developer\n console.warn('You cannot have a resizable box and flex simultaneously');\n }\n\n const propStyles = {\n width: !isCustomSizeProp(width) ? width : undefined,\n minWidth,\n maxWidth,\n height: !isCustomSizeProp(height) ? height : undefined,\n minHeight,\n maxHeight,\n padding,\n paddingInline,\n paddingBlock,\n margin,\n marginBlock,\n marginInline,\n marginInlineStart,\n marginInlineEnd,\n marginTop,\n marginBottom,\n overflow,\n overflowX,\n overflowY,\n zIndex,\n };\n\n return (\n <As\n data-enabled-resize-on-start={String(enableResizeOnStart)}\n data-enabled-resize-on-end={String(enableResizeOnEnd)}\n data-enabled-resize-on-top={String(enableResizeOnTop)}\n data-enabled-resize-on-bottom={String(enableResizeOnBottom)}\n data_enabled-resize-on-left={String(enableResizeOnLeft)}\n data_enabled-resize-on-right={String(enableResizeOnRight)}\n data-height={height}\n data-width={width}\n ref={forkedRef}\n style={{\n ...removeUndefinedProperties(propStyles),\n ...style,\n }}\n className={clsx(\n styles['box'],\n className,\n isFlexing && 'stack-flex',\n isFlexing && styles['stack-flex'],\n 'tcn-box'\n )}\n {...otherProps}\n >\n {children}\n {enableResizeOnTop && (\n <TopResizeHandle\n onHeightResize={onHeightResize}\n onHeightResizeEnd={onHeightResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnBottom && (\n <BottomResizeHandle\n onHeightResize={onHeightResize}\n onHeightResizeEnd={onHeightResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n {enableResizeOnStart && (\n <StartResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnEnd && (\n <EndResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={horizontalHandleProps}\n />\n )}\n {enableResizeOnLeft && (\n <LeftResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n {enableResizeOnRight && (\n <RightResizeHandle\n onWidthResize={onWidthResize}\n onWidthResizeEnd={onWidthResizeEnd}\n targetRef={boxRef}\n handleProps={verticalHandleProps}\n />\n )}\n </As>\n );\n});\n"],"names":["Box","React","style","className","as","children","width","minWidth","maxWidth","height","minHeight","maxHeight","zIndex","padding","paddingInline","paddingBlock","margin","marginBlock","marginInline","marginInlineStart","marginInlineEnd","marginTop","marginBottom","overflow","overflowX","overflowY","enableResizeOnTop","enableResizeOnEnd","enableResizeOnBottom","enableResizeOnStart","enableResizeOnLeft","enableResizeOnRight","onWidthResize","onHeightResize","onWidthResizeEnd","onHeightResizeEnd","horizontalHandleProps","verticalHandleProps","otherProps","ref","As","boxRef","useRef","forkedRef","useForkRef","hasHorizontalResize","hasVerticalResize","cannotHorizontalFlex","cannotVerticalFlex","warnHorizontalFlex","warnVerticalFlex","isFlexing","propStyles","isCustomSizeProp","jsxs","removeUndefinedProperties","clsx","styles","jsx","TopResizeHandle","BottomResizeHandle","StartResizeHandle","EndResizeHandle","LeftResizeHandle","RightResizeHandle"],"mappings":"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"}
|
|
@@ -3,8 +3,8 @@ import { HandleProps } from './handle_props.js';
|
|
|
3
3
|
export interface EndResizeHandleProps {
|
|
4
4
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
5
|
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (
|
|
7
|
-
onWidthResizeEnd?: (
|
|
6
|
+
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
+
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
8
|
}
|
|
9
9
|
export declare function EndResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: EndResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=end_resize_handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"end_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/end_resize_handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"end_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/end_resize_handle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CACtE;AACD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,oBAAoB,2CAwBtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { clsx as l } from "clsx";
|
|
3
|
+
import { createHorizontalResizeHandler as c } from "./resize_handlers.js";
|
|
4
4
|
import '../../end_resize_handle.css';const f = "_end-resize-handle_1c5e6ba", z = { "end-resize-handle": f };
|
|
5
5
|
function x({
|
|
6
6
|
targetRef: n,
|
|
@@ -8,10 +8,11 @@ function x({
|
|
|
8
8
|
onWidthResize: s,
|
|
9
9
|
onWidthResizeEnd: t
|
|
10
10
|
}) {
|
|
11
|
-
const i =
|
|
11
|
+
const i = c(
|
|
12
12
|
n,
|
|
13
13
|
s,
|
|
14
|
-
t
|
|
14
|
+
t,
|
|
15
|
+
"right"
|
|
15
16
|
), o = e?.offset ? e.offset : -8, r = {
|
|
16
17
|
...e?.style,
|
|
17
18
|
"--resize-offset": `${o}px`,
|
|
@@ -20,7 +21,7 @@ function x({
|
|
|
20
21
|
return /* @__PURE__ */ d(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
|
-
className:
|
|
24
|
+
className: l(z["end-resize-handle"], "tcn-end-resize-handle"),
|
|
24
25
|
onMouseDown: i,
|
|
25
26
|
style: r,
|
|
26
27
|
children: e?.children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"end_resize_handle.js","sources":["../../../src/stacks/box/end_resize_handle.tsx"],"sourcesContent":["import React from 'react';\nimport styles from './end_resize_handle.module.css';\nimport {
|
|
1
|
+
{"version":3,"file":"end_resize_handle.js","sources":["../../../src/stacks/box/end_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport styles from './end_resize_handle.module.css';\nimport { HandleProps } from './handle_props.js';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\n\nexport interface EndResizeHandleProps {\n targetRef: React.MutableRefObject<HTMLElement | null>;\n handleProps?: HandleProps;\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;\n}\nexport function EndResizeHandle({\n targetRef,\n handleProps,\n onWidthResize,\n onWidthResizeEnd,\n}: EndResizeHandleProps) {\n const resizeHandler = createHorizontalResizeHandler(\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n 'right'\n );\n const offset = handleProps?.offset ? handleProps.offset : -8;\n\n const endResizeHandleStyle: any = {\n ...handleProps?.style,\n '--resize-offset': `${offset}px`,\n width: handleProps?.size || '16px',\n };\n\n return (\n <div\n className={clsx(styles['end-resize-handle'], 'tcn-end-resize-handle')}\n onMouseDown={resizeHandler}\n style={endResizeHandleStyle}\n >\n {handleProps?.children}\n </div>\n );\n}\n"],"names":["EndResizeHandle","targetRef","handleProps","onWidthResize","onWidthResizeEnd","resizeHandler","createHorizontalResizeHandler","offset","endResizeHandleStyle","jsx","clsx","styles"],"mappings":";;;;AAiBO,SAASA,EAAgB;AAAA,EAC9B,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AACF,GAAyB;AACvB,QAAMC,IAAgBC;AAAA,IACpBL;AAAA,IACAE;AAAA,IACAC;AAAA,IACA;AAAA,EAAA,GAEIG,IAASL,GAAa,SAASA,EAAY,SAAS,IAEpDM,IAA4B;AAAA,IAChC,GAAGN,GAAa;AAAA,IAChB,mBAAmB,GAAGK,CAAM;AAAA,IAC5B,OAAOL,GAAa,QAAQ;AAAA,EAAA;AAG9B,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,mBAAmB,GAAG,uBAAuB;AAAA,MACpE,aAAaN;AAAA,MACb,OAAOG;AAAA,MAEN,UAAAN,GAAa;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|
|
@@ -3,8 +3,8 @@ import { HandleProps } from './handle_props.js';
|
|
|
3
3
|
export interface LeftResizeHandleProps {
|
|
4
4
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
5
|
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (
|
|
7
|
-
onWidthResizeEnd?: (
|
|
6
|
+
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
+
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
8
|
}
|
|
9
9
|
export declare function LeftResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: LeftResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=left_resize_handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"left_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/left_resize_handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"left_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/left_resize_handle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CACtE;AACD,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,qBAAqB,2CA0BvB"}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { clsx as o } from "clsx";
|
|
3
|
+
import { createHorizontalResizeHandler as c } from "./resize_handlers.js";
|
|
4
4
|
import '../../left_resize_handle.css';const z = "_left-resize-handle_215501a", a = { "left-resize-handle": z };
|
|
5
5
|
function u({
|
|
6
6
|
targetRef: t,
|
|
7
7
|
handleProps: e,
|
|
8
8
|
onWidthResize: s,
|
|
9
|
-
onWidthResizeEnd:
|
|
9
|
+
onWidthResizeEnd: l
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
11
|
+
const f = c(
|
|
12
12
|
t,
|
|
13
13
|
s,
|
|
14
|
-
|
|
14
|
+
l,
|
|
15
|
+
"left",
|
|
15
16
|
!0,
|
|
16
17
|
!0
|
|
17
|
-
),
|
|
18
|
+
), i = e?.offset ? e.offset : -8, n = {
|
|
18
19
|
...e?.style,
|
|
19
|
-
"--resize-offset": `${
|
|
20
|
+
"--resize-offset": `${i}px`,
|
|
20
21
|
width: e?.size || "16px"
|
|
21
22
|
};
|
|
22
23
|
return /* @__PURE__ */ r(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
|
-
className:
|
|
26
|
-
onMouseDown:
|
|
26
|
+
className: o(a["left-resize-handle"], "tcn-left-resize-handle"),
|
|
27
|
+
onMouseDown: f,
|
|
27
28
|
style: n,
|
|
28
29
|
children: e?.children
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"left_resize_handle.js","sources":["../../../src/stacks/box/left_resize_handle.tsx"],"sourcesContent":["import React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport styles from './left_resize_handle.module.css';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\
|
|
1
|
+
{"version":3,"file":"left_resize_handle.js","sources":["../../../src/stacks/box/left_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport styles from './left_resize_handle.module.css';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\n\nexport interface LeftResizeHandleProps {\n targetRef: React.MutableRefObject<HTMLElement | null>;\n handleProps?: HandleProps;\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;\n}\nexport function LeftResizeHandle({\n targetRef,\n handleProps,\n onWidthResize,\n onWidthResizeEnd,\n}: LeftResizeHandleProps) {\n const resizeHandler = createHorizontalResizeHandler(\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n 'left',\n true,\n true\n );\n const offset = handleProps?.offset ? handleProps.offset : -8;\n\n const leftResizeHandleStyle: any = {\n ...handleProps?.style,\n '--resize-offset': `${offset}px`,\n width: handleProps?.size || '16px',\n };\n\n return (\n <div\n className={clsx(styles['left-resize-handle'], 'tcn-left-resize-handle')}\n onMouseDown={resizeHandler}\n style={leftResizeHandleStyle}\n >\n {handleProps?.children}\n </div>\n );\n}\n"],"names":["LeftResizeHandle","targetRef","handleProps","onWidthResize","onWidthResizeEnd","resizeHandler","createHorizontalResizeHandler","offset","leftResizeHandleStyle","jsx","clsx","styles"],"mappings":";;;;AAiBO,SAASA,EAAiB;AAAA,EAC/B,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AACF,GAA0B;AACxB,QAAMC,IAAgBC;AAAA,IACpBL;AAAA,IACAE;AAAA,IACAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEIG,IAASL,GAAa,SAASA,EAAY,SAAS,IAEpDM,IAA6B;AAAA,IACjC,GAAGN,GAAa;AAAA,IAChB,mBAAmB,GAAGK,CAAM;AAAA,IAC5B,OAAOL,GAAa,QAAQ;AAAA,EAAA;AAG9B,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,oBAAoB,GAAG,wBAAwB;AAAA,MACtE,aAAaN;AAAA,MACb,OAAOG;AAAA,MAEN,UAAAN,GAAa;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function createHorizontalResizeHandler(targetRef: React.MutableRefObject<HTMLElement | null>, onWidthResize?: (
|
|
2
|
-
export declare function createVerticalResizeHandler(targetRef: React.MutableRefObject<HTMLElement | null>, onHeightResize?: (
|
|
1
|
+
export declare function createHorizontalResizeHandler(targetRef: React.MutableRefObject<HTMLElement | null>, onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void, onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void, origin?: 'left' | 'right', invert?: boolean, disableDirection?: boolean): (event: React.MouseEvent) => void;
|
|
2
|
+
export declare function createVerticalResizeHandler(targetRef: React.MutableRefObject<HTMLElement | null>, onHeightResize?: (height: number, origin: 'top' | 'bottom', totalDelta: number, currentDelta: number) => void, onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void, invert?: boolean, origin?: 'top' | 'bottom'): (event: React.MouseEvent) => void;
|
|
3
3
|
//# sourceMappingURL=resize_handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize_handlers.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/resize_handlers.ts"],"names":[],"mappings":"AASA,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EACrD,aAAa,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"resize_handlers.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/resize_handlers.ts"],"names":[],"mappings":"AASA,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EACrD,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,EACT,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,EACpE,MAAM,GAAE,MAAM,GAAG,OAAiB,EAClC,MAAM,UAAQ,EACd,gBAAgB,UAAQ,IAEc,OAAO,KAAK,CAAC,UAAU,UAwD9D;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EACrD,cAAc,CAAC,EAAE,CACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,GAAG,QAAQ,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,EACT,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,KAAK,IAAI,EACtE,MAAM,UAAQ,EACd,MAAM,GAAE,KAAK,GAAG,QAAmB,IAGC,OAAO,KAAK,CAAC,UAAU,UAiD5D"}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
function
|
|
1
|
+
function D() {
|
|
2
2
|
const n = window.document.createElement("div");
|
|
3
3
|
return n.style.position = "absolute", n.style.inset = "-500px", n.style.backgroundColor = "transparent", n.style.pointerEvents = "auto", n;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return function(
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
5
|
+
function C(n, v, f, m = "right", c = !1, b = !1) {
|
|
6
|
+
return function(e) {
|
|
7
|
+
const t = n.current;
|
|
8
|
+
if (t == null)
|
|
9
9
|
return;
|
|
10
|
-
const a =
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
let s =
|
|
14
|
-
const o = (
|
|
15
|
-
const
|
|
16
|
-
s =
|
|
17
|
-
},
|
|
18
|
-
|
|
10
|
+
const a = D();
|
|
11
|
+
t.appendChild(a);
|
|
12
|
+
const d = (window.getComputedStyle(t).direction === "rtl" && !b ? !c : c) ? -1 : 1, p = e.clientX, u = t.getBoundingClientRect();
|
|
13
|
+
let s = u.width;
|
|
14
|
+
const o = (i) => {
|
|
15
|
+
const E = d * (i.clientX - p), g = u.width + E, w = g - s;
|
|
16
|
+
s = g, t.style.width = `${g}px`, v?.(g, m, E, w), i.stopPropagation(), i.preventDefault();
|
|
17
|
+
}, l = (i) => {
|
|
18
|
+
i.buttons === 0 && r();
|
|
19
19
|
}, r = () => {
|
|
20
|
-
|
|
20
|
+
t.removeChild(a), document.body.removeEventListener("mousemove", o), document.body.removeEventListener("mouseup", r), document.body.removeEventListener("mouseenter", l), e.stopPropagation(), e.preventDefault(), f?.(s, m);
|
|
21
21
|
};
|
|
22
|
-
document.body.addEventListener("mousemove", o), document.body.addEventListener("mouseup", r), document.body.addEventListener("mouseenter",
|
|
22
|
+
document.body.addEventListener("mousemove", o), document.body.addEventListener("mouseup", r), document.body.addEventListener("mouseenter", l), e.stopPropagation(), e.preventDefault();
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return function(
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
25
|
+
function R(n, v, f, m = !1, c = "bottom") {
|
|
26
|
+
const b = m ? -1 : 1;
|
|
27
|
+
return function(e) {
|
|
28
|
+
const t = n.current;
|
|
29
|
+
if (t == null)
|
|
30
30
|
return;
|
|
31
|
-
const a =
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
let
|
|
31
|
+
const a = D();
|
|
32
|
+
t.appendChild(a);
|
|
33
|
+
const y = e.clientY, h = t.getBoundingClientRect();
|
|
34
|
+
let d = h.height;
|
|
35
35
|
const p = (o) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
},
|
|
36
|
+
const l = b * (o.clientY - y), r = h.height + l, i = r - d;
|
|
37
|
+
d = r, t.style.height = `${r}px`, v?.(r, c, l, i), o.stopPropagation(), o.preventDefault();
|
|
38
|
+
}, u = (o) => {
|
|
39
39
|
o.buttons === 0 && s();
|
|
40
40
|
}, s = () => {
|
|
41
|
-
|
|
41
|
+
t.removeChild(a), document.body.removeEventListener("mousemove", p), document.body.removeEventListener("mouseup", s), document.body.removeEventListener("mouseenter", u), e.stopPropagation(), e.preventDefault(), f?.(d, c);
|
|
42
42
|
};
|
|
43
|
-
document.body.addEventListener("mousemove", p), document.body.addEventListener("mouseup", s), document.body.addEventListener("mouseenter",
|
|
43
|
+
document.body.addEventListener("mousemove", p), document.body.addEventListener("mouseup", s), document.body.addEventListener("mouseenter", u), e.stopPropagation(), e.preventDefault();
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
C as createHorizontalResizeHandler,
|
|
48
|
+
R as createVerticalResizeHandler
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=resize_handlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize_handlers.js","sources":["../../../src/stacks/box/resize_handlers.ts"],"sourcesContent":["function createVeil() {\n const veil = window.document.createElement('div');\n veil.style.position = 'absolute';\n veil.style.inset = '-500px';\n veil.style.backgroundColor = 'transparent';\n veil.style.pointerEvents = 'auto';\n return veil;\n}\n\nexport function createHorizontalResizeHandler(\n targetRef: React.MutableRefObject<HTMLElement | null>,\n onWidthResize?: (
|
|
1
|
+
{"version":3,"file":"resize_handlers.js","sources":["../../../src/stacks/box/resize_handlers.ts"],"sourcesContent":["function createVeil() {\n const veil = window.document.createElement('div');\n veil.style.position = 'absolute';\n veil.style.inset = '-500px';\n veil.style.backgroundColor = 'transparent';\n veil.style.pointerEvents = 'auto';\n return veil;\n}\n\nexport function createHorizontalResizeHandler(\n targetRef: React.MutableRefObject<HTMLElement | null>,\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void,\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void,\n origin: 'left' | 'right' = 'right',\n invert = false,\n disableDirection = false\n) {\n return function startHorizontalResize(event: React.MouseEvent) {\n const box = targetRef.current;\n\n if (box == null) {\n return;\n }\n\n const veil = createVeil();\n box.appendChild(veil);\n\n const languageDirection = window.getComputedStyle(box).direction;\n const finalInvert =\n languageDirection === 'rtl' && !disableDirection ? !invert : invert;\n const direction = finalInvert ? -1 : 1;\n\n const startX = event.clientX;\n const startRect = box.getBoundingClientRect();\n let width = startRect.width;\n\n const drag = (event: MouseEvent) => {\n const totalDelta = direction * (event.clientX - startX);\n const newWidth = startRect.width + totalDelta;\n const currentDelta = newWidth - width;\n\n width = newWidth;\n\n box.style.width = `${newWidth}px`;\n onWidthResize?.(newWidth, origin, totalDelta, currentDelta);\n event.stopPropagation();\n event.preventDefault();\n };\n\n const mouseEnter = (event: MouseEvent) => {\n if (event.buttons === 0) {\n endDrag();\n }\n };\n\n const endDrag = () => {\n box.removeChild(veil);\n\n document.body.removeEventListener('mousemove', drag);\n document.body.removeEventListener('mouseup', endDrag);\n document.body.removeEventListener('mouseenter', mouseEnter);\n event.stopPropagation();\n event.preventDefault();\n\n onWidthResizeEnd?.(width, origin);\n };\n\n document.body.addEventListener('mousemove', drag);\n document.body.addEventListener('mouseup', endDrag);\n document.body.addEventListener('mouseenter', mouseEnter);\n event.stopPropagation();\n event.preventDefault();\n };\n}\n\nexport function createVerticalResizeHandler(\n targetRef: React.MutableRefObject<HTMLElement | null>,\n onHeightResize?: (\n height: number,\n origin: 'top' | 'bottom',\n totalDelta: number,\n currentDelta: number\n ) => void,\n onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void,\n invert = false,\n origin: 'top' | 'bottom' = 'bottom'\n) {\n const direction = invert ? -1 : 1;\n return function startVerticalResize(event: React.MouseEvent) {\n const box = targetRef.current;\n\n if (box == null) {\n return;\n }\n\n const veil = createVeil();\n box.appendChild(veil);\n\n const startY = event.clientY;\n const startRect = box.getBoundingClientRect();\n let height = startRect.height;\n\n const drag = (event: MouseEvent) => {\n const totalDelta = direction * (event.clientY - startY);\n const newHeight = startRect.height + totalDelta;\n const currentDelta = newHeight - height;\n height = newHeight;\n box.style.height = `${newHeight}px`;\n onHeightResize?.(newHeight, origin, totalDelta, currentDelta);\n event.stopPropagation();\n event.preventDefault();\n };\n\n const mouseEnter = (event: MouseEvent) => {\n if (event.buttons === 0) {\n endDrag();\n }\n };\n\n const endDrag = () => {\n box.removeChild(veil);\n\n document.body.removeEventListener('mousemove', drag);\n document.body.removeEventListener('mouseup', endDrag);\n document.body.removeEventListener('mouseenter', mouseEnter);\n event.stopPropagation();\n event.preventDefault();\n\n onHeightResizeEnd?.(height, origin);\n };\n\n document.body.addEventListener('mousemove', drag);\n document.body.addEventListener('mouseup', endDrag);\n document.body.addEventListener('mouseenter', mouseEnter);\n event.stopPropagation();\n event.preventDefault();\n };\n}\n"],"names":["createVeil","veil","createHorizontalResizeHandler","targetRef","onWidthResize","onWidthResizeEnd","origin","invert","disableDirection","event","box","direction","startX","startRect","width","drag","totalDelta","newWidth","currentDelta","mouseEnter","endDrag","createVerticalResizeHandler","onHeightResize","onHeightResizeEnd","startY","height","newHeight"],"mappings":"AAAA,SAASA,IAAa;AACpB,QAAMC,IAAO,OAAO,SAAS,cAAc,KAAK;AAChD,SAAAA,EAAK,MAAM,WAAW,YACtBA,EAAK,MAAM,QAAQ,UACnBA,EAAK,MAAM,kBAAkB,eAC7BA,EAAK,MAAM,gBAAgB,QACpBA;AACT;AAEO,SAASC,EACdC,GACAC,GAMAC,GACAC,IAA2B,SAC3BC,IAAS,IACTC,IAAmB,IACnB;AACA,SAAO,SAA+BC,GAAyB;AAC7D,UAAMC,IAAMP,EAAU;AAEtB,QAAIO,KAAO;AACT;AAGF,UAAMT,IAAOD,EAAA;AACb,IAAAU,EAAI,YAAYT,CAAI;AAKpB,UAAMU,KAHoB,OAAO,iBAAiBD,CAAG,EAAE,cAE/B,SAAS,CAACF,IAAmB,CAACD,IAASA,KAC/B,KAAK,GAE/BK,IAASH,EAAM,SACfI,IAAYH,EAAI,sBAAA;AACtB,QAAII,IAAQD,EAAU;AAEtB,UAAME,IAAO,CAACN,MAAsB;AAClC,YAAMO,IAAaL,KAAaF,EAAM,UAAUG,IAC1CK,IAAWJ,EAAU,QAAQG,GAC7BE,IAAeD,IAAWH;AAEhC,MAAAA,IAAQG,GAERP,EAAI,MAAM,QAAQ,GAAGO,CAAQ,MAC7Bb,IAAgBa,GAAUX,GAAQU,GAAYE,CAAY,GAC1DT,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,IACR,GAEMU,IAAa,CAACV,MAAsB;AACxC,MAAIA,EAAM,YAAY,KACpBW,EAAA;AAAA,IAEJ,GAEMA,IAAU,MAAM;AACpB,MAAAV,EAAI,YAAYT,CAAI,GAEpB,SAAS,KAAK,oBAAoB,aAAac,CAAI,GACnD,SAAS,KAAK,oBAAoB,WAAWK,CAAO,GACpD,SAAS,KAAK,oBAAoB,cAAcD,CAAU,GAC1DV,EAAM,gBAAA,GACNA,EAAM,eAAA,GAENJ,IAAmBS,GAAOR,CAAM;AAAA,IAClC;AAEA,aAAS,KAAK,iBAAiB,aAAaS,CAAI,GAChD,SAAS,KAAK,iBAAiB,WAAWK,CAAO,GACjD,SAAS,KAAK,iBAAiB,cAAcD,CAAU,GACvDV,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,EACR;AACF;AAEO,SAASY,EACdlB,GACAmB,GAMAC,GACAhB,IAAS,IACTD,IAA2B,UAC3B;AACA,QAAMK,IAAYJ,IAAS,KAAK;AAChC,SAAO,SAA6BE,GAAyB;AAC3D,UAAMC,IAAMP,EAAU;AAEtB,QAAIO,KAAO;AACT;AAGF,UAAMT,IAAOD,EAAA;AACb,IAAAU,EAAI,YAAYT,CAAI;AAEpB,UAAMuB,IAASf,EAAM,SACfI,IAAYH,EAAI,sBAAA;AACtB,QAAIe,IAASZ,EAAU;AAEvB,UAAME,IAAO,CAACN,MAAsB;AAClC,YAAMO,IAAaL,KAAaF,EAAM,UAAUe,IAC1CE,IAAYb,EAAU,SAASG,GAC/BE,IAAeQ,IAAYD;AACjC,MAAAA,IAASC,GACThB,EAAI,MAAM,SAAS,GAAGgB,CAAS,MAC/BJ,IAAiBI,GAAWpB,GAAQU,GAAYE,CAAY,GAC5DT,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,IACR,GAEMU,IAAa,CAACV,MAAsB;AACxC,MAAIA,EAAM,YAAY,KACpBW,EAAA;AAAA,IAEJ,GAEMA,IAAU,MAAM;AACpB,MAAAV,EAAI,YAAYT,CAAI,GAEpB,SAAS,KAAK,oBAAoB,aAAac,CAAI,GACnD,SAAS,KAAK,oBAAoB,WAAWK,CAAO,GACpD,SAAS,KAAK,oBAAoB,cAAcD,CAAU,GAC1DV,EAAM,gBAAA,GACNA,EAAM,eAAA,GAENc,IAAoBE,GAAQnB,CAAM;AAAA,IACpC;AAEA,aAAS,KAAK,iBAAiB,aAAaS,CAAI,GAChD,SAAS,KAAK,iBAAiB,WAAWK,CAAO,GACjD,SAAS,KAAK,iBAAiB,cAAcD,CAAU,GACvDV,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,EACR;AACF;"}
|
|
@@ -3,8 +3,8 @@ import { HandleProps } from './handle_props.js';
|
|
|
3
3
|
export interface RightResizeHandleProps {
|
|
4
4
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
5
|
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (
|
|
7
|
-
onWidthResizeEnd?: (
|
|
6
|
+
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
+
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
8
|
}
|
|
9
9
|
export declare function RightResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: RightResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=right_resize_handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"right_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"right_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CACtE;AACD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,sBAAsB,2CA0BxB"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import '../../right_resize_handle.css';const z = "_right-resize-handle_7f232b9",
|
|
2
|
+
import { clsx as f } from "clsx";
|
|
3
|
+
import { createHorizontalResizeHandler as c } from "./resize_handlers.js";
|
|
4
|
+
import '../../right_resize_handle.css';const z = "_right-resize-handle_7f232b9", h = { "right-resize-handle": z };
|
|
5
5
|
function m({
|
|
6
6
|
targetRef: t,
|
|
7
7
|
handleProps: e,
|
|
8
8
|
onWidthResize: i,
|
|
9
9
|
onWidthResizeEnd: s
|
|
10
10
|
}) {
|
|
11
|
-
const r =
|
|
11
|
+
const r = c(
|
|
12
12
|
t,
|
|
13
13
|
i,
|
|
14
14
|
s,
|
|
15
|
+
"right",
|
|
15
16
|
!1,
|
|
16
17
|
!0
|
|
17
18
|
), n = e?.offset ? e.offset : -8, o = {
|
|
@@ -22,7 +23,7 @@ function m({
|
|
|
22
23
|
return /* @__PURE__ */ l(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
|
-
className:
|
|
26
|
+
className: f(h["right-resize-handle"], "tcn-right-resize-handle"),
|
|
26
27
|
onMouseDown: r,
|
|
27
28
|
style: o,
|
|
28
29
|
children: e?.children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"right_resize_handle.js","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"sourcesContent":["import React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './right_resize_handle.module.css';\
|
|
1
|
+
{"version":3,"file":"right_resize_handle.js","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './right_resize_handle.module.css';\n\nexport interface RightResizeHandleProps {\n targetRef: React.MutableRefObject<HTMLElement | null>;\n handleProps?: HandleProps;\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;\n}\nexport function RightResizeHandle({\n targetRef,\n handleProps,\n onWidthResize,\n onWidthResizeEnd,\n}: RightResizeHandleProps) {\n const resizeHandler = createHorizontalResizeHandler(\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n 'right',\n false,\n true\n );\n const offset = handleProps?.offset ? handleProps.offset : -8;\n\n const rightResizeHandleStyle: any = {\n ...handleProps?.style,\n '--resize-offset': `${offset}px`,\n width: handleProps?.size || '16px',\n };\n\n return (\n <div\n className={clsx(styles['right-resize-handle'], 'tcn-right-resize-handle')}\n onMouseDown={resizeHandler}\n style={rightResizeHandleStyle}\n >\n {handleProps?.children}\n </div>\n );\n}\n"],"names":["RightResizeHandle","targetRef","handleProps","onWidthResize","onWidthResizeEnd","resizeHandler","createHorizontalResizeHandler","offset","rightResizeHandleStyle","jsx","clsx","styles"],"mappings":";;;;AAiBO,SAASA,EAAkB;AAAA,EAChC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AACF,GAA2B;AACzB,QAAMC,IAAgBC;AAAA,IACpBL;AAAA,IACAE;AAAA,IACAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEIG,IAASL,GAAa,SAASA,EAAY,SAAS,IAEpDM,IAA8B;AAAA,IAClC,GAAGN,GAAa;AAAA,IAChB,mBAAmB,GAAGK,CAAM;AAAA,IAC5B,OAAOL,GAAa,QAAQ;AAAA,EAAA;AAG9B,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,qBAAqB,GAAG,yBAAyB;AAAA,MACxE,aAAaN;AAAA,MACb,OAAOG;AAAA,MAEN,UAAAN,GAAa;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|
|
@@ -3,8 +3,8 @@ import { HandleProps } from './handle_props.js';
|
|
|
3
3
|
export interface StartResizeHandleProps {
|
|
4
4
|
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
5
|
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (
|
|
7
|
-
onWidthResizeEnd?: (
|
|
6
|
+
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
+
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
8
|
}
|
|
9
9
|
export declare function StartResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: StartResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=start_resize_handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CACtE;AACD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,sBAAsB,2CAwBxB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import '../../start_resize_handle.css';const
|
|
2
|
+
import { clsx as l } from "clsx";
|
|
3
|
+
import { createHorizontalResizeHandler as f } from "./resize_handlers.js";
|
|
4
|
+
import '../../start_resize_handle.css';const c = "_start-resize-handle_22a3d5a", z = { "start-resize-handle": c };
|
|
5
5
|
function x({
|
|
6
6
|
targetRef: t,
|
|
7
7
|
handleProps: e,
|
|
8
8
|
onWidthResize: s,
|
|
9
9
|
onWidthResizeEnd: r
|
|
10
10
|
}) {
|
|
11
|
-
const i =
|
|
11
|
+
const i = f(
|
|
12
12
|
t,
|
|
13
13
|
s,
|
|
14
14
|
r,
|
|
15
|
-
|
|
15
|
+
"left"
|
|
16
16
|
), n = e?.offset ? e.offset : -8, a = {
|
|
17
17
|
...e?.style,
|
|
18
18
|
"--resize-offset": `${n}px`,
|
|
@@ -21,7 +21,7 @@ function x({
|
|
|
21
21
|
return /* @__PURE__ */ o(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
|
-
className:
|
|
24
|
+
className: l(z["start-resize-handle"], "tcn-start-resize-handle"),
|
|
25
25
|
onMouseDown: i,
|
|
26
26
|
style: a,
|
|
27
27
|
children: e?.children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_resize_handle.js","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"sourcesContent":["import React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './start_resize_handle.module.css';\
|
|
1
|
+
{"version":3,"file":"start_resize_handle.js","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { HandleProps } from './handle_props.js';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './start_resize_handle.module.css';\n\nexport interface StartResizeHandleProps {\n targetRef: React.MutableRefObject<HTMLElement | null>;\n handleProps?: HandleProps;\n onWidthResize?: (\n width: number,\n origin: 'left' | 'right',\n totalDelta: number,\n currentDelta: number\n ) => void;\n onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;\n}\nexport function StartResizeHandle({\n targetRef,\n handleProps,\n onWidthResize,\n onWidthResizeEnd,\n}: StartResizeHandleProps) {\n const resizeHandler = createHorizontalResizeHandler(\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n 'left'\n );\n const offset = handleProps?.offset ? handleProps.offset : -8;\n\n const startResizeHandleStyle: any = {\n ...handleProps?.style,\n '--resize-offset': `${offset}px`,\n width: handleProps?.size || '16px',\n };\n\n return (\n <div\n className={clsx(styles['start-resize-handle'], 'tcn-start-resize-handle')}\n onMouseDown={resizeHandler}\n style={startResizeHandleStyle}\n >\n {handleProps?.children}\n </div>\n );\n}\n"],"names":["StartResizeHandle","targetRef","handleProps","onWidthResize","onWidthResizeEnd","resizeHandler","createHorizontalResizeHandler","offset","startResizeHandleStyle","jsx","clsx","styles"],"mappings":";;;;AAiBO,SAASA,EAAkB;AAAA,EAChC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AACF,GAA2B;AACzB,QAAMC,IAAgBC;AAAA,IACpBL;AAAA,IACAE;AAAA,IACAC;AAAA,IACA;AAAA,EAAA,GAEIG,IAASL,GAAa,SAASA,EAAY,SAAS,IAEpDM,IAA8B;AAAA,IAClC,GAAGN,GAAa;AAAA,IAChB,mBAAmB,GAAGK,CAAM;AAAA,IAC5B,OAAOL,GAAa,QAAQ;AAAA,EAAA;AAG9B,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,qBAAqB,GAAG,yBAAyB;AAAA,MACxE,aAAaN;AAAA,MACb,OAAOG;AAAA,MAEN,UAAAN,GAAa;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|