@tcn/ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.d.ts.map +1 -1
- package/dist/feedback/index.js +6 -4
- package/dist/feedback/index.js.map +1 -1
- package/dist/feedback/progress/progress.d.ts +7 -0
- package/dist/feedback/progress/progress.d.ts.map +1 -0
- package/dist/feedback/progress/progress.js +38 -0
- package/dist/feedback/progress/progress.js.map +1 -0
- package/dist/feedback/progress/progress_bar.d.ts +0 -1
- package/dist/feedback/progress/progress_bar.d.ts.map +1 -1
- package/dist/feedback/progress/progress_bar.js +6 -46
- package/dist/feedback/progress/progress_bar.js.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +4 -3
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +145 -127
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +65 -65
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/progress_bar-CPP0Jyv-.js +38 -0
- package/dist/progress_bar-CPP0Jyv-.js.map +1 -0
- package/dist/progress_bar.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -8
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +2 -2
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -8
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -8
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +3 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +36 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -8
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -8
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -8
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +18 -0
- package/dist/stacks/box/types.d.ts.map +1 -0
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/index.d.ts +1 -0
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +3 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +10 -8
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.js +18 -12
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -1
- package/dist/surfaces/tooltip/tooltip.js +22 -20
- package/dist/surfaces/tooltip/tooltip.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +3 -4
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -18
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +3 -1
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/package.json +1 -1
- package/src/feedback/index.ts +1 -0
- package/src/feedback/progress/progress.module.css +5 -0
- package/src/feedback/progress/progress.stories.tsx +48 -0
- package/src/feedback/progress/progress.tsx +39 -0
- package/src/feedback/progress/progress_bar.module.css +4 -28
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.tsx +14 -26
- package/src/inputs/select/select.stories.tsx +23 -2
- package/src/inputs/suggestions/suggestion_list.tsx +58 -39
- package/src/overlay/frame/frame.tsx +10 -12
- package/src/stacks/box/bottom_resize_handle.tsx +2 -13
- package/src/stacks/box/box.tsx +4 -2
- package/src/stacks/box/end_resize_handle.tsx +3 -13
- package/src/stacks/box/left_resize_handle.tsx +3 -13
- package/src/stacks/box/resize_handlers.ts +22 -18
- package/src/stacks/box/right_resize_handle.tsx +2 -13
- package/src/stacks/box/start_resize_handle.tsx +3 -13
- package/src/stacks/box/top_resize_handle.tsx +3 -12
- package/src/stacks/box/types.ts +44 -0
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/index.ts +1 -0
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/surfaces/modal/modal.tsx +6 -4
- package/src/surfaces/pop_confirm/pop_confirm.tsx +8 -2
- package/src/surfaces/tooltip/tooltip.tsx +2 -1
- package/src/surfaces/window/window.stories.tsx +9 -1
- package/src/surfaces/window/window.tsx +6 -4
- package/src/themes/themes/ergo/ergo_theme.css +3 -1
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
return
|
|
1
|
+
function L() {
|
|
2
|
+
const o = window.document.createElement("div");
|
|
3
|
+
return o.style.position = "absolute", o.style.inset = "-500px", o.style.backgroundColor = "transparent", o.style.pointerEvents = "auto", o;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function x(o, h, f, m = "right", d = !1, v = !1) {
|
|
6
6
|
return function(e) {
|
|
7
|
-
const t =
|
|
7
|
+
const t = o.current;
|
|
8
8
|
if (t == null)
|
|
9
9
|
return;
|
|
10
|
-
const a =
|
|
10
|
+
const a = L();
|
|
11
11
|
t.appendChild(a);
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
const E =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
12
|
+
const u = (window.getComputedStyle(t).direction === "rtl" && !v ? !d : d) ? -1 : 1, g = e.clientX, l = t.getBoundingClientRect();
|
|
13
|
+
let r = l.width;
|
|
14
|
+
const i = (n) => {
|
|
15
|
+
const y = t.getBoundingClientRect().width, E = u * (n.clientX - g), c = l.width + E, C = c - r;
|
|
16
|
+
r = c, t.style.width = `${c}px`;
|
|
17
|
+
const R = t.getBoundingClientRect().width === y;
|
|
18
|
+
h?.(c, m, E, C, R), n.stopPropagation(), n.preventDefault();
|
|
19
|
+
}, p = (n) => {
|
|
20
|
+
n.buttons === 0 && s();
|
|
21
|
+
}, s = () => {
|
|
22
|
+
t.removeChild(a), document.body.removeEventListener("mousemove", i), document.body.removeEventListener("mouseup", s), document.body.removeEventListener("mouseenter", p), e.stopPropagation(), e.preventDefault(), f?.(r, m);
|
|
21
23
|
};
|
|
22
|
-
document.body.addEventListener("mousemove",
|
|
24
|
+
document.body.addEventListener("mousemove", i), document.body.addEventListener("mouseup", s), document.body.addEventListener("mouseenter", p), e.stopPropagation(), e.preventDefault();
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
+
function z(o, h, f, m = !1, d = "bottom") {
|
|
28
|
+
const v = m ? -1 : 1;
|
|
27
29
|
return function(e) {
|
|
28
|
-
const t =
|
|
30
|
+
const t = o.current;
|
|
29
31
|
if (t == null)
|
|
30
32
|
return;
|
|
31
|
-
const a =
|
|
33
|
+
const a = L();
|
|
32
34
|
t.appendChild(a);
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
35
|
+
const D = e.clientY, b = t.getBoundingClientRect();
|
|
36
|
+
let u = b.height;
|
|
37
|
+
const g = (i) => {
|
|
38
|
+
const p = t.getBoundingClientRect().height, s = v * (i.clientY - D), n = b.height + s, y = n - u;
|
|
39
|
+
u = n, t.style.height = `${n}px`;
|
|
40
|
+
const c = t.getBoundingClientRect().height === p;
|
|
41
|
+
h?.(n, d, s, y, c), i.stopPropagation(), i.preventDefault();
|
|
42
|
+
}, l = (i) => {
|
|
43
|
+
i.buttons === 0 && r();
|
|
44
|
+
}, r = () => {
|
|
45
|
+
t.removeChild(a), document.body.removeEventListener("mousemove", g), document.body.removeEventListener("mouseup", r), document.body.removeEventListener("mouseenter", l), e.stopPropagation(), e.preventDefault(), f?.(u, d);
|
|
42
46
|
};
|
|
43
|
-
document.body.addEventListener("mousemove",
|
|
47
|
+
document.body.addEventListener("mousemove", g), document.body.addEventListener("mouseup", r), document.body.addEventListener("mouseenter", l), e.stopPropagation(), e.preventDefault();
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
50
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
x as createHorizontalResizeHandler,
|
|
52
|
+
z as createVerticalResizeHandler
|
|
49
53
|
};
|
|
50
54
|
//# sourceMappingURL=resize_handlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize_handlers.js","sources":["../../../src/stacks/box/resize_handlers.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"resize_handlers.js","sources":["../../../src/stacks/box/resize_handlers.ts"],"sourcesContent":["import {\n OnWidthResize,\n type HeightResizeOrigin,\n type OnHeightResize,\n type WidthResizeOrigin,\n} from './types';\n\nfunction 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?: OnWidthResize,\n onWidthResizeEnd?: (width: number, origin: WidthResizeOrigin) => void,\n origin: WidthResizeOrigin = '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 beforeWidth = box.getBoundingClientRect().width;\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\n const afterWidth = box.getBoundingClientRect().width;\n const atLimit = afterWidth === beforeWidth;\n onWidthResize?.(newWidth, origin, totalDelta, currentDelta, atLimit);\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?: OnHeightResize,\n onHeightResizeEnd?: (height: number, origin: HeightResizeOrigin) => void,\n invert = false,\n origin: HeightResizeOrigin = '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 beforeHeight = box.getBoundingClientRect().height;\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 const afterHeight = box.getBoundingClientRect().height;\n const atLimit = afterHeight === beforeHeight;\n onHeightResize?.(newHeight, origin, totalDelta, currentDelta, atLimit);\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","beforeWidth","totalDelta","newWidth","currentDelta","atLimit","mouseEnter","endDrag","createVerticalResizeHandler","onHeightResize","onHeightResizeEnd","startY","height","beforeHeight","newHeight"],"mappings":"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"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface RightResizeHandleProps {
|
|
4
|
-
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
-
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
-
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
|
-
}
|
|
1
|
+
import { HorizontalResizeHandleProps } from './types.js';
|
|
2
|
+
export type RightResizeHandleProps = HorizontalResizeHandleProps;
|
|
9
3
|
export declare function RightResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: RightResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
4
|
//# 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":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AACjE,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,sBAAsB,2CA0BxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"right_resize_handle.js","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport
|
|
1
|
+
{"version":3,"file":"right_resize_handle.js","sources":["../../../src/stacks/box/right_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './right_resize_handle.module.css';\nimport type { HorizontalResizeHandleProps } from './types.js';\n\nexport type RightResizeHandleProps = HorizontalResizeHandleProps;\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":";;;;AAMO,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;"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface StartResizeHandleProps {
|
|
4
|
-
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
-
handleProps?: HandleProps;
|
|
6
|
-
onWidthResize?: (width: number, origin: 'left' | 'right', totalDelta: number, currentDelta: number) => void;
|
|
7
|
-
onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
|
|
8
|
-
}
|
|
1
|
+
import { HorizontalResizeHandleProps } from './types.js';
|
|
2
|
+
export type StartResizeHandleProps = HorizontalResizeHandleProps;
|
|
9
3
|
export declare function StartResizeHandle({ targetRef, handleProps, onWidthResize, onWidthResizeEnd, }: StartResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
4
|
//# 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":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAEjE,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,EAAE,sBAAsB,2CAwBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_resize_handle.js","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport
|
|
1
|
+
{"version":3,"file":"start_resize_handle.js","sources":["../../../src/stacks/box/start_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { createHorizontalResizeHandler } from './resize_handlers.js';\nimport styles from './start_resize_handle.module.css';\nimport type { HorizontalResizeHandleProps } from './types.js';\n\nexport type StartResizeHandleProps = HorizontalResizeHandleProps;\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":";;;;AAOO,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;"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface TopResizeHandleProps {
|
|
4
|
-
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
-
handleProps?: HandleProps;
|
|
6
|
-
onHeightResize?: (height: number, origin: 'top' | 'bottom', totalDelta: number, currentDelta: number) => void;
|
|
7
|
-
onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void;
|
|
8
|
-
}
|
|
1
|
+
import { VerticalResizeHandleProps } from './types.js';
|
|
2
|
+
export type TopResizeHandleProps = VerticalResizeHandleProps;
|
|
9
3
|
export declare function TopResizeHandle({ targetRef, handleProps, onHeightResize, onHeightResizeEnd, }: TopResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
4
|
//# sourceMappingURL=top_resize_handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/top_resize_handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"top_resize_handle.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/top_resize_handle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE7D,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,EAAE,oBAAoB,2CAwBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top_resize_handle.js","sources":["../../../src/stacks/box/top_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"top_resize_handle.js","sources":["../../../src/stacks/box/top_resize_handle.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { createVerticalResizeHandler } from './resize_handlers.js';\nimport styles from './top_resize_handle.module.css';\nimport type { VerticalResizeHandleProps } from './types.js';\n\nexport type TopResizeHandleProps = VerticalResizeHandleProps;\n\nexport function TopResizeHandle({\n targetRef,\n handleProps,\n onHeightResize,\n onHeightResizeEnd,\n}: TopResizeHandleProps) {\n const resizeHandler = createVerticalResizeHandler(\n targetRef,\n onHeightResize,\n onHeightResizeEnd,\n true,\n 'top'\n );\n const offset = handleProps?.offset ? handleProps.offset : -8;\n\n const topResizeHandleStyle: React.CSSProperties = {\n ...handleProps?.style,\n top: `${offset}px`,\n height: handleProps?.size || '16px',\n };\n return (\n <div\n className={clsx(styles['top-resize-handle'], 'tcn-top-resize-handle')}\n onMouseDown={resizeHandler}\n style={topResizeHandleStyle}\n >\n {handleProps?.children}\n </div>\n );\n}\n"],"names":["TopResizeHandle","targetRef","handleProps","onHeightResize","onHeightResizeEnd","resizeHandler","createVerticalResizeHandler","offset","topResizeHandleStyle","jsx","clsx","styles"],"mappings":";;;;AAQO,SAASA,EAAgB;AAAA,EAC9B,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,GAAyB;AACvB,QAAMC,IAAgBC;AAAA,IACpBL;AAAA,IACAE;AAAA,IACAC;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEIG,IAASL,GAAa,SAASA,EAAY,SAAS,IAEpDM,IAA4C;AAAA,IAChD,GAAGN,GAAa;AAAA,IAChB,KAAK,GAAGK,CAAM;AAAA,IACd,QAAQL,GAAa,QAAQ;AAAA,EAAA;AAE/B,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;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HandleProps } from './handle_props.js';
|
|
2
|
+
export type WidthResizeOrigin = 'left' | 'right';
|
|
3
|
+
export type HeightResizeOrigin = 'top' | 'bottom';
|
|
4
|
+
export type OnWidthResize = (width: number, origin: WidthResizeOrigin, totalDelta: number, currentDelta: number, atLimit: boolean) => void;
|
|
5
|
+
export type OnHeightResize = (height: number, origin: HeightResizeOrigin, totalDelta: number, currentDelta: number, atLimit: boolean) => void;
|
|
6
|
+
export interface HorizontalResizeHandleProps {
|
|
7
|
+
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
8
|
+
handleProps?: HandleProps;
|
|
9
|
+
onWidthResize?: OnWidthResize;
|
|
10
|
+
onWidthResizeEnd?: (width: number, origin: WidthResizeOrigin) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface VerticalResizeHandleProps {
|
|
13
|
+
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
14
|
+
handleProps?: HandleProps;
|
|
15
|
+
onHeightResize?: OnHeightResize;
|
|
16
|
+
onHeightResizeEnd?: (height: number, origin: HeightResizeOrigin) => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/stacks/box/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AACjD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,CAE1B,KAAK,EAAE,MAAM,EAEb,MAAM,EAAE,iBAAiB,EAEzB,UAAU,EAAE,MAAM,EAElB,YAAY,EAAE,MAAM,EAEpB,OAAO,EAAE,OAAO,KACb,IAAI,CAAC;AAEV,MAAM,MAAM,cAAc,GAAG,CAE3B,MAAM,EAAE,MAAM,EAEd,MAAM,EAAE,kBAAkB,EAE1B,UAAU,EAAE,MAAM,EAElB,YAAY,EAAE,MAAM,EAEpB,OAAO,EAAE,OAAO,KACb,IAAI,CAAC;AAEV,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC1E"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as d } from "clsx";
|
|
3
|
+
import t, { useLayoutEffect as u } from "react";
|
|
4
4
|
import "../utils/click_away_listener.js";
|
|
5
5
|
import "../utils/focus_redirect.js";
|
|
6
6
|
import "../utils/scroll_away_listener.js";
|
|
7
|
-
import { useForkRef as
|
|
7
|
+
import { useForkRef as R } from "../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../utils/hooks/use_resize_observer.js";
|
|
9
9
|
import "../utils/dnd/context.js";
|
|
10
10
|
import "../draggable.module-BgelQsuJ.js";
|
|
11
|
-
import { Box as
|
|
12
|
-
import { s as
|
|
13
|
-
import { useIsCollapsed as
|
|
14
|
-
const
|
|
15
|
-
const o =
|
|
16
|
-
|
|
17
|
-
o.current?.style.setProperty("--collapsible-size",
|
|
18
|
-
}, [
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
11
|
+
import { Box as x } from "./box/box.js";
|
|
12
|
+
import { s as z } from "../collapsible_box.module-BiS98xXA.js";
|
|
13
|
+
import { useIsCollapsed as b } from "./utils/use_is_collapsed.js";
|
|
14
|
+
const L = t.forwardRef(function({ open: l = !1, defaultWidth: i = "400px", ...e }, a) {
|
|
15
|
+
const o = t.useRef(null), n = R(a, o), [c, r] = t.useState(!1);
|
|
16
|
+
u(() => {
|
|
17
|
+
o.current?.style.setProperty("--collapsible-size", i);
|
|
18
|
+
}, [i]);
|
|
19
|
+
const m = b(l, o) && !l ? null : e.children;
|
|
20
|
+
return /* @__PURE__ */ p(
|
|
21
|
+
x,
|
|
22
22
|
{
|
|
23
|
-
ref:
|
|
23
|
+
ref: n,
|
|
24
24
|
...e,
|
|
25
25
|
"data-is-collapsed": !l,
|
|
26
26
|
"data-collapse-orientation": "horizontal",
|
|
27
|
-
"data-is-resizing":
|
|
28
|
-
onWidthResize: (s
|
|
29
|
-
|
|
27
|
+
"data-is-resizing": c,
|
|
28
|
+
onWidthResize: (...s) => {
|
|
29
|
+
r(!0), e.onWidthResize?.(...s);
|
|
30
30
|
},
|
|
31
|
-
onWidthResizeEnd: (s,
|
|
32
|
-
|
|
31
|
+
onWidthResizeEnd: (s, f) => {
|
|
32
|
+
r(!1), e.onWidthResizeEnd?.(s, f), o.current?.style.setProperty("--collapsible-size", `${s}px`);
|
|
33
33
|
},
|
|
34
|
-
className:
|
|
34
|
+
className: d(
|
|
35
35
|
e.className,
|
|
36
|
-
|
|
36
|
+
z["collapsible-box"],
|
|
37
37
|
"tcn-h-collapsible-box"
|
|
38
38
|
),
|
|
39
|
-
children:
|
|
39
|
+
children: m
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
L as HCollapsibleBox
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=h_collapsible_box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h_collapsible_box.js","sources":["../../src/stacks/h_collapsible_box.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useLayoutEffect } from 'react';\nimport { useForkRef } from '../utils/index.js';\nimport { Box, BoxProps } from './box/box.js';\nimport styles from './collapsible_box.module.css';\nimport { useIsCollapsed } from './utils/use_is_collapsed.js';\n\nexport interface HCollapsibleBoxProps extends BoxProps {\n open?: boolean;\n defaultWidth?: string;\n}\n\nexport const HCollapsibleBox = React.forwardRef(function CollapsibleBox(\n { open = false, defaultWidth = '400px', ...props }: HCollapsibleBoxProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const collapsibleRef = React.useRef<HTMLDivElement | null>(null);\n const forkRef = useForkRef(ref, collapsibleRef);\n const [resizing, setIsResizing] = React.useState(false);\n\n useLayoutEffect(() => {\n collapsibleRef.current?.style.setProperty('--collapsible-size', defaultWidth);\n }, [defaultWidth]);\n\n const isCollapsed = useIsCollapsed(open, collapsibleRef);\n const children = isCollapsed && !open ? null : props.children;\n\n return (\n <Box\n ref={forkRef}\n {...props}\n data-is-collapsed={!open}\n data-collapse-orientation=\"horizontal\"\n data-is-resizing={resizing}\n onWidthResize={(
|
|
1
|
+
{"version":3,"file":"h_collapsible_box.js","sources":["../../src/stacks/h_collapsible_box.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useLayoutEffect } from 'react';\nimport { useForkRef } from '../utils/index.js';\nimport { Box, BoxProps } from './box/box.js';\nimport styles from './collapsible_box.module.css';\nimport { useIsCollapsed } from './utils/use_is_collapsed.js';\n\nexport interface HCollapsibleBoxProps extends BoxProps {\n open?: boolean;\n defaultWidth?: string;\n}\n\nexport const HCollapsibleBox = React.forwardRef(function CollapsibleBox(\n { open = false, defaultWidth = '400px', ...props }: HCollapsibleBoxProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const collapsibleRef = React.useRef<HTMLDivElement | null>(null);\n const forkRef = useForkRef(ref, collapsibleRef);\n const [resizing, setIsResizing] = React.useState(false);\n\n useLayoutEffect(() => {\n collapsibleRef.current?.style.setProperty('--collapsible-size', defaultWidth);\n }, [defaultWidth]);\n\n const isCollapsed = useIsCollapsed(open, collapsibleRef);\n const children = isCollapsed && !open ? null : props.children;\n\n return (\n <Box\n ref={forkRef}\n {...props}\n data-is-collapsed={!open}\n data-collapse-orientation=\"horizontal\"\n data-is-resizing={resizing}\n onWidthResize={(...args) => {\n setIsResizing(true);\n props.onWidthResize?.(...args);\n }}\n onWidthResizeEnd={(width, origin) => {\n setIsResizing(false);\n props.onWidthResizeEnd?.(width, origin);\n collapsibleRef.current?.style.setProperty('--collapsible-size', `${width}px`);\n }}\n className={clsx(\n props.className,\n styles['collapsible-box'],\n 'tcn-h-collapsible-box'\n )}\n children={children}\n />\n );\n});\n"],"names":["HCollapsibleBox","React","open","defaultWidth","props","ref","collapsibleRef","forkRef","useForkRef","resizing","setIsResizing","useLayoutEffect","children","useIsCollapsed","jsx","Box","args","width","origin","clsx","styles"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,IAAkBC,EAAM,WAAW,SAC9C,EAAE,MAAAC,IAAO,IAAO,cAAAC,IAAe,SAAS,GAAGC,EAAA,GAC3CC,GACA;AACA,QAAMC,IAAiBL,EAAM,OAA8B,IAAI,GACzDM,IAAUC,EAAWH,GAAKC,CAAc,GACxC,CAACG,GAAUC,CAAa,IAAIT,EAAM,SAAS,EAAK;AAEtD,EAAAU,EAAgB,MAAM;AACpB,IAAAL,EAAe,SAAS,MAAM,YAAY,sBAAsBH,CAAY;AAAA,EAC9E,GAAG,CAACA,CAAY,CAAC;AAGjB,QAAMS,IADcC,EAAeX,GAAMI,CAAc,KACvB,CAACJ,IAAO,OAAOE,EAAM;AAErD,SACE,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKR;AAAA,MACJ,GAAGH;AAAA,MACJ,qBAAmB,CAACF;AAAA,MACpB,6BAA0B;AAAA,MAC1B,oBAAkBO;AAAA,MAClB,eAAe,IAAIO,MAAS;AAC1B,QAAAN,EAAc,EAAI,GAClBN,EAAM,gBAAgB,GAAGY,CAAI;AAAA,MAC/B;AAAA,MACA,kBAAkB,CAACC,GAAOC,MAAW;AACnC,QAAAR,EAAc,EAAK,GACnBN,EAAM,mBAAmBa,GAAOC,CAAM,GACtCZ,EAAe,SAAS,MAAM,YAAY,sBAAsB,GAAGW,CAAK,IAAI;AAAA,MAC9E;AAAA,MACA,WAAWE;AAAA,QACTf,EAAM;AAAA,QACNgB,EAAO,iBAAiB;AAAA,QACxB;AAAA,MAAA;AAAA,MAEF,UAAAR;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
package/dist/stacks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import t, { useLayoutEffect as u } from "react";
|
|
3
3
|
import "../utils/click_away_listener.js";
|
|
4
4
|
import "../utils/focus_redirect.js";
|
|
5
5
|
import "../utils/scroll_away_listener.js";
|
|
6
|
-
import { useForkRef as
|
|
6
|
+
import { useForkRef as d } from "../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../utils/hooks/use_resize_observer.js";
|
|
8
8
|
import "../utils/dnd/context.js";
|
|
9
|
-
import { clsx as
|
|
9
|
+
import { clsx as R } from "clsx";
|
|
10
10
|
import "../draggable.module-BgelQsuJ.js";
|
|
11
|
-
import { Box as
|
|
12
|
-
import { s as
|
|
13
|
-
import { useIsCollapsed as
|
|
14
|
-
const
|
|
15
|
-
const s =
|
|
16
|
-
|
|
17
|
-
s.current?.style.setProperty("--collapsible-size",
|
|
18
|
-
}, [
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
11
|
+
import { Box as x } from "./box/box.js";
|
|
12
|
+
import { s as b } from "../collapsible_box.module-BiS98xXA.js";
|
|
13
|
+
import { useIsCollapsed as z } from "./utils/use_is_collapsed.js";
|
|
14
|
+
const F = t.forwardRef(function({ open: l = !1, defaultHeight: i = "400px", ...e }, a) {
|
|
15
|
+
const s = t.useRef(null), c = d(a, s), [n, r] = t.useState(!1);
|
|
16
|
+
u(() => {
|
|
17
|
+
s.current?.style.setProperty("--collapsible-size", i);
|
|
18
|
+
}, [i]);
|
|
19
|
+
const m = z(l, s) && !l ? null : e.children;
|
|
20
|
+
return /* @__PURE__ */ p(
|
|
21
|
+
x,
|
|
22
22
|
{
|
|
23
|
-
ref:
|
|
23
|
+
ref: c,
|
|
24
24
|
...e,
|
|
25
25
|
"data-is-collapsed": !l,
|
|
26
26
|
"data-collapse-orientation": "vertical",
|
|
27
|
-
"data-is-resizing":
|
|
28
|
-
onHeightResize: (o
|
|
29
|
-
|
|
27
|
+
"data-is-resizing": n,
|
|
28
|
+
onHeightResize: (...o) => {
|
|
29
|
+
r(!0), e.onHeightResize?.(...o);
|
|
30
30
|
},
|
|
31
|
-
onHeightResizeEnd: (o,
|
|
32
|
-
|
|
31
|
+
onHeightResizeEnd: (o, f) => {
|
|
32
|
+
r(!1), s.current?.style.setProperty("--collapsible-size", `${o}px`), e.onHeightResizeEnd?.(o, f);
|
|
33
33
|
},
|
|
34
|
-
className:
|
|
34
|
+
className: R(
|
|
35
35
|
e.className,
|
|
36
|
-
|
|
36
|
+
b["collapsible-box"],
|
|
37
37
|
"tcn-v-collapsible-box"
|
|
38
38
|
),
|
|
39
|
-
children:
|
|
39
|
+
children: m
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
F as VCollapsibleBox
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=v_collapsible_box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v_collapsible_box.js","sources":["../../src/stacks/v_collapsible_box.tsx"],"sourcesContent":["import React, { useLayoutEffect } from 'react';\nimport { useForkRef } from '../utils/index.js';\nimport { clsx } from 'clsx';\nimport { Box, BoxProps } from './box/box.js';\nimport styles from './collapsible_box.module.css';\nimport { useIsCollapsed } from './utils/use_is_collapsed.js';\n\nexport interface VCollapsibleBoxProps extends BoxProps {\n open?: boolean;\n defaultHeight?: string;\n}\n\nexport const VCollapsibleBox = React.forwardRef(function CollapsibleBox(\n { open = false, defaultHeight = '400px', ...props }: VCollapsibleBoxProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const collapsibleRef = React.useRef<HTMLDivElement | null>(null);\n const forkRef = useForkRef(ref, collapsibleRef);\n const [resizing, setIsResizing] = React.useState(false);\n\n useLayoutEffect(() => {\n collapsibleRef.current?.style.setProperty('--collapsible-size', defaultHeight);\n }, [defaultHeight]);\n\n const isCollapsed = useIsCollapsed(open, collapsibleRef);\n const children = isCollapsed && !open ? null : props.children;\n\n return (\n <Box\n ref={forkRef}\n {...props}\n data-is-collapsed={!open}\n data-collapse-orientation=\"vertical\"\n data-is-resizing={resizing}\n onHeightResize={(
|
|
1
|
+
{"version":3,"file":"v_collapsible_box.js","sources":["../../src/stacks/v_collapsible_box.tsx"],"sourcesContent":["import React, { useLayoutEffect } from 'react';\nimport { useForkRef } from '../utils/index.js';\nimport { clsx } from 'clsx';\nimport { Box, BoxProps } from './box/box.js';\nimport styles from './collapsible_box.module.css';\nimport { useIsCollapsed } from './utils/use_is_collapsed.js';\n\nexport interface VCollapsibleBoxProps extends BoxProps {\n open?: boolean;\n defaultHeight?: string;\n}\n\nexport const VCollapsibleBox = React.forwardRef(function CollapsibleBox(\n { open = false, defaultHeight = '400px', ...props }: VCollapsibleBoxProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const collapsibleRef = React.useRef<HTMLDivElement | null>(null);\n const forkRef = useForkRef(ref, collapsibleRef);\n const [resizing, setIsResizing] = React.useState(false);\n\n useLayoutEffect(() => {\n collapsibleRef.current?.style.setProperty('--collapsible-size', defaultHeight);\n }, [defaultHeight]);\n\n const isCollapsed = useIsCollapsed(open, collapsibleRef);\n const children = isCollapsed && !open ? null : props.children;\n\n return (\n <Box\n ref={forkRef}\n {...props}\n data-is-collapsed={!open}\n data-collapse-orientation=\"vertical\"\n data-is-resizing={resizing}\n onHeightResize={(...args) => {\n setIsResizing(true);\n props.onHeightResize?.(...args);\n }}\n onHeightResizeEnd={(height, origin) => {\n setIsResizing(false);\n collapsibleRef.current?.style.setProperty('--collapsible-size', `${height}px`);\n props.onHeightResizeEnd?.(height, origin);\n }}\n className={clsx(\n props.className,\n styles['collapsible-box'],\n 'tcn-v-collapsible-box'\n )}\n children={children}\n />\n );\n});\n"],"names":["VCollapsibleBox","React","open","defaultHeight","props","ref","collapsibleRef","forkRef","useForkRef","resizing","setIsResizing","useLayoutEffect","children","useIsCollapsed","jsx","Box","args","height","origin","clsx","styles"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,IAAkBC,EAAM,WAAW,SAC9C,EAAE,MAAAC,IAAO,IAAO,eAAAC,IAAgB,SAAS,GAAGC,EAAA,GAC5CC,GACA;AACA,QAAMC,IAAiBL,EAAM,OAA8B,IAAI,GACzDM,IAAUC,EAAWH,GAAKC,CAAc,GACxC,CAACG,GAAUC,CAAa,IAAIT,EAAM,SAAS,EAAK;AAEtD,EAAAU,EAAgB,MAAM;AACpB,IAAAL,EAAe,SAAS,MAAM,YAAY,sBAAsBH,CAAa;AAAA,EAC/E,GAAG,CAACA,CAAa,CAAC;AAGlB,QAAMS,IADcC,EAAeX,GAAMI,CAAc,KACvB,CAACJ,IAAO,OAAOE,EAAM;AAErD,SACE,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKR;AAAA,MACJ,GAAGH;AAAA,MACJ,qBAAmB,CAACF;AAAA,MACpB,6BAA0B;AAAA,MAC1B,oBAAkBO;AAAA,MAClB,gBAAgB,IAAIO,MAAS;AAC3B,QAAAN,EAAc,EAAI,GAClBN,EAAM,iBAAiB,GAAGY,CAAI;AAAA,MAChC;AAAA,MACA,mBAAmB,CAACC,GAAQC,MAAW;AACrC,QAAAR,EAAc,EAAK,GACnBJ,EAAe,SAAS,MAAM,YAAY,sBAAsB,GAAGW,CAAM,IAAI,GAC7Eb,EAAM,oBAAoBa,GAAQC,CAAM;AAAA,MAC1C;AAAA,MACA,WAAWC;AAAA,QACTf,EAAM;AAAA,QACNgB,EAAO,iBAAiB;AAAA,QACxB;AAAA,MAAA;AAAA,MAEF,UAAAR;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export declare const Modal: React.ForwardRefExoticComponent<FrameOwnProps & ScaffoldProps & React.RefAttributes<HTMLElement>>;
|
|
2
|
+
import { FrameProps } from '../../overlay/frame/frame.js';
|
|
3
|
+
export type ModalProps = FrameProps;
|
|
4
|
+
export declare const Modal: React.ForwardRefExoticComponent<Omit<import('../../stacks/index.js').BoxProps<HTMLElement>, "enableResizeOnTop" | "enableResizeOnBottom" | "enableResizeOnLeft" | "enableResizeOnRight"> & import('../../overlay/index.js').FrameOwnProps & React.RefAttributes<HTMLElement>>;
|
|
6
5
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/surfaces/modal/modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAS,KAAK,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/surfaces/modal/modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAMtE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AAEpC,eAAO,MAAM,KAAK,+QAkBhB,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { clsx as
|
|
2
|
+
import { clsx as e } from "clsx";
|
|
3
3
|
import s from "react";
|
|
4
4
|
import { Frame as d } from "../../overlay/frame/frame.js";
|
|
5
5
|
import { Scaffold as n } from "../../layouts/scaffold/scaffold.js";
|
|
6
|
-
import '../../modal.css';const i = "_modal_473c6ef", p = { modal: i },
|
|
6
|
+
import '../../modal.css';const i = "_modal_473c6ef", p = { modal: i }, N = s.forwardRef(function({ children: t, className: a, isOpen: r, draggable: m = !1, veil: c = !0, ...f }, l) {
|
|
7
7
|
return /* @__PURE__ */ o(
|
|
8
8
|
d,
|
|
9
9
|
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
ref: l,
|
|
11
|
+
isOpen: r,
|
|
12
|
+
draggable: m,
|
|
13
|
+
veil: c,
|
|
14
|
+
className: e(p.modal, "tcn-surface", "tcn-modal", a),
|
|
15
|
+
...f,
|
|
16
|
+
children: /* @__PURE__ */ o(n, { className: "tcn-modal-scaffold", width: "100%", height: "100%", children: t })
|
|
15
17
|
}
|
|
16
18
|
);
|
|
17
19
|
});
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
N as Modal
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../src/surfaces/modal/modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { Frame, type
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../../src/surfaces/modal/modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { Frame, type FrameProps } from '../../overlay/frame/frame.js';\nimport { Scaffold } from '../../layouts/scaffold/scaffold.js';\n\n// Styles\nimport styles from './modal.module.css';\n\nexport type ModalProps = FrameProps;\n\nexport const Modal = React.forwardRef<HTMLElement, ModalProps>(function Modal(\n { children, className, isOpen, draggable = false, veil = true, ...props }: ModalProps,\n ref\n) {\n return (\n <Frame\n ref={ref}\n isOpen={isOpen}\n draggable={draggable}\n veil={veil}\n className={clsx(styles['modal'], 'tcn-surface', 'tcn-modal', className)}\n {...props}\n >\n <Scaffold className={'tcn-modal-scaffold'} width=\"100%\" height=\"100%\">\n {children}\n </Scaffold>\n </Frame>\n );\n});\n"],"names":["Modal","React","children","className","isOpen","draggable","veil","props","ref","jsx","Frame","clsx","styles","Scaffold"],"mappings":";;;;;8CAUaA,IAAQC,EAAM,WAAoC,SAC7D,EAAE,UAAAC,GAAU,WAAAC,GAAW,QAAAC,GAAQ,WAAAC,IAAY,IAAO,MAAAC,IAAO,IAAM,GAAGC,EAAA,GAClEC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,QAAAJ;AAAA,MACA,WAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAWK,EAAKC,EAAO,OAAU,eAAe,aAAaT,CAAS;AAAA,MACrE,GAAGI;AAAA,MAEJ,UAAA,gBAAAE,EAACI,KAAS,WAAW,sBAAsB,OAAM,QAAO,QAAO,QAC5D,UAAAX,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pop_confirm.d.ts","sourceRoot":"","sources":["../../../src/surfaces/pop_confirm/pop_confirm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAEjD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"pop_confirm.d.ts","sourceRoot":"","sources":["../../../src/surfaces/pop_confirm/pop_confirm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAEjD,eAAO,MAAM,UAAU,iLAyBtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { clsx as
|
|
3
|
-
import
|
|
2
|
+
import { clsx as e } from "clsx";
|
|
3
|
+
import n from "react";
|
|
4
4
|
import "../../layouts/column/column.js";
|
|
5
5
|
import "../../divider.module-FptFV0PX.js";
|
|
6
6
|
import "../../layouts/grid/grid.js";
|
|
@@ -8,7 +8,7 @@ import "../../layouts/list/item.js";
|
|
|
8
8
|
import "../../layouts/list/list.js";
|
|
9
9
|
import "../../layouts/sidebar_end/sidebar_end.js";
|
|
10
10
|
import "../../layouts/sidebar_start/sidebar_start.js";
|
|
11
|
-
import { Scaffold as
|
|
11
|
+
import { Scaffold as c } from "../../layouts/scaffold/scaffold.js";
|
|
12
12
|
import "../../layouts/body/h_body.js";
|
|
13
13
|
import "../../layouts/body/v_body.js";
|
|
14
14
|
import "../../layouts/footer/footer.js";
|
|
@@ -29,24 +29,30 @@ import "../../stacks/z_stack.js";
|
|
|
29
29
|
import "../../layouts/rail/rail.js";
|
|
30
30
|
import "../../layouts/rail/side/side.js";
|
|
31
31
|
import "../../layouts/rail/utility_strip/utility_strip.js";
|
|
32
|
-
import { PopperDismissal as
|
|
32
|
+
import { PopperDismissal as l } from "../../overlay/popper/base/dismissal_decorator.js";
|
|
33
33
|
import { ElementPopper as s } from "../../overlay/popper/element_popper.js";
|
|
34
|
-
const
|
|
35
|
-
function({
|
|
34
|
+
const O = n.forwardRef(
|
|
35
|
+
function({
|
|
36
|
+
children: r,
|
|
37
|
+
className: m,
|
|
38
|
+
precision: t = "low",
|
|
39
|
+
dismissals: i = [l.CLICK_AWAY],
|
|
40
|
+
...p
|
|
41
|
+
}, f) {
|
|
36
42
|
return /* @__PURE__ */ o(
|
|
37
43
|
s,
|
|
38
44
|
{
|
|
39
|
-
ref:
|
|
40
|
-
precision:
|
|
41
|
-
className:
|
|
42
|
-
dismissals:
|
|
45
|
+
ref: f,
|
|
46
|
+
precision: t,
|
|
47
|
+
className: e(m, "tcn-pop-confirm"),
|
|
48
|
+
dismissals: i,
|
|
43
49
|
...p,
|
|
44
|
-
children: /* @__PURE__ */ o(
|
|
50
|
+
children: /* @__PURE__ */ o(c, { width: "100%", height: "100%", children: r })
|
|
45
51
|
}
|
|
46
52
|
);
|
|
47
53
|
}
|
|
48
54
|
);
|
|
49
55
|
export {
|
|
50
|
-
|
|
56
|
+
O as PopConfirm
|
|
51
57
|
};
|
|
52
58
|
//# sourceMappingURL=pop_confirm.js.map
|