@tcn/ui 0.16.0 → 0.17.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/card.css +1 -0
- package/dist/column.css +1 -1
- package/dist/containers.css +1 -1
- package/dist/containers.module-BmICKsOK.js +5 -0
- package/dist/containers.module-BmICKsOK.js.map +1 -0
- package/dist/form/field/field.js +11 -8
- package/dist/form/field/field.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +5 -2
- package/dist/inputs/color_input/color_picker.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +18 -15
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/date_picker/date_picker.js +13 -10
- package/dist/inputs/date_picker/date_picker.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +20 -17
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +5 -2
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/mask_input/key_capture_input.js +26 -23
- package/dist/inputs/mask_input/key_capture_input.js.map +1 -1
- package/dist/inputs/mask_input/mask_input.js +5 -2
- package/dist/inputs/mask_input/mask_input.js.map +1 -1
- package/dist/inputs/multiselect/multiselect.js +22 -19
- package/dist/inputs/multiselect/multiselect.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.js +7 -4
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -1
- package/dist/inputs/select/select.js +5 -2
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/slider/slider.js +19 -16
- package/dist/inputs/slider/slider.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +5 -2
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/switch/switch.js +18 -15
- package/dist/inputs/switch/switch.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +15 -12
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/layouts/containers/columns/columns.d.ts +6 -1
- package/dist/layouts/containers/columns/columns.d.ts.map +1 -1
- package/dist/layouts/containers/columns/columns.js +30 -7
- package/dist/layouts/containers/columns/columns.js.map +1 -1
- package/dist/layouts/containers/rail.d.ts +2 -5
- package/dist/layouts/containers/rail.d.ts.map +1 -1
- package/dist/layouts/containers/rail.js +17 -55
- package/dist/layouts/containers/rail.js.map +1 -1
- package/dist/layouts/containers/rows/index.d.ts +3 -0
- package/dist/layouts/containers/rows/index.d.ts.map +1 -0
- package/dist/layouts/containers/rows/index.js +7 -0
- package/dist/layouts/containers/rows/index.js.map +1 -0
- package/dist/layouts/containers/rows/row.d.ts +6 -0
- package/dist/layouts/containers/rows/row.d.ts.map +1 -0
- package/dist/layouts/containers/rows/row.js +20 -0
- package/dist/layouts/containers/rows/row.js.map +1 -0
- package/dist/layouts/containers/rows/rows.d.ts +11 -0
- package/dist/layouts/containers/rows/rows.d.ts.map +1 -0
- package/dist/layouts/containers/rows/rows.js +34 -0
- package/dist/layouts/containers/rows/rows.js.map +1 -0
- package/dist/layouts/containers/scaffold.d.ts +2 -5
- package/dist/layouts/containers/scaffold.d.ts.map +1 -1
- package/dist/layouts/containers/scaffold.js +17 -55
- package/dist/layouts/containers/scaffold.js.map +1 -1
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +26 -22
- package/dist/layouts/index.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js +5 -2
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js +5 -2
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js +8 -5
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js.map +1 -1
- package/dist/navigation/tabs/state/link/tab_link.js +9 -6
- package/dist/navigation/tabs/state/link/tab_link.js.map +1 -1
- package/dist/overlay/menu/menu.js +3 -0
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/popper/context_popper.js +8 -5
- package/dist/overlay/popper/context_popper.js.map +1 -1
- package/dist/overlay/popper/element_popper.js +9 -6
- package/dist/overlay/popper/element_popper.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +13 -10
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/overlay/popper/preview_popper.js +10 -7
- package/dist/overlay/popper/preview_popper.js.map +1 -1
- package/dist/overlay/tethered/tethered.js +11 -8
- package/dist/overlay/tethered/tethered.js.map +1 -1
- package/dist/resizable.css +1 -0
- package/dist/resizable.module-I6iyBAvM.js +5 -0
- package/dist/resizable.module-I6iyBAvM.js.map +1 -0
- package/dist/resize_handle.css +1 -0
- package/dist/row.css +1 -0
- package/dist/stacks/box/box.js +12 -9
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/detect_resize_bounds.d.ts +1 -0
- package/dist/stacks/box/detect_resize_bounds.d.ts.map +1 -1
- package/dist/stacks/box/detect_resize_bounds.js +22 -20
- package/dist/stacks/box/detect_resize_bounds.js.map +1 -1
- package/dist/stacks/h_collapsible_box.js +17 -14
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +19 -16
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/card/card.d.ts.map +1 -1
- package/dist/surfaces/card/card.js +14 -6
- package/dist/surfaces/card/card.js.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.js +4 -2
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +10 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/themes/theme.d.ts.map +1 -1
- package/dist/themes/theme.js +17 -22
- package/dist/themes/theme.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +201 -21
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +39 -26
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/resize/context.d.ts +4 -0
- package/dist/utils/resize/context.d.ts.map +1 -0
- package/dist/utils/resize/context.js +10 -0
- package/dist/utils/resize/context.js.map +1 -0
- package/dist/utils/resize/handle_config.d.ts +32 -0
- package/dist/utils/resize/handle_config.d.ts.map +1 -0
- package/dist/utils/resize/handle_config.js +85 -0
- package/dist/utils/resize/handle_config.js.map +1 -0
- package/dist/utils/resize/index.d.ts +10 -0
- package/dist/utils/resize/index.d.ts.map +1 -0
- package/dist/utils/resize/index.js +16 -0
- package/dist/utils/resize/index.js.map +1 -0
- package/dist/utils/resize/resizable.d.ts +11 -0
- package/dist/utils/resize/resizable.d.ts.map +1 -0
- package/dist/utils/resize/resizable.js +52 -0
- package/dist/utils/resize/resizable.js.map +1 -0
- package/dist/utils/resize/resize_handle.d.ts +7 -0
- package/dist/utils/resize/resize_handle.d.ts.map +1 -0
- package/dist/utils/resize/resize_handle.js +100 -0
- package/dist/utils/resize/resize_handle.js.map +1 -0
- package/dist/utils/resize/resize_strategy.d.ts +47 -0
- package/dist/utils/resize/resize_strategy.d.ts.map +1 -0
- package/dist/utils/resize/resize_strategy.js +108 -0
- package/dist/utils/resize/resize_strategy.js.map +1 -0
- package/dist/utils/resize/types.d.ts +28 -0
- package/dist/utils/resize/types.d.ts.map +1 -0
- package/dist/utils/resize/types.js +2 -0
- package/dist/utils/resize/types.js.map +1 -0
- package/package.json +3 -3
- package/src/layouts/__stories__/columns.stories.tsx +31 -0
- package/src/layouts/__stories__/composed.stories.tsx +77 -8
- package/src/layouts/__stories__/rows.stories.tsx +77 -0
- package/src/layouts/__stories__/utils.tsx +2 -84
- package/src/layouts/containers/columns/column.module.css +3 -2
- package/src/layouts/containers/columns/columns.tsx +29 -3
- package/src/layouts/containers/containers.module.css +27 -29
- package/src/layouts/containers/rail.tsx +9 -51
- package/src/layouts/containers/rows/index.ts +2 -0
- package/src/layouts/containers/rows/row.module.css +15 -0
- package/src/layouts/containers/rows/row.tsx +22 -0
- package/src/layouts/containers/rows/rows.tsx +42 -0
- package/src/layouts/containers/scaffold.tsx +9 -49
- package/src/layouts/index.ts +2 -0
- package/src/stacks/box/detect_resize_bounds.ts +5 -1
- package/src/surfaces/card/card.module.css +5 -0
- package/src/surfaces/card/card.stories.tsx +66 -8
- package/src/surfaces/card/card.tsx +6 -2
- package/src/surfaces/page/page.stories.tsx +84 -4
- package/src/surfaces/panel/__stories__/panel.stories.tsx +84 -9
- package/src/test-setup.ts +11 -0
- package/src/themes/theme.tsx +6 -16
- package/src/themes/themes/ergo/ergo_theme.css +199 -19
- package/src/utils/index.ts +2 -0
- package/src/utils/resize/__stories__/resizable.stories.tsx +214 -0
- package/src/utils/resize/__stories__/resizable_stories.module.css +47 -0
- package/src/utils/resize/__tests__/handle_config.test.ts +269 -0
- package/src/utils/resize/__tests__/resize_strategy.test.ts +163 -0
- package/src/utils/resize/context.ts +9 -0
- package/src/utils/resize/handle_config.ts +142 -0
- package/src/utils/resize/index.ts +37 -0
- package/src/utils/resize/resizable.module.css +5 -0
- package/src/utils/resize/resizable.tsx +97 -0
- package/src/utils/resize/resize_handle.module.css +146 -0
- package/src/utils/resize/resize_handle.tsx +165 -0
- package/src/utils/resize/resize_strategy.ts +190 -0
- package/src/utils/resize/types.ts +64 -0
- package/dist/containers.module-DlGySre0.js +0 -5
- package/dist/containers.module-DlGySre0.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import o, { useRef as b, useMemo as R } from "react";
|
|
3
|
+
import { clsx as g } from "clsx";
|
|
4
|
+
import { useForkRef as x } from "../hooks/use_fork_ref.js";
|
|
5
|
+
import { ResizableContext as u } from "./context.js";
|
|
6
|
+
import { s as v } from "../../resizable.module-I6iyBAvM.js";
|
|
7
|
+
function m(e) {
|
|
8
|
+
if (!o.isValidElement(e)) return !1;
|
|
9
|
+
const r = e.type;
|
|
10
|
+
return typeof r == "string" ? !0 : typeof r == "function" || typeof r == "object" ? r.displayName !== "ResizeHandle" : !1;
|
|
11
|
+
}
|
|
12
|
+
function C(e) {
|
|
13
|
+
return o.isValidElement(e) && !m(e);
|
|
14
|
+
}
|
|
15
|
+
function P({
|
|
16
|
+
children: e,
|
|
17
|
+
onWidthResize: r,
|
|
18
|
+
onWidthResizeEnd: s,
|
|
19
|
+
onHeightResize: n,
|
|
20
|
+
onHeightResizeEnd: a
|
|
21
|
+
}) {
|
|
22
|
+
const l = b(null), f = o.Children.toArray(e), t = f.find(m), p = f.filter(C), i = R(
|
|
23
|
+
() => ({
|
|
24
|
+
targetRef: l,
|
|
25
|
+
onWidthResize: r,
|
|
26
|
+
onWidthResizeEnd: s,
|
|
27
|
+
onHeightResize: n,
|
|
28
|
+
onHeightResizeEnd: a
|
|
29
|
+
}),
|
|
30
|
+
[r, s, n, a]
|
|
31
|
+
), d = x(l, t?.props.ref);
|
|
32
|
+
if (!t)
|
|
33
|
+
return /* @__PURE__ */ c(u.Provider, { value: i, children: e });
|
|
34
|
+
const y = o.cloneElement(
|
|
35
|
+
t,
|
|
36
|
+
{
|
|
37
|
+
ref: d,
|
|
38
|
+
className: g(
|
|
39
|
+
t.props.className,
|
|
40
|
+
v["resizable-target"],
|
|
41
|
+
"tcn-resizable-target"
|
|
42
|
+
)
|
|
43
|
+
},
|
|
44
|
+
t.props.children,
|
|
45
|
+
...p
|
|
46
|
+
);
|
|
47
|
+
return /* @__PURE__ */ c(u.Provider, { value: i, children: y });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
P as Resizable
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=resizable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.js","sources":["../../../src/utils/resize/resizable.tsx"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useForkRef } from '../hooks/use_fork_ref.js';\nimport { ResizableContext } from './context.js';\nimport type {\n OnWidthResize,\n OnWidthResizeEnd,\n OnHeightResize,\n OnHeightResizeEnd,\n ResizableContextValue,\n} from './types.js';\nimport styles from './resizable.module.css';\n\nexport interface ResizableProps {\n children: React.ReactNode;\n onWidthResize?: OnWidthResize;\n onWidthResizeEnd?: OnWidthResizeEnd;\n onHeightResize?: OnHeightResize;\n onHeightResizeEnd?: OnHeightResizeEnd;\n}\n\ninterface ResizableTargetProps {\n className?: string;\n children?: React.ReactNode;\n ref?: React.Ref<HTMLElement>;\n}\n\ntype ResizableTarget = React.ReactElement<ResizableTargetProps>;\n\nfunction isResizableTarget(child: React.ReactNode): child is ResizableTarget {\n if (!React.isValidElement(child)) return false;\n const type = child.type;\n if (typeof type === 'string') return true;\n if (typeof type === 'function' || typeof type === 'object') {\n return (type as { displayName?: string }).displayName !== 'ResizeHandle';\n }\n return false;\n}\n\nfunction isResizeHandle(child: React.ReactNode): boolean {\n return React.isValidElement(child) && !isResizableTarget(child);\n}\n\nexport function Resizable({\n children,\n onWidthResize,\n onWidthResizeEnd,\n onHeightResize,\n onHeightResizeEnd,\n}: ResizableProps) {\n const targetRef = useRef<HTMLElement | null>(null);\n\n const childArray = React.Children.toArray(children);\n const targetChild = childArray.find(isResizableTarget);\n const handleChildren = childArray.filter(isResizeHandle);\n\n const contextValue = useMemo<ResizableContextValue>(\n () => ({\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n onHeightResize,\n onHeightResizeEnd,\n }),\n [onWidthResize, onWidthResizeEnd, onHeightResize, onHeightResizeEnd]\n );\n\n const forkedRef = useForkRef(targetRef, targetChild?.props.ref);\n\n if (!targetChild) {\n return (\n <ResizableContext.Provider value={contextValue}>\n {children}\n </ResizableContext.Provider>\n );\n }\n\n const clonedTarget = React.cloneElement(\n targetChild,\n {\n ref: forkedRef,\n className: clsx(\n targetChild.props.className,\n styles['resizable-target'],\n 'tcn-resizable-target'\n ),\n },\n targetChild.props.children,\n ...handleChildren\n );\n\n return (\n <ResizableContext.Provider value={contextValue}>\n {clonedTarget}\n </ResizableContext.Provider>\n );\n}\n"],"names":["isResizableTarget","child","React","type","isResizeHandle","Resizable","children","onWidthResize","onWidthResizeEnd","onHeightResize","onHeightResizeEnd","targetRef","useRef","childArray","targetChild","handleChildren","contextValue","useMemo","forkedRef","useForkRef","ResizableContext","clonedTarget","clsx","styles"],"mappings":";;;;;;AA6BA,SAASA,EAAkBC,GAAkD;AAC3E,MAAI,CAACC,EAAM,eAAeD,CAAK,EAAG,QAAO;AACzC,QAAME,IAAOF,EAAM;AACnB,SAAI,OAAOE,KAAS,WAAiB,KACjC,OAAOA,KAAS,cAAc,OAAOA,KAAS,WACxCA,EAAkC,gBAAgB,iBAErD;AACT;AAEA,SAASC,EAAeH,GAAiC;AACvD,SAAOC,EAAM,eAAeD,CAAK,KAAK,CAACD,EAAkBC,CAAK;AAChE;AAEO,SAASI,EAAU;AAAA,EACxB,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,GAAmB;AACjB,QAAMC,IAAYC,EAA2B,IAAI,GAE3CC,IAAaX,EAAM,SAAS,QAAQI,CAAQ,GAC5CQ,IAAcD,EAAW,KAAKb,CAAiB,GAC/Ce,IAAiBF,EAAW,OAAOT,CAAc,GAEjDY,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,WAAAN;AAAA,MACA,eAAAJ;AAAA,MACA,kBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,IAAA;AAAA,IAEF,CAACH,GAAeC,GAAkBC,GAAgBC,CAAiB;AAAA,EAAA,GAG/DQ,IAAYC,EAAWR,GAAWG,GAAa,MAAM,GAAG;AAE9D,MAAI,CAACA;AACH,6BACGM,EAAiB,UAAjB,EAA0B,OAAOJ,GAC/B,UAAAV,GACH;AAIJ,QAAMe,IAAenB,EAAM;AAAA,IACzBY;AAAA,IACA;AAAA,MACE,KAAKI;AAAA,MACL,WAAWI;AAAA,QACTR,EAAY,MAAM;AAAA,QAClBS,EAAO,kBAAkB;AAAA,QACzB;AAAA,MAAA;AAAA,IACF;AAAA,IAEFT,EAAY,MAAM;AAAA,IAClB,GAAGC;AAAA,EAAA;AAGL,2BACGK,EAAiB,UAAjB,EAA0B,OAAOJ,GAC/B,UAAAK,GACH;AAEJ;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ResizeHandlePosition } from './types.js';
|
|
3
|
+
export interface ResizeHandleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
position: ResizeHandlePosition;
|
|
5
|
+
}
|
|
6
|
+
export declare const ResizeHandle: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
//# sourceMappingURL=resize_handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize_handle.d.ts","sourceRoot":"","sources":["../../../src/utils/resize/resize_handle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,eAAO,MAAM,YAAY,0FAqJxB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as H, useMemo as E } from "react";
|
|
3
|
+
import { clsx as L } from "clsx";
|
|
4
|
+
import { useResizable as $ } from "./context.js";
|
|
5
|
+
import { getHandleConfig as A } from "./handle_config.js";
|
|
6
|
+
import { ResizeHandleStrategy as C } from "./resize_strategy.js";
|
|
7
|
+
import { detectResizeBounds as p } from "../../stacks/box/detect_resize_bounds.js";
|
|
8
|
+
import '../../resize_handle.css';const F = "_resize-handle_287f4e0", M = { "resize-handle": F }, W = H(
|
|
9
|
+
function({ position: o, className: w, ...v }, f) {
|
|
10
|
+
const {
|
|
11
|
+
targetRef: D,
|
|
12
|
+
onWidthResize: m,
|
|
13
|
+
onWidthResizeEnd: S,
|
|
14
|
+
onHeightResize: u,
|
|
15
|
+
onHeightResizeEnd: R
|
|
16
|
+
} = $(), h = A(o), x = h.horizontal && h.vertical ? "corner" : h.horizontal ? "horizontal" : "vertical", a = E(() => new C(o), [o]), y = (r) => {
|
|
17
|
+
const n = D.current;
|
|
18
|
+
if (n == null) return;
|
|
19
|
+
const l = n.getBoundingClientRect();
|
|
20
|
+
a.startResize({
|
|
21
|
+
rectangle: {
|
|
22
|
+
dimensions: {
|
|
23
|
+
width: l.width,
|
|
24
|
+
height: l.height
|
|
25
|
+
},
|
|
26
|
+
position: {
|
|
27
|
+
x: r.clientX,
|
|
28
|
+
y: r.clientY
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
languageDirection: window.getComputedStyle(n).direction
|
|
32
|
+
});
|
|
33
|
+
let z = 0;
|
|
34
|
+
const g = (i) => {
|
|
35
|
+
i.stopPropagation(), i.preventDefault(), cancelAnimationFrame(z), z = requestAnimationFrame(() => {
|
|
36
|
+
const e = a.resize({ x: i.clientX, y: i.clientY });
|
|
37
|
+
let s = l.width, d = l.height;
|
|
38
|
+
if (e.horizontal) {
|
|
39
|
+
const t = p({
|
|
40
|
+
element: n,
|
|
41
|
+
axis: "width",
|
|
42
|
+
nextSize: e.horizontal.newSize
|
|
43
|
+
});
|
|
44
|
+
t.clamped ? t.clampedSize !== null && t.clampedSize !== s && (s = t.clampedSize, n.style.width = `${t.clampedSize}px`, m?.({
|
|
45
|
+
width: t.clampedSize,
|
|
46
|
+
origin: e.horizontal.origin,
|
|
47
|
+
totalDelta: e.horizontal.totalDelta,
|
|
48
|
+
currentDelta: e.horizontal.currentDelta
|
|
49
|
+
})) : (s = e.horizontal.newSize, n.style.width = `${e.horizontal.newSize}px`, m?.({
|
|
50
|
+
width: e.horizontal.newSize,
|
|
51
|
+
origin: e.horizontal.origin,
|
|
52
|
+
totalDelta: e.horizontal.totalDelta,
|
|
53
|
+
currentDelta: e.horizontal.currentDelta
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
if (e.vertical) {
|
|
57
|
+
const t = p({
|
|
58
|
+
element: n,
|
|
59
|
+
axis: "height",
|
|
60
|
+
nextSize: e.vertical.newSize
|
|
61
|
+
});
|
|
62
|
+
t.clamped ? t.clampedSize !== null && t.clampedSize !== d && (d = t.clampedSize, n.style.height = `${t.clampedSize}px`, u?.({
|
|
63
|
+
height: t.clampedSize,
|
|
64
|
+
origin: e.vertical.origin,
|
|
65
|
+
totalDelta: e.vertical.totalDelta,
|
|
66
|
+
currentDelta: e.vertical.currentDelta
|
|
67
|
+
})) : (d = e.vertical.newSize, n.style.height = `${e.vertical.newSize}px`, u?.({
|
|
68
|
+
height: e.vertical.newSize,
|
|
69
|
+
origin: e.vertical.origin,
|
|
70
|
+
totalDelta: e.vertical.totalDelta,
|
|
71
|
+
currentDelta: e.vertical.currentDelta
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
a.commitResize({ width: s, height: d });
|
|
75
|
+
});
|
|
76
|
+
}, c = () => {
|
|
77
|
+
cancelAnimationFrame(z), document.body.removeEventListener("mousemove", g), document.body.removeEventListener("mouseup", c), window.removeEventListener("blur", c);
|
|
78
|
+
const i = a.endResize();
|
|
79
|
+
i.horizontal && S?.(i.horizontal.width, i.horizontal.origin), i.vertical && R?.(i.vertical.height, i.vertical.origin);
|
|
80
|
+
};
|
|
81
|
+
document.body.addEventListener("mousemove", g), document.body.addEventListener("mouseup", c), window.addEventListener("blur", c), r.stopPropagation(), r.preventDefault();
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ b(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref: f,
|
|
87
|
+
className: L(M["resize-handle"], "tcn-resize-handle", w),
|
|
88
|
+
"data-position": o,
|
|
89
|
+
"data-axis": x,
|
|
90
|
+
onMouseDown: y,
|
|
91
|
+
...v
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
W.displayName = "ResizeHandle";
|
|
97
|
+
export {
|
|
98
|
+
W as ResizeHandle
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=resize_handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize_handle.js","sources":["../../../src/utils/resize/resize_handle.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\nimport { clsx } from 'clsx';\nimport { useResizable } from './context.js';\nimport { getHandleConfig } from './handle_config.js';\nimport { ResizeHandleStrategy } from './resize_strategy.js';\nimport { detectResizeBounds } from '../../stacks/box/detect_resize_bounds.js';\nimport type { ResizeHandlePosition } from './types.js';\nimport styles from './resize_handle.module.css';\n\nexport interface ResizeHandleProps extends React.HTMLAttributes<HTMLDivElement> {\n position: ResizeHandlePosition;\n}\n\nexport const ResizeHandle = forwardRef<HTMLDivElement, ResizeHandleProps>(\n function ResizeHandle({ position, className, ...rest }, ref) {\n const {\n targetRef,\n onWidthResize,\n onWidthResizeEnd,\n onHeightResize,\n onHeightResizeEnd,\n } = useResizable();\n\n const config = getHandleConfig(position);\n const axis =\n config.horizontal && config.vertical\n ? 'corner'\n : config.horizontal\n ? 'horizontal'\n : 'vertical';\n\n const strategy = useMemo(() => new ResizeHandleStrategy(position), [position]);\n\n const handleMouseDown = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = targetRef.current;\n if (target == null) return;\n\n const rect = target.getBoundingClientRect();\n strategy.startResize({\n rectangle: {\n dimensions: {\n width: rect.width,\n height: rect.height,\n },\n position: {\n x: event.clientX,\n y: event.clientY,\n },\n },\n languageDirection: window.getComputedStyle(target).direction,\n });\n\n let frameId = 0;\n\n const drag = (e: MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n\n cancelAnimationFrame(frameId);\n frameId = requestAnimationFrame(() => {\n const result = strategy.resize({ x: e.clientX, y: e.clientY });\n\n let appliedWidth = rect.width;\n let appliedHeight = rect.height;\n\n if (result.horizontal) {\n const bounds = detectResizeBounds({\n element: target,\n axis: 'width',\n nextSize: result.horizontal.newSize,\n });\n if (!bounds.clamped) {\n appliedWidth = result.horizontal.newSize;\n target.style.width = `${result.horizontal.newSize}px`;\n onWidthResize?.({\n width: result.horizontal.newSize,\n origin: result.horizontal.origin,\n totalDelta: result.horizontal.totalDelta,\n currentDelta: result.horizontal.currentDelta,\n });\n } else if (\n bounds.clampedSize !== null &&\n bounds.clampedSize !== appliedWidth\n ) {\n appliedWidth = bounds.clampedSize;\n target.style.width = `${bounds.clampedSize}px`;\n onWidthResize?.({\n width: bounds.clampedSize,\n origin: result.horizontal.origin,\n totalDelta: result.horizontal.totalDelta,\n currentDelta: result.horizontal.currentDelta,\n });\n }\n }\n\n if (result.vertical) {\n const bounds = detectResizeBounds({\n element: target,\n axis: 'height',\n nextSize: result.vertical.newSize,\n });\n if (!bounds.clamped) {\n appliedHeight = result.vertical.newSize;\n target.style.height = `${result.vertical.newSize}px`;\n onHeightResize?.({\n height: result.vertical.newSize,\n origin: result.vertical.origin,\n totalDelta: result.vertical.totalDelta,\n currentDelta: result.vertical.currentDelta,\n });\n } else if (\n bounds.clampedSize !== null &&\n bounds.clampedSize !== appliedHeight\n ) {\n appliedHeight = bounds.clampedSize;\n target.style.height = `${bounds.clampedSize}px`;\n onHeightResize?.({\n height: bounds.clampedSize,\n origin: result.vertical.origin,\n totalDelta: result.vertical.totalDelta,\n currentDelta: result.vertical.currentDelta,\n });\n }\n }\n\n strategy.commitResize({ width: appliedWidth, height: appliedHeight });\n });\n };\n\n const endDrag = () => {\n cancelAnimationFrame(frameId);\n document.body.removeEventListener('mousemove', drag);\n document.body.removeEventListener('mouseup', endDrag);\n window.removeEventListener('blur', endDrag);\n\n const result = strategy.endResize();\n if (result.horizontal) {\n onWidthResizeEnd?.(result.horizontal.width, result.horizontal.origin);\n }\n if (result.vertical) {\n onHeightResizeEnd?.(result.vertical.height, result.vertical.origin);\n }\n };\n\n document.body.addEventListener('mousemove', drag);\n document.body.addEventListener('mouseup', endDrag);\n window.addEventListener('blur', endDrag);\n event.stopPropagation();\n event.preventDefault();\n };\n\n return (\n <div\n ref={ref}\n className={clsx(styles['resize-handle'], 'tcn-resize-handle', className)}\n data-position={position}\n data-axis={axis}\n onMouseDown={handleMouseDown}\n {...rest}\n />\n );\n }\n);\n\nResizeHandle.displayName = 'ResizeHandle';\n"],"names":["ResizeHandle","forwardRef","position","className","rest","ref","targetRef","onWidthResize","onWidthResizeEnd","onHeightResize","onHeightResizeEnd","useResizable","config","getHandleConfig","axis","strategy","useMemo","ResizeHandleStrategy","handleMouseDown","event","target","rect","frameId","drag","e","result","appliedWidth","appliedHeight","bounds","detectResizeBounds","endDrag","jsx","clsx","styles"],"mappings":"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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ResizeHandlePosition, WidthResizeOrigin, HeightResizeOrigin } from './types.js';
|
|
2
|
+
import { Dimensions, Position, Rectangle } from '../types/dimensions.js';
|
|
3
|
+
export interface StartResizeParams {
|
|
4
|
+
rectangle: Rectangle;
|
|
5
|
+
languageDirection: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AxisResizeResult {
|
|
8
|
+
newSize: number;
|
|
9
|
+
totalDelta: number;
|
|
10
|
+
currentDelta: number;
|
|
11
|
+
}
|
|
12
|
+
export interface HorizontalResizeResult extends AxisResizeResult {
|
|
13
|
+
origin: WidthResizeOrigin;
|
|
14
|
+
}
|
|
15
|
+
export interface VerticalResizeResult extends AxisResizeResult {
|
|
16
|
+
origin: HeightResizeOrigin;
|
|
17
|
+
}
|
|
18
|
+
export interface ResizeResult {
|
|
19
|
+
horizontal?: HorizontalResizeResult;
|
|
20
|
+
vertical?: VerticalResizeResult;
|
|
21
|
+
}
|
|
22
|
+
export interface EndResizeResult {
|
|
23
|
+
horizontal?: {
|
|
24
|
+
width: number;
|
|
25
|
+
origin: WidthResizeOrigin;
|
|
26
|
+
};
|
|
27
|
+
vertical?: {
|
|
28
|
+
height: number;
|
|
29
|
+
origin: HeightResizeOrigin;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Flow:
|
|
34
|
+
* 1. adapter calls startResize() with rect/coords from DOM
|
|
35
|
+
* 2. adapter calls resize() on each mousemove with coord
|
|
36
|
+
* 3. adapter checks bounds (DOM), applies style, then calls commitResize()
|
|
37
|
+
* 4. adapter calls endResize() on mouseup to get final state
|
|
38
|
+
*/
|
|
39
|
+
export declare class ResizeHandleStrategy {
|
|
40
|
+
private handlers;
|
|
41
|
+
constructor(position: ResizeHandlePosition);
|
|
42
|
+
startResize(params: StartResizeParams): void;
|
|
43
|
+
resize(position: Position): ResizeResult;
|
|
44
|
+
commitResize(dimensions: Dimensions): void;
|
|
45
|
+
endResize(): EndResizeResult;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=resize_strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize_strategy.d.ts","sourceRoot":"","sources":["../../../src/utils/resize/resize_strategy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAC1D,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAC3D;AA6GD;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAsB;gBAE1B,QAAQ,EAAE,oBAAoB;IAW1C,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAM5C,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY;IAIxC,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAM1C,SAAS,IAAI,eAAe;CAG7B"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { getHandleConfig as s, resolveDirection as n, computeResizeState as o } from "./handle_config.js";
|
|
2
|
+
class r {
|
|
3
|
+
constructor(i) {
|
|
4
|
+
this.axisConfig = i;
|
|
5
|
+
}
|
|
6
|
+
direction = 1;
|
|
7
|
+
startSize = 0;
|
|
8
|
+
startCoord = 0;
|
|
9
|
+
currentSize = 0;
|
|
10
|
+
get origin() {
|
|
11
|
+
return this.axisConfig.origin;
|
|
12
|
+
}
|
|
13
|
+
get size() {
|
|
14
|
+
return this.currentSize;
|
|
15
|
+
}
|
|
16
|
+
start(i, t) {
|
|
17
|
+
this.direction = n(
|
|
18
|
+
t,
|
|
19
|
+
this.axisConfig.invert,
|
|
20
|
+
this.axisConfig.disableDirection
|
|
21
|
+
), this.startSize = this.extractSize(i.dimensions), this.startCoord = this.extractCoord(i.position), this.currentSize = this.startSize;
|
|
22
|
+
}
|
|
23
|
+
resize(i) {
|
|
24
|
+
return o(
|
|
25
|
+
this.startSize,
|
|
26
|
+
this.startCoord,
|
|
27
|
+
this.extractCoord(i),
|
|
28
|
+
this.direction,
|
|
29
|
+
this.currentSize
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
commit(i) {
|
|
33
|
+
this.currentSize = this.extractSize(i);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class a extends r {
|
|
37
|
+
extractSize(i) {
|
|
38
|
+
return i.width;
|
|
39
|
+
}
|
|
40
|
+
extractCoord(i) {
|
|
41
|
+
return i.x;
|
|
42
|
+
}
|
|
43
|
+
applyResize(i) {
|
|
44
|
+
return {
|
|
45
|
+
horizontal: {
|
|
46
|
+
...this.resize(i),
|
|
47
|
+
origin: this.origin
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
applyEnd() {
|
|
52
|
+
return {
|
|
53
|
+
horizontal: {
|
|
54
|
+
width: this.size,
|
|
55
|
+
origin: this.origin
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class h extends r {
|
|
61
|
+
extractSize(i) {
|
|
62
|
+
return i.height;
|
|
63
|
+
}
|
|
64
|
+
extractCoord(i) {
|
|
65
|
+
return i.y;
|
|
66
|
+
}
|
|
67
|
+
applyResize(i) {
|
|
68
|
+
return {
|
|
69
|
+
vertical: {
|
|
70
|
+
...this.resize(i),
|
|
71
|
+
origin: this.origin
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
applyEnd() {
|
|
76
|
+
return {
|
|
77
|
+
vertical: {
|
|
78
|
+
height: this.size,
|
|
79
|
+
origin: this.origin
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
class l {
|
|
85
|
+
handlers;
|
|
86
|
+
constructor(i) {
|
|
87
|
+
const t = s(i);
|
|
88
|
+
this.handlers = [], t.horizontal && this.handlers.push(new a(t.horizontal)), t.vertical && this.handlers.push(new h(t.vertical));
|
|
89
|
+
}
|
|
90
|
+
startResize(i) {
|
|
91
|
+
for (const t of this.handlers)
|
|
92
|
+
t.start(i.rectangle, i.languageDirection);
|
|
93
|
+
}
|
|
94
|
+
resize(i) {
|
|
95
|
+
return Object.assign({}, ...this.handlers.map((t) => t.applyResize(i)));
|
|
96
|
+
}
|
|
97
|
+
commitResize(i) {
|
|
98
|
+
for (const t of this.handlers)
|
|
99
|
+
t.commit(i);
|
|
100
|
+
}
|
|
101
|
+
endResize() {
|
|
102
|
+
return Object.assign({}, ...this.handlers.map((i) => i.applyEnd()));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
l as ResizeHandleStrategy
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=resize_strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize_strategy.js","sources":["../../../src/utils/resize/resize_strategy.ts"],"sourcesContent":["import {\n getHandleConfig,\n resolveDirection,\n computeResizeState,\n} from './handle_config.js';\nimport type {\n AxisConfig,\n ResizeHandlePosition,\n WidthResizeOrigin,\n HeightResizeOrigin,\n} from './types.js';\nimport type { Dimensions, Position, Rectangle } from '../types/dimensions.js';\n\nexport interface StartResizeParams {\n rectangle: Rectangle;\n languageDirection: string;\n}\n\nexport interface AxisResizeResult {\n newSize: number;\n totalDelta: number;\n currentDelta: number;\n}\n\nexport interface HorizontalResizeResult extends AxisResizeResult {\n origin: WidthResizeOrigin;\n}\n\nexport interface VerticalResizeResult extends AxisResizeResult {\n origin: HeightResizeOrigin;\n}\n\nexport interface ResizeResult {\n horizontal?: HorizontalResizeResult;\n vertical?: VerticalResizeResult;\n}\n\nexport interface EndResizeResult {\n horizontal?: { width: number; origin: WidthResizeOrigin };\n vertical?: { height: number; origin: HeightResizeOrigin };\n}\n\n/**\n * Single-axis resize handler. Pure — no DOM, no React.\n * Subclasses extract the correct axis from uniform args.\n */\nabstract class AxisResizeHandler {\n protected direction = 1;\n protected startSize = 0;\n protected startCoord = 0;\n protected currentSize = 0;\n\n constructor(protected axisConfig: AxisConfig) {}\n\n get origin() {\n return this.axisConfig.origin;\n }\n\n get size() {\n return this.currentSize;\n }\n\n protected abstract extractSize(dimensions: Dimensions): number;\n protected abstract extractCoord(coord: Position): number;\n abstract applyResize(coord: Position): Partial<ResizeResult>;\n abstract applyEnd(): Partial<EndResizeResult>;\n\n start(rect: Rectangle, languageDirection: string) {\n this.direction = resolveDirection(\n languageDirection,\n this.axisConfig.invert,\n this.axisConfig.disableDirection\n );\n this.startSize = this.extractSize(rect.dimensions);\n this.startCoord = this.extractCoord(rect.position);\n this.currentSize = this.startSize;\n }\n\n resize(coord: Position): AxisResizeResult {\n return computeResizeState(\n this.startSize,\n this.startCoord,\n this.extractCoord(coord),\n this.direction,\n this.currentSize\n );\n }\n\n commit(dimensions: Dimensions) {\n this.currentSize = this.extractSize(dimensions);\n }\n}\n\nclass HorizontalAxisResizeHandler extends AxisResizeHandler {\n protected extractSize(dimensions: Dimensions) {\n return dimensions.width;\n }\n\n protected extractCoord(coord: Position) {\n return coord.x;\n }\n\n applyResize(coord: Position): Partial<ResizeResult> {\n return {\n horizontal: {\n ...this.resize(coord),\n origin: this.origin as WidthResizeOrigin,\n },\n };\n }\n\n applyEnd(): Partial<EndResizeResult> {\n return {\n horizontal: {\n width: this.size,\n origin: this.origin as WidthResizeOrigin,\n },\n };\n }\n}\n\nclass VerticalAxisResizeHandler extends AxisResizeHandler {\n protected extractSize(dimensions: Dimensions) {\n return dimensions.height;\n }\n\n protected extractCoord(coord: Position) {\n return coord.y;\n }\n\n applyResize(coord: Position): Partial<ResizeResult> {\n return {\n vertical: {\n ...this.resize(coord),\n origin: this.origin as HeightResizeOrigin,\n },\n };\n }\n\n applyEnd(): Partial<EndResizeResult> {\n return {\n vertical: {\n height: this.size,\n origin: this.origin as HeightResizeOrigin,\n },\n };\n }\n}\n\n/**\n * Flow:\n * 1. adapter calls startResize() with rect/coords from DOM\n * 2. adapter calls resize() on each mousemove with coord\n * 3. adapter checks bounds (DOM), applies style, then calls commitResize()\n * 4. adapter calls endResize() on mouseup to get final state\n */\nexport class ResizeHandleStrategy {\n private handlers: AxisResizeHandler[];\n\n constructor(position: ResizeHandlePosition) {\n const config = getHandleConfig(position);\n this.handlers = [];\n if (config.horizontal) {\n this.handlers.push(new HorizontalAxisResizeHandler(config.horizontal));\n }\n if (config.vertical) {\n this.handlers.push(new VerticalAxisResizeHandler(config.vertical));\n }\n }\n\n startResize(params: StartResizeParams): void {\n for (const handler of this.handlers) {\n handler.start(params.rectangle, params.languageDirection);\n }\n }\n\n resize(position: Position): ResizeResult {\n return Object.assign({}, ...this.handlers.map(h => h.applyResize(position)));\n }\n\n commitResize(dimensions: Dimensions): void {\n for (const handler of this.handlers) {\n handler.commit(dimensions);\n }\n }\n\n endResize(): EndResizeResult {\n return Object.assign({}, ...this.handlers.map(h => h.applyEnd()));\n }\n}\n"],"names":["AxisResizeHandler","axisConfig","rect","languageDirection","resolveDirection","coord","computeResizeState","dimensions","HorizontalAxisResizeHandler","VerticalAxisResizeHandler","ResizeHandleStrategy","position","config","getHandleConfig","params","handler","h"],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnWidthResize, OnWidthResizeEnd, OnHeightResize, OnHeightResizeEnd, WidthResizeOrigin, HeightResizeOrigin } from '../../stacks/box/types.js';
|
|
2
|
+
export type { OnWidthResize, OnWidthResizeEnd, OnHeightResize, OnHeightResizeEnd, WidthResizeOrigin, HeightResizeOrigin, };
|
|
3
|
+
export type ResizeHandlePosition = 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
4
|
+
export interface AxisConfig {
|
|
5
|
+
origin: WidthResizeOrigin | HeightResizeOrigin;
|
|
6
|
+
invert: boolean;
|
|
7
|
+
disableDirection: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface HandleConfig {
|
|
10
|
+
horizontal?: AxisConfig;
|
|
11
|
+
vertical?: AxisConfig;
|
|
12
|
+
}
|
|
13
|
+
export interface ResolvedAxisConfig {
|
|
14
|
+
origin: WidthResizeOrigin | HeightResizeOrigin;
|
|
15
|
+
direction: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ResolvedHandleConfig {
|
|
18
|
+
horizontal?: ResolvedAxisConfig;
|
|
19
|
+
vertical?: ResolvedAxisConfig;
|
|
20
|
+
}
|
|
21
|
+
export interface ResizableContextValue {
|
|
22
|
+
targetRef: React.RefObject<HTMLElement | null>;
|
|
23
|
+
onWidthResize?: OnWidthResize;
|
|
24
|
+
onWidthResizeEnd?: OnWidthResizeEnd;
|
|
25
|
+
onHeightResize?: OnHeightResize;
|
|
26
|
+
onHeightResizeEnd?: OnHeightResizeEnd;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/resize/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAE5B,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,OAAO,GACP,KAAK,GAEL,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,WAAW,GACX,SAAS,GACT,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tcn/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "TCN",
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
"libphonenumber-js": "^1.12.38",
|
|
144
144
|
"react-color": "^2.19.3",
|
|
145
145
|
"react-phone-number-input": "^3.4.16",
|
|
146
|
-
"@tcn/
|
|
147
|
-
"@tcn/
|
|
146
|
+
"@tcn/icons": "2.3.0",
|
|
147
|
+
"@tcn/state": "1.3.3"
|
|
148
148
|
},
|
|
149
149
|
"scripts": {
|
|
150
150
|
"build": "vite build",
|
|
@@ -23,6 +23,37 @@ export default meta;
|
|
|
23
23
|
|
|
24
24
|
type Story = StoryObj;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Simple example of two columns side by side.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* columnsMinWidth sets a default minWidth on all child Columns.
|
|
31
|
+
* An explicit minWidth prop on a Column overrides it.
|
|
32
|
+
*/
|
|
33
|
+
export const ColumnsMinWidth: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<LayoutStoryDecorator>
|
|
36
|
+
<Columns columnsMinWidth="200px">
|
|
37
|
+
<Column>
|
|
38
|
+
<Section>
|
|
39
|
+
<Detail>default (200px)</Detail>
|
|
40
|
+
</Section>
|
|
41
|
+
</Column>
|
|
42
|
+
<Column>
|
|
43
|
+
<Section>
|
|
44
|
+
<Detail>default (200px)</Detail>
|
|
45
|
+
</Section>
|
|
46
|
+
</Column>
|
|
47
|
+
<Column minWidth="400px">
|
|
48
|
+
<Section>
|
|
49
|
+
<Detail>override (400px)</Detail>
|
|
50
|
+
</Section>
|
|
51
|
+
</Column>
|
|
52
|
+
</Columns>
|
|
53
|
+
</LayoutStoryDecorator>
|
|
54
|
+
),
|
|
55
|
+
};
|
|
56
|
+
|
|
26
57
|
/**
|
|
27
58
|
* Simple example of two columns side by side.
|
|
28
59
|
*/
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import { VStack } from '../../stacks/v_stack.js';
|
|
3
4
|
import { SBNestedScaffold, SBContent, SBNestedRail } from './utils.js';
|
|
5
|
+
import { Header } from '../header/header.js';
|
|
6
|
+
import { Footer } from '../footer/footer.js';
|
|
7
|
+
import { Column } from '../containers/columns/column.js';
|
|
4
8
|
|
|
5
9
|
import styles from './composed_stories.module.css';
|
|
10
|
+
import { Scaffold } from '../containers/scaffold.js';
|
|
6
11
|
import { Rail } from '../containers/rail.js';
|
|
7
12
|
|
|
8
13
|
const meta: Meta = {
|
|
@@ -30,33 +35,97 @@ const SBContainer = ({ children }: { children: React.ReactNode }) => {
|
|
|
30
35
|
);
|
|
31
36
|
};
|
|
32
37
|
|
|
33
|
-
export const
|
|
38
|
+
export const RailInRail: Story = {
|
|
34
39
|
render: () => (
|
|
35
40
|
<SBContainer>
|
|
36
|
-
<
|
|
37
|
-
<
|
|
41
|
+
<SBNestedRail depth={1}>
|
|
42
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
43
|
+
Column (Start)
|
|
44
|
+
</Column>
|
|
45
|
+
<SBNestedRail depth={2}>
|
|
46
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
47
|
+
Column (Start)
|
|
48
|
+
</Column>
|
|
49
|
+
{/* Inner Body */}
|
|
38
50
|
<Rail>
|
|
39
51
|
<SBContent />
|
|
40
52
|
<SBContent />
|
|
41
|
-
<SBContent />
|
|
42
53
|
</Rail>
|
|
54
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
55
|
+
Column (End)
|
|
56
|
+
</Column>
|
|
43
57
|
</SBNestedRail>
|
|
58
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
59
|
+
Column (End)
|
|
60
|
+
</Column>
|
|
61
|
+
</SBNestedRail>
|
|
62
|
+
</SBContainer>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const ScaffoldInRail: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<SBContainer>
|
|
69
|
+
<SBNestedRail depth={1}>
|
|
70
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
71
|
+
Column (Start)
|
|
72
|
+
</Column>
|
|
73
|
+
<SBNestedScaffold depth={2}>
|
|
74
|
+
<Header className={clsx(styles.header, styles.secondary)}>Header</Header>
|
|
75
|
+
{/* Inner Body */}
|
|
76
|
+
<Scaffold>
|
|
77
|
+
<SBContent />
|
|
78
|
+
<SBContent />
|
|
79
|
+
</Scaffold>
|
|
80
|
+
<Footer className={clsx(styles.footer, styles.secondary)}>Footer</Footer>
|
|
81
|
+
</SBNestedScaffold>
|
|
82
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
83
|
+
Column (End)
|
|
84
|
+
</Column>
|
|
85
|
+
</SBNestedRail>
|
|
86
|
+
</SBContainer>
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const ScaffoldInScaffold: Story = {
|
|
91
|
+
render: () => (
|
|
92
|
+
<SBContainer>
|
|
93
|
+
<SBNestedScaffold depth={1}>
|
|
94
|
+
<Header className={clsx(styles.header, styles.secondary)}>Header</Header>
|
|
95
|
+
<SBNestedScaffold depth={2}>
|
|
96
|
+
<Header className={clsx(styles.header, styles.secondary)}>Header</Header>
|
|
97
|
+
{/* Inner Body */}
|
|
98
|
+
<Scaffold>
|
|
99
|
+
<SBContent />
|
|
100
|
+
<SBContent />
|
|
101
|
+
</Scaffold>
|
|
102
|
+
<Footer className={clsx(styles.footer, styles.secondary)}>Footer</Footer>
|
|
103
|
+
</SBNestedScaffold>
|
|
104
|
+
<Footer className={clsx(styles.footer, styles.secondary)}>Footer</Footer>
|
|
44
105
|
</SBNestedScaffold>
|
|
45
106
|
</SBContainer>
|
|
46
107
|
),
|
|
47
108
|
};
|
|
48
109
|
|
|
49
|
-
export const
|
|
110
|
+
export const RailInScaffold: Story = {
|
|
50
111
|
render: () => (
|
|
51
112
|
<SBContainer>
|
|
52
|
-
<SBNestedScaffold depth={1}
|
|
53
|
-
<
|
|
113
|
+
<SBNestedScaffold depth={1}>
|
|
114
|
+
<Header className={clsx(styles.header, styles.secondary)}>Header</Header>
|
|
115
|
+
<SBNestedRail depth={2}>
|
|
116
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
117
|
+
Column (Start)
|
|
118
|
+
</Column>
|
|
119
|
+
{/* Inner Body */}
|
|
54
120
|
<Rail>
|
|
55
121
|
<SBContent />
|
|
56
122
|
<SBContent />
|
|
57
|
-
<SBContent />
|
|
58
123
|
</Rail>
|
|
124
|
+
<Column className={clsx(styles.side, styles.secondary)} minWidth="100px">
|
|
125
|
+
Column (End)
|
|
126
|
+
</Column>
|
|
59
127
|
</SBNestedRail>
|
|
128
|
+
<Footer className={clsx(styles.footer, styles.secondary)}>Footer</Footer>
|
|
60
129
|
</SBNestedScaffold>
|
|
61
130
|
</SBContainer>
|
|
62
131
|
),
|