@bioturing/components 0.37.1 → 0.39.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.
Files changed (56) hide show
  1. package/dist/components/cmdk/index.d.ts +2 -2
  2. package/dist/components/combobox/component.js.map +1 -1
  3. package/dist/components/data-table/component.js +7 -7
  4. package/dist/components/data-table/component.js.map +1 -1
  5. package/dist/components/data-table/hooks.d.ts.map +1 -1
  6. package/dist/components/data-table/hooks.js +73 -61
  7. package/dist/components/data-table/hooks.js.map +1 -1
  8. package/dist/components/dropdown-menu/component.js +1 -1
  9. package/dist/components/dropdown-menu/component.js.map +1 -1
  10. package/dist/components/hooks/useResizable.d.ts +50 -0
  11. package/dist/components/hooks/useResizable.d.ts.map +1 -0
  12. package/dist/components/hooks/useResizable.js +148 -0
  13. package/dist/components/hooks/useResizable.js.map +1 -0
  14. package/dist/components/index.d.ts +1 -0
  15. package/dist/components/index.d.ts.map +1 -1
  16. package/dist/components/popup-panel/component.d.ts +13 -1
  17. package/dist/components/popup-panel/component.d.ts.map +1 -1
  18. package/dist/components/popup-panel/component.js +134 -120
  19. package/dist/components/popup-panel/component.js.map +1 -1
  20. package/dist/components/popup-panel/utils.d.ts +10 -0
  21. package/dist/components/popup-panel/utils.d.ts.map +1 -0
  22. package/dist/components/popup-panel/utils.js +13 -0
  23. package/dist/components/popup-panel/utils.js.map +1 -0
  24. package/dist/components/resizable/component.d.ts +2 -8
  25. package/dist/components/resizable/component.d.ts.map +1 -1
  26. package/dist/components/resizable/component.js +250 -248
  27. package/dist/components/resizable/component.js.map +1 -1
  28. package/dist/components/toast/function.d.ts +8 -8
  29. package/dist/components/toast/function.d.ts.map +1 -1
  30. package/dist/components/toast/function.js.map +1 -1
  31. package/dist/components/tree/components.d.ts.map +1 -1
  32. package/dist/components/tree/components.js +50 -40
  33. package/dist/components/tree/components.js.map +1 -1
  34. package/dist/components/tree/style.css +1 -1
  35. package/dist/components/tree/types.d.ts +4 -0
  36. package/dist/components/tree/types.d.ts.map +1 -1
  37. package/dist/components/tree/useTreeCommon.d.ts +1 -0
  38. package/dist/components/tree/useTreeCommon.d.ts.map +1 -1
  39. package/dist/components/tree/useTreeCommon.js +21 -19
  40. package/dist/components/tree/useTreeCommon.js.map +1 -1
  41. package/dist/components/window-portal/component.d.ts +24 -0
  42. package/dist/components/window-portal/component.d.ts.map +1 -0
  43. package/dist/components/window-portal/component.js +120 -0
  44. package/dist/components/window-portal/component.js.map +1 -0
  45. package/dist/components/window-portal/index.d.ts +3 -0
  46. package/dist/components/window-portal/index.d.ts.map +1 -0
  47. package/dist/components/window-portal/types.d.ts +77 -0
  48. package/dist/components/window-portal/types.d.ts.map +1 -0
  49. package/dist/index.js +81 -79
  50. package/dist/index.js.map +1 -1
  51. package/dist/metadata.d.ts +8 -0
  52. package/dist/metadata.d.ts.map +1 -1
  53. package/dist/metadata.js +18 -0
  54. package/dist/metadata.js.map +1 -1
  55. package/dist/stats.html +1 -1
  56. package/package.json +3 -3
@@ -0,0 +1,50 @@
1
+ import { default as React } from 'react';
2
+ type SharedProps = {
3
+ maxHeight?: number;
4
+ maxWidth?: number;
5
+ minHeight?: number;
6
+ minWidth?: number;
7
+ lockHorizontal?: boolean;
8
+ lockVertical?: boolean;
9
+ onResize?: (values: MoveValues) => void;
10
+ onDragEnd?: (values: MoveValues) => void;
11
+ onDragStart?: (values: MoveValues) => void;
12
+ disabled?: boolean;
13
+ maintainAspectRatio?: boolean;
14
+ };
15
+ export interface ResizableProps extends SharedProps {
16
+ interval?: number;
17
+ initialHeight?: number | string;
18
+ initialWidth?: number | string;
19
+ }
20
+ export interface ResizeHandleProps extends SharedProps {
21
+ parent?: React.RefObject<HTMLElement>;
22
+ interval?: number;
23
+ reverse?: boolean;
24
+ corner?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
25
+ }
26
+ export type MoveValues = {
27
+ newHeight: number;
28
+ heightDiff: number;
29
+ newWidth: number;
30
+ widthDiff: number;
31
+ };
32
+ export declare const useResizable: (options: ResizableProps) => {
33
+ rootRef: React.RefObject<HTMLDivElement>;
34
+ getRootProps: () => {
35
+ ref: React.RefObject<HTMLDivElement>;
36
+ style: {
37
+ height: string | number;
38
+ width: string | number;
39
+ };
40
+ };
41
+ getHandleProps: (handleProps?: ResizeHandleProps) => {
42
+ onMouseDown: (e: React.MouseEvent | React.TouchEvent) => void;
43
+ onTouchStart: (e: React.MouseEvent | React.TouchEvent) => void;
44
+ style: {
45
+ cursor: any;
46
+ };
47
+ };
48
+ };
49
+ export {};
50
+ //# sourceMappingURL=useResizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizable.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useResizable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;CACpE;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAkCF,eAAO,MAAM,YAAY,GAAI,SAAS,cAAc;;;;;;;;;mCAmBZ,iBAAiB;yBAgK9B,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU;0BAAnC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU;;;;;CA6F7D,CAAC"}
@@ -0,0 +1,148 @@
1
+ import { useRef as C } from "react";
2
+ const F = {
3
+ interval: 1,
4
+ initialHeight: 100,
5
+ initialWidth: 100,
6
+ lockHorizontal: !1,
7
+ lockVertical: !1
8
+ }, B = (X) => {
9
+ const E = {
10
+ ...F,
11
+ ...X
12
+ }, m = C(null);
13
+ return {
14
+ rootRef: m,
15
+ getRootProps: () => {
16
+ const { initialHeight: p, initialWidth: n } = E;
17
+ return {
18
+ ref: m,
19
+ style: {
20
+ height: p,
21
+ width: n
22
+ }
23
+ };
24
+ },
25
+ getHandleProps: (p) => {
26
+ p || (p = {});
27
+ const {
28
+ parent: n = m,
29
+ interval: d = 1,
30
+ maxHeight: W = Number.MAX_SAFE_INTEGER,
31
+ maxWidth: D = Number.MAX_SAFE_INTEGER,
32
+ reverse: R,
33
+ lockHorizontal: w,
34
+ lockVertical: v,
35
+ onResize: y,
36
+ onDragEnd: M,
37
+ onDragStart: x,
38
+ minHeight: z = 0,
39
+ minWidth: A = 0,
40
+ disabled: H = !1,
41
+ maintainAspectRatio: L = !1,
42
+ corner: g
43
+ } = { ...E, ...p }, b = (r, c, s, o, t, l) => {
44
+ if (H) return;
45
+ const u = n?.current?.clientWidth || 0, h = n?.current?.clientHeight || 0;
46
+ let e = h, i = u;
47
+ const Y = g === "top-left" || g === "top-right", _ = g === "top-left" || g === "bottom-left", $ = R || Y ? -1 : 1, P = R || _ ? -1 : 1;
48
+ if (!v) {
49
+ const a = c + (r - s) * $;
50
+ e = Math.round(a / d) * d, e <= 0 && (e = d), e >= W && (e = W), e <= z && (e = z), n?.current && (n.current.style.height = `${e}px`);
51
+ }
52
+ if (!w) {
53
+ const a = t + (o - l) * P;
54
+ i = Math.round(a / d) * d, i <= 0 && (i = d), i >= D && (i = D), i <= A && (i = A), n?.current && (n.current.style.width = `${i}px`);
55
+ }
56
+ if (L) {
57
+ const a = u / h;
58
+ i / e > a ? (i = e * a, n?.current && (n.current.style.width = `${i}px`)) : (e = i / a, n?.current && (n.current.style.height = `${e}px`));
59
+ }
60
+ y && y({
61
+ newHeight: e,
62
+ heightDiff: e - h,
63
+ newWidth: i,
64
+ widthDiff: i - u
65
+ });
66
+ }, k = (r, c, s, o) => (t) => {
67
+ t instanceof MouseEvent && b(
68
+ t.clientY,
69
+ r,
70
+ c,
71
+ t.clientX,
72
+ s,
73
+ o
74
+ );
75
+ }, N = (r, c, s, o) => (t) => {
76
+ t.preventDefault(), t instanceof TouchEvent && b(
77
+ t.touches[0].clientY,
78
+ r,
79
+ c,
80
+ t.touches[0].clientX,
81
+ s,
82
+ o
83
+ );
84
+ }, S = (r, c, s, o, t) => {
85
+ function l() {
86
+ if (document.removeEventListener(c, r), document.removeEventListener(s, l), M) {
87
+ const u = n?.current?.clientWidth || 0, h = n?.current?.clientHeight || 0;
88
+ M({
89
+ newHeight: h,
90
+ heightDiff: h - o,
91
+ newWidth: u,
92
+ widthDiff: u - t
93
+ });
94
+ }
95
+ }
96
+ return l;
97
+ }, T = (r) => {
98
+ if (H) return;
99
+ const c = n?.current?.clientHeight || 0, s = n?.current?.clientWidth || 0;
100
+ let o = null, t = null, l = null;
101
+ if (r.type === "mousedown") {
102
+ const { clientY: h, clientX: e } = r;
103
+ o = k(
104
+ c,
105
+ h,
106
+ s,
107
+ e
108
+ ), t = "mousemove", l = "mouseup";
109
+ } else if (r.type === "touchstart") {
110
+ const { touches: h } = r, { clientY: e, clientX: i } = h[0];
111
+ o = N(
112
+ c,
113
+ e,
114
+ s,
115
+ i
116
+ ), t = "touchmove", l = "touchend";
117
+ }
118
+ if (!o || !t || !l) return;
119
+ x && x({
120
+ newHeight: c,
121
+ heightDiff: 0,
122
+ newWidth: s,
123
+ widthDiff: 0
124
+ });
125
+ const u = S(
126
+ o,
127
+ t,
128
+ l,
129
+ c,
130
+ s
131
+ );
132
+ document.addEventListener(t, o, { passive: !1 }), document.addEventListener(l, u);
133
+ };
134
+ let f;
135
+ return H ? f = "not-allowed" : w && v ? f = "default" : w ? f = "row-resize" : v ? f = "col-resize" : g === "top-left" || g === "bottom-right" ? f = "nwse-resize" : f = "nesw-resize", {
136
+ onMouseDown: T,
137
+ onTouchStart: T,
138
+ style: {
139
+ cursor: f
140
+ }
141
+ };
142
+ }
143
+ };
144
+ };
145
+ export {
146
+ B as useResizable
147
+ };
148
+ //# sourceMappingURL=useResizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizable.js","sources":["../../../src/components/hooks/useResizable.ts"],"sourcesContent":["import React, { useRef } from \"react\";\n\ntype SharedProps = {\n maxHeight?: number;\n maxWidth?: number;\n minHeight?: number;\n minWidth?: number;\n lockHorizontal?: boolean;\n lockVertical?: boolean;\n onResize?: (values: MoveValues) => void;\n onDragEnd?: (values: MoveValues) => void;\n onDragStart?: (values: MoveValues) => void;\n disabled?: boolean;\n maintainAspectRatio?: boolean;\n};\n\nexport interface ResizableProps extends SharedProps {\n interval?: number;\n initialHeight?: number | string;\n initialWidth?: number | string;\n}\n\nexport interface ResizeHandleProps extends SharedProps {\n parent?: React.RefObject<HTMLElement>;\n interval?: number;\n reverse?: boolean;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n}\n\nexport type MoveValues = {\n newHeight: number;\n heightDiff: number;\n newWidth: number;\n widthDiff: number;\n};\n\ntype HandleMouseMove = (\n startHeight: number,\n startY: number,\n startWidth: number,\n startX: number\n) => (e: Event) => void;\n\ntype HandleTouchMove = (\n startHeight: number,\n startY: number,\n startWidth: number,\n startX: number\n) => (e: Event) => void;\n\nenum MoveEvent {\n MouseMove = \"mousemove\",\n TouchMove = \"touchmove\",\n}\n\nenum EndEvent {\n MouseUp = \"mouseup\",\n TouchEnd = \"touchend\",\n}\n\nconst defaultProps: ResizableProps = {\n interval: 1,\n initialHeight: 100,\n initialWidth: 100,\n lockHorizontal: false,\n lockVertical: false,\n};\n\nexport const useResizable = (options: ResizableProps) => {\n const props: ResizableProps = {\n ...defaultProps,\n ...options,\n };\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n const getRootProps = () => {\n const { initialHeight, initialWidth } = props;\n return {\n ref: parentRef,\n style: {\n height: initialHeight,\n width: initialWidth,\n },\n };\n };\n\n const getHandleProps = (handleProps?: ResizeHandleProps) => {\n if (!handleProps) {\n handleProps = {};\n }\n const {\n parent = parentRef,\n interval = 1,\n maxHeight = Number.MAX_SAFE_INTEGER,\n maxWidth = Number.MAX_SAFE_INTEGER,\n reverse,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd,\n onDragStart,\n minHeight = 0,\n minWidth = 0,\n disabled = false,\n maintainAspectRatio = false,\n corner,\n } = { ...props, ...handleProps };\n\n const handleMove = (\n clientY: number,\n startHeight: number,\n startY: number,\n clientX: number,\n startWidth: number,\n startX: number\n ) => {\n if (disabled) return;\n const currentWidth = parent?.current?.clientWidth || 0;\n const currentHeight = parent?.current?.clientHeight || 0;\n let roundedHeight = currentHeight;\n let roundedWidth = currentWidth;\n\n // Determine resize direction based on corner\n const isTopCorner = corner === \"top-left\" || corner === \"top-right\";\n const isLeftCorner = corner === \"top-left\" || corner === \"bottom-left\";\n\n // For top corners, Y direction is reversed\n const yDirection = reverse ? -1 : isTopCorner ? -1 : 1;\n // For left corners, X direction is reversed\n const xDirection = reverse ? -1 : isLeftCorner ? -1 : 1;\n\n if (!lockVertical) {\n const newHeight = startHeight + (clientY - startY) * yDirection;\n // Round height to nearest interval\n roundedHeight = Math.round(newHeight / interval) * interval;\n if (roundedHeight <= 0) {\n roundedHeight = interval;\n }\n if (roundedHeight >= maxHeight) {\n roundedHeight = maxHeight;\n }\n if (roundedHeight <= minHeight) {\n roundedHeight = minHeight;\n }\n\n if (parent?.current) {\n parent.current.style.height = `${roundedHeight}px`;\n }\n }\n\n if (!lockHorizontal) {\n const newWidth = startWidth + (clientX - startX) * xDirection;\n // Round width to nearest interval\n roundedWidth = Math.round(newWidth / interval) * interval;\n if (roundedWidth <= 0) {\n roundedWidth = interval;\n }\n if (roundedWidth >= maxWidth) {\n roundedWidth = maxWidth;\n }\n if (roundedWidth <= minWidth) {\n roundedWidth = minWidth;\n }\n\n if (parent?.current) {\n parent.current.style.width = `${roundedWidth}px`;\n }\n }\n\n if (maintainAspectRatio) {\n const aspectRatio = currentWidth / currentHeight;\n const newAspectRatio = roundedWidth / roundedHeight;\n if (newAspectRatio > aspectRatio) {\n roundedWidth = roundedHeight * aspectRatio;\n if (parent?.current) {\n parent.current.style.width = `${roundedWidth}px`;\n }\n } else {\n roundedHeight = roundedWidth / aspectRatio;\n if (parent?.current) {\n parent.current.style.height = `${roundedHeight}px`;\n }\n }\n }\n if (onResize) {\n onResize({\n newHeight: roundedHeight,\n heightDiff: roundedHeight - currentHeight,\n newWidth: roundedWidth,\n widthDiff: roundedWidth - currentWidth,\n });\n }\n };\n\n const handleMouseMove: HandleMouseMove =\n (startHeight, startY, startWidth, startX) => (e: Event) => {\n if (!(e instanceof MouseEvent)) return;\n handleMove(\n e.clientY,\n startHeight,\n startY,\n e.clientX,\n startWidth,\n startX\n );\n };\n\n const handleTouchMove: HandleTouchMove =\n (startHeight, startY, startWidth, startX) => (e: Event) => {\n e.preventDefault();\n if (!(e instanceof TouchEvent)) return;\n handleMove(\n e.touches[0].clientY,\n startHeight,\n startY,\n e.touches[0].clientX,\n startWidth,\n startX\n );\n };\n\n const handleDragEnd = (\n handleMoveInstance: (e: Event) => void,\n moveEvent: \"mousemove\" | \"touchmove\",\n endEvent: \"mouseup\" | \"touchend\",\n startHeight: number,\n startWidth: number\n ) => {\n function dragHandler() {\n document.removeEventListener(moveEvent, handleMoveInstance);\n document.removeEventListener(endEvent, dragHandler);\n if (onDragEnd) {\n const currentWidth = parent?.current?.clientWidth || 0;\n const currentHeight = parent?.current?.clientHeight || 0;\n onDragEnd({\n newHeight: currentHeight,\n heightDiff: currentHeight - startHeight,\n newWidth: currentWidth,\n widthDiff: currentWidth - startWidth,\n });\n }\n }\n\n return dragHandler;\n };\n\n const handleDown = (e: React.MouseEvent | React.TouchEvent) => {\n if (disabled) return;\n\n const startHeight = parent?.current?.clientHeight || 0;\n const startWidth = parent?.current?.clientWidth || 0;\n\n let moveHandler = null;\n let moveEvent = null;\n let endEvent = null;\n if (e.type === \"mousedown\") {\n const { clientY, clientX } = e as React.MouseEvent;\n moveHandler = handleMouseMove(\n startHeight,\n clientY,\n startWidth,\n clientX\n );\n moveEvent = MoveEvent.MouseMove;\n endEvent = EndEvent.MouseUp;\n } else if (e.type === \"touchstart\") {\n const { touches } = e as React.TouchEvent;\n const { clientY, clientX } = touches[0];\n moveHandler = handleTouchMove(\n startHeight,\n clientY,\n startWidth,\n clientX\n );\n moveEvent = MoveEvent.TouchMove;\n endEvent = EndEvent.TouchEnd;\n }\n\n if (!moveHandler || !moveEvent || !endEvent) return;\n\n if (onDragStart) {\n onDragStart({\n newHeight: startHeight,\n heightDiff: 0,\n newWidth: startWidth,\n widthDiff: 0,\n });\n }\n\n const dragEndHandler = handleDragEnd(\n moveHandler,\n moveEvent,\n endEvent,\n startHeight,\n startWidth\n );\n\n // Attach the mousemove/mouseup/touchmove/touchend listeners to the document\n // so that we can handle the case where the user drags outside of the element\n document.addEventListener(moveEvent, moveHandler, { passive: false });\n document.addEventListener(endEvent, dragEndHandler);\n };\n\n let cursor;\n if (disabled) {\n cursor = \"not-allowed\";\n } else if (lockHorizontal && lockVertical) {\n cursor = \"default\";\n } else if (lockHorizontal) {\n cursor = \"row-resize\";\n } else if (lockVertical) {\n cursor = \"col-resize\";\n } else {\n // Determine cursor based on corner position\n // top-left (NW) and bottom-right (SE): nwse-resize (↖↘)\n // top-right (NE) and bottom-left (SW): nesw-resize (↗↙)\n if (corner === \"top-left\" || corner === \"bottom-right\") {\n cursor = \"nwse-resize\";\n } else {\n cursor = \"nesw-resize\";\n }\n }\n\n const style = {\n cursor,\n };\n\n return {\n onMouseDown: handleDown,\n onTouchStart: handleDown,\n style,\n };\n };\n\n return {\n rootRef: parentRef,\n getRootProps,\n getHandleProps,\n };\n};\n"],"names":["defaultProps","useResizable","options","props","parentRef","useRef","initialHeight","initialWidth","handleProps","parent","interval","maxHeight","maxWidth","reverse","lockHorizontal","lockVertical","onResize","onDragEnd","onDragStart","minHeight","minWidth","disabled","maintainAspectRatio","corner","handleMove","clientY","startHeight","startY","clientX","startWidth","startX","currentWidth","currentHeight","roundedHeight","roundedWidth","isTopCorner","isLeftCorner","yDirection","xDirection","newHeight","newWidth","aspectRatio","handleMouseMove","e","handleTouchMove","handleDragEnd","handleMoveInstance","moveEvent","endEvent","dragHandler","handleDown","moveHandler","touches","dragEndHandler","cursor"],"mappings":";AA4DA,MAAMA,IAA+B;AAAA,EACnC,UAAU;AAAA,EACV,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAChB,GAEaC,IAAe,CAACC,MAA4B;AACvD,QAAMC,IAAwB;AAAA,IAC5B,GAAGH;AAAA,IACH,GAAGE;AAAA,EAAA,GAGCE,IAAYC,EAAuB,IAAI;AAqQ7C,SAAO;AAAA,IACL,SAASD;AAAA,IACT,cArQmB,MAA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AA,UACrBM;AAAA,UACAJ;AAAA,UACAC;AAAA,UACAtB;AAAA,UACAG;AAAA,QAAA;AAKF,iBAAS,iBAAiBkB,GAAWI,GAAa,EAAE,SAAS,IAAO,GACpE,SAAS,iBAAiBH,GAAUK,CAAc;AAAA,MACpD;AAEA,UAAIC;AACJ,aAAIjC,IACFiC,IAAS,gBACAxC,KAAkBC,IAC3BuC,IAAS,YACAxC,IACTwC,IAAS,eACAvC,IACTuC,IAAS,eAKL/B,MAAW,cAAcA,MAAW,iBACtC+B,IAAS,gBAETA,IAAS,eAQN;AAAA,QACL,aAAaJ;AAAA,QACb,cAAcA;AAAA,QACd,OAPY;AAAA,UACZ,QAAAI;AAAA,QAAA;AAAA,MAMA;AAAA,IAEJ;AAAA,EAKE;AAEJ;"}
@@ -50,6 +50,7 @@ export * from './resizable/index';
50
50
  export * from './combobox/index';
51
51
  export * from './select-trigger/index';
52
52
  export * from './loader/index';
53
+ export * from './window-portal/index';
53
54
  export * from './utils/index';
54
55
  export * from './hooks/index';
55
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,GAAG,EACH,YAAY,EACZ,MAAM,EACN,OAAO,EAIP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EAER,GAAG,EAEH,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EAER,IAAI,EACJ,WAAW,EAEX,IAAI,EAGJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EAEP,YAAY,EACZ,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,MAAM,EAEN,IAAI,EACJ,MAAM,EACN,GAAG,EAGH,QAAQ,EAER,KAAK,EAEL,SAAS,EACT,KAAK,EAGL,IAAI,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,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,GAAG,EACH,YAAY,EACZ,MAAM,EACN,OAAO,EAIP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EAER,GAAG,EAEH,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EAER,IAAI,EACJ,WAAW,EAEX,IAAI,EAGJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EAEP,YAAY,EACZ,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,MAAM,EAEN,IAAI,EACJ,MAAM,EACN,GAAG,EAGH,QAAQ,EAER,KAAK,EAEL,SAAS,EACT,KAAK,EAGL,IAAI,EAEJ,KAAK,EACL,UAAU,EACV,QAAQ,EAGR,QAAQ,EAER,UAAU,EACV,UAAU,EAEV,OAAO,EACP,SAAS,EAET,iBAAiB,GAClB,MAAM,MAAM,CAAC;AAEd,YAAY,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,YAAY,EAKZ,YAAY,EACZ,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAElB,WAAW,EACX,QAAQ,EAGR,gBAAgB,EAChB,mBAAmB,EACnB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Ac,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AAEtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -95,6 +95,18 @@ export interface PopupPanelProps extends Omit<React.ComponentPropsWithRef<"div">
95
95
  * Callback function when the placement changes
96
96
  */
97
97
  onPlacementChange?: (placement: PopoverProps["placement"]) => void;
98
+ /**
99
+ * Props to pass to the positioner
100
+ */
101
+ positionerProps?: Popover.Positioner.Props;
102
+ /**
103
+ * Props to pass to the trigger
104
+ */
105
+ triggerProps?: Popover.Trigger.Props;
106
+ /**
107
+ * Props to pass to the portal
108
+ */
109
+ portalProps?: Popover.Portal.Props;
98
110
  }
99
- export declare const PopupPanel: ({ children, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, content, title, trigger, className, anchor, beforeCloseButton, afterCloseButton, afterTitle, size, footer, defaultOpen, resizable, draggable, maintainAspectRatio, classNames, modal, closeOnClickOutside, onPlacementChange, ...rest }: PopupPanelProps) => import("react/jsx-runtime").JSX.Element;
111
+ export declare const PopupPanel: ({ children, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, content, title, trigger, className, anchor, beforeCloseButton, afterCloseButton, afterTitle, size, footer, defaultOpen, resizable, draggable, maintainAspectRatio, classNames, modal, closeOnClickOutside, onPlacementChange, positionerProps, triggerProps, portalProps, ...rest }: PopupPanelProps) => import("react/jsx-runtime").JSX.Element;
100
112
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/popup-panel/component.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7C,OAAO,aAAa,CAAC;AAIrB,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAClC,OAAO,GAAG,SAAS,GAAG,UAAU,CACjC,EACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC;IACtC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC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AC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnE;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;IAC3C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;CACpC;AAED,eAAO,MAAM,UAAU,GAAI,+WA4BxB,eAAe,4CAkNjB,CAAC"}
@@ -1,182 +1,196 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
- import { Popover as i } from "@base-ui-components/react/popover";
4
- import { useMemo as Y, useRef as N, useState as Z, useEffect as _, useCallback as B } from "react";
5
- import { X as D } from "@bioturing/assets";
6
- import { PopupPanelSize as ee } from "./constants.js";
7
- import { Stack as re } from "../stack/index.js";
2
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
+ import { Popover as a } from "@base-ui-components/react/popover";
4
+ import { mergeProps as S } from "@base-ui-components/react";
5
+ import { X as re } from "@bioturing/assets";
6
+ import { useMemo as te, useRef as A, useState as x, useEffect as ne, useCallback as oe } from "react";
7
+ import { Stack as ie } from "../stack/index.js";
8
+ import { PopupPanelSize as ae } from "./constants.js";
8
9
  import './style.css';/* empty css */
9
- import { parseAntdPlacement as te, buildAntdPlacement as ne } from "../utils/placement.js";
10
- import { useDraggable as oe } from "../hooks/useDraggable.js";
11
- import { Resizable as ie } from "../resizable/component.js";
12
- import { useControlledState as pe } from "../hooks/useControlledState.js";
13
- import { useCls as ae } from "../utils/antdUtils.js";
14
- import { useTheme as se } from "../theme-provider/context/themeStore.js";
10
+ import { anchorToResizeHandles as pe } from "./utils.js";
11
+ import { parseAntdPlacement as se, buildAntdPlacement as le } from "../utils/placement.js";
12
+ import { useDraggable as ce } from "../hooks/useDraggable.js";
13
+ import { Resizable as ue } from "../resizable/component.js";
14
+ import { useControlledState as de } from "../hooks/useControlledState.js";
15
+ import { useCls as me } from "../utils/antdUtils.js";
16
+ import { useTheme as fe } from "../theme-provider/context/themeStore.js";
15
17
  import { clsx as p } from "../utils/cn.js";
16
- import { IconButton as le } from "../icon-button/component.js";
17
- const Re = ({
18
- children: x,
19
- placement: z,
18
+ import { IconButton as ge } from "../icon-button/component.js";
19
+ const Ie = ({
20
+ children: z,
21
+ placement: H,
20
22
  openOnHover: k = !1,
21
- open: H,
23
+ open: E,
22
24
  onOpenChange: I,
23
25
  content: K,
24
- title: d,
25
- trigger: j = "click",
26
- className: E,
26
+ title: h,
27
+ trigger: T = "click",
28
+ className: j,
27
29
  anchor: M,
28
- beforeCloseButton: w,
29
- afterCloseButton: y,
30
- afterTitle: f,
31
- size: m = "medium",
32
- footer: c,
33
- defaultOpen: T = !1,
34
- resizable: C = !1,
30
+ beforeCloseButton: N,
31
+ afterCloseButton: w,
32
+ afterTitle: b,
33
+ size: P = "medium",
34
+ footer: u,
35
+ defaultOpen: D = !1,
36
+ resizable: y = !1,
35
37
  draggable: F = !1,
36
38
  maintainAspectRatio: U = !1,
37
- classNames: t,
39
+ classNames: n,
38
40
  modal: V = !1,
39
41
  closeOnClickOutside: X = !0,
40
- onPlacementChange: g,
41
- ...$
42
+ onPlacementChange: v,
43
+ positionerProps: $ = {},
44
+ triggerProps: q = {},
45
+ portalProps: G = {},
46
+ ...J
42
47
  }) => {
43
- const [h, O] = pe(
44
- H,
48
+ const [R, C] = de(
49
+ E,
45
50
  I,
46
- T
51
+ D
47
52
  // Always provide a default value to prevent undefined
48
- ), r = ae(), { className: q } = se(), u = te(z), R = Y(() => /* @__PURE__ */ e(D, { size: 16 }), []), A = N(null), b = N(u.side), P = N(u.align), [G, J] = Z(0);
49
- _(() => {
50
- const a = A.current;
51
- if (!a || !h) return;
52
- const s = new MutationObserver((W) => {
53
- let v = !1;
54
- if (W.forEach((o) => {
55
- if (o.type === "attributes" && o.attributeName === "data-side") {
56
- const n = a.getAttribute(o.attributeName);
57
- n && n !== b.current && (b.current = n, v = !0);
53
+ ), r = me(), { className: L } = fe(), d = se(H), O = te(() => /* @__PURE__ */ e(re, { size: 16 }), []), m = A(d.side), f = A(d.align), [Q, W] = x(0), [l, Y] = x(
54
+ null
55
+ );
56
+ ne(() => {
57
+ if (!l || !R) return;
58
+ const i = new MutationObserver((s) => {
59
+ let g = !1;
60
+ if (s.forEach((t) => {
61
+ if (t.type === "attributes" && t.attributeName === "data-side") {
62
+ const o = l.getAttribute(t.attributeName);
63
+ o && o !== m.current && (m.current = o, g = !0);
58
64
  }
59
- if (o.type === "attributes" && o.attributeName === "data-align") {
60
- const n = a.getAttribute(o.attributeName);
61
- n && n !== P.current && (P.current = n, v = !0);
65
+ if (t.type === "attributes" && t.attributeName === "data-align") {
66
+ const o = l.getAttribute(t.attributeName);
67
+ o && o !== f.current && (f.current = o, g = !0);
62
68
  }
63
- }), v) {
64
- const o = ne({
65
- side: b.current,
66
- align: P.current
69
+ }), g) {
70
+ const t = le({
71
+ side: m.current,
72
+ align: f.current
67
73
  });
68
- J((n) => n + 1), g && g(o);
74
+ W((o) => o + 1), v && v(t);
69
75
  }
70
76
  });
71
- return s.observe(a, {
77
+ return i.observe(l, {
72
78
  attributes: !0,
73
79
  attributeFilter: ["data-side", "data-align"],
74
80
  attributeOldValue: !0
75
81
  }), () => {
76
- s.disconnect();
82
+ i.disconnect();
77
83
  };
78
- }, [g, h]);
79
- const L = B(() => /* @__PURE__ */ l("div", { className: p(r("popup-panel-header"), t?.header), children: [
80
- /* @__PURE__ */ l(
81
- re,
84
+ }, [v, R, l]);
85
+ const Z = oe(() => /* @__PURE__ */ c("div", { className: p(r("popup-panel-header"), n?.header), children: [
86
+ /* @__PURE__ */ c(
87
+ ie,
82
88
  {
83
89
  align: "center",
84
90
  gap: 8,
85
91
  className: r("popup-panel-title-wrapper"),
86
92
  children: [
87
93
  /* @__PURE__ */ e(
88
- i.Title,
94
+ a.Title,
89
95
  {
90
- render: /* @__PURE__ */ e("div", { className: p(r("grow", "truncate"), t?.title), children: d })
96
+ render: /* @__PURE__ */ e("div", { className: p(r("grow", "truncate"), n?.title), children: h })
91
97
  }
92
98
  ),
93
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
94
- w,
99
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
100
+ N,
95
101
  /* @__PURE__ */ e(
96
- i.Close,
102
+ a.Close,
97
103
  {
98
- render: /* @__PURE__ */ e(le, { children: R })
104
+ render: /* @__PURE__ */ e(ge, { children: O })
99
105
  }
100
106
  ),
101
- y
107
+ w
102
108
  ] })
103
109
  ]
104
110
  }
105
111
  ),
106
- f || null
112
+ b || null
107
113
  ] }), [
108
- y,
109
- f,
110
114
  w,
115
+ b,
116
+ N,
111
117
  r,
112
- t?.header,
113
- t?.title,
114
- R,
115
- d
116
- ]), { ref: Q } = oe(F), S = /* @__PURE__ */ l(
117
- i.Popup,
118
+ n?.header,
119
+ n?.title,
120
+ O,
121
+ h
122
+ ]), { ref: _ } = ce(F), B = /* @__PURE__ */ c(
123
+ a.Popup,
118
124
  {
119
125
  className: p(
120
126
  r("popup-panel"),
121
- r(`popup-panel-size-${m}`),
122
- E,
123
- t?.popup
127
+ r(`popup-panel-size-${P}`),
128
+ j,
129
+ n?.popup
124
130
  ),
125
- ref: Q,
131
+ ref: _,
126
132
  children: [
127
- d && L(),
128
- /* @__PURE__ */ e("div", { className: p(r("popup-panel-content"), t?.content), children: /* @__PURE__ */ e("div", { className: r("popup-panel-content-inner"), children: K }) }),
129
- c && /* @__PURE__ */ e("div", { className: p(r("popup-panel-footer"), t?.footer), children: typeof c == "function" ? c({ close: () => O(!1) }) : c })
133
+ h && Z(),
134
+ /* @__PURE__ */ e("div", { className: p(r("popup-panel-content"), n?.content), children: /* @__PURE__ */ e("div", { className: r("popup-panel-content-inner"), children: K }) }),
135
+ u && /* @__PURE__ */ e("div", { className: p(r("popup-panel-footer"), n?.footer), children: typeof u == "function" ? u({ close: () => C(!1) }) : u })
130
136
  ]
131
137
  }
132
- );
133
- return /* @__PURE__ */ l(
134
- i.Root,
138
+ ), ee = {
139
+ ref: Y,
140
+ className: p(r("popup-panel-root"), L, n?.root),
141
+ side: d.side,
142
+ align: d.align,
143
+ sideOffset: 4,
144
+ anchor: M,
145
+ style: {
146
+ "--size-width": P ? ae[P] : void 0
147
+ },
148
+ render: ({ children: i, onDragEnd: s, onDragStart: g, ...t }) => y ? /* @__PURE__ */ e(
149
+ ue,
150
+ {
151
+ resizable: y,
152
+ resetKey: Q,
153
+ maintainAspectRatio: U,
154
+ classNames: {
155
+ resizeHandle: n?.resizeHandle
156
+ },
157
+ handles: pe(
158
+ m.current,
159
+ f.current
160
+ ),
161
+ ...t,
162
+ children: i
163
+ }
164
+ ) : /* @__PURE__ */ e("div", { ...t, children: i })
165
+ };
166
+ return /* @__PURE__ */ c(
167
+ a.Root,
135
168
  {
136
- openOnHover: j === "hover" ? !0 : k,
137
- open: h,
138
- onOpenChange: (a, s) => {
139
- (s.reason === "outside-press" || s.reason === "focus-out") && !X || O(a, s);
169
+ open: R,
170
+ onOpenChange: (i, s) => {
171
+ (s.reason === "outside-press" || s.reason === "focus-out") && !X || C(i, s);
140
172
  },
141
173
  modal: V,
142
- ...$,
174
+ ...J,
143
175
  children: [
144
176
  /* @__PURE__ */ e(
145
- i.Trigger,
177
+ a.Trigger,
146
178
  {
147
- render: x,
148
- className: p(r("popup-panel-trigger"), t?.trigger)
179
+ ...S(
180
+ {
181
+ render: z,
182
+ className: p(r("popup-panel-trigger"), n?.trigger),
183
+ openOnHover: T === "hover" ? !0 : k
184
+ },
185
+ q
186
+ )
149
187
  }
150
188
  ),
151
- /* @__PURE__ */ e(i.Portal, { children: /* @__PURE__ */ e(
152
- i.Positioner,
189
+ /* @__PURE__ */ e(a.Portal, { ...G, children: /* @__PURE__ */ e(
190
+ a.Positioner,
153
191
  {
154
- ref: A,
155
- className: p(
156
- r("popup-panel-root"),
157
- q,
158
- t?.root
159
- ),
160
- side: u.side,
161
- align: u.align,
162
- sideOffset: 4,
163
- anchor: M,
164
- style: {
165
- "--size-width": m ? ee[m] : void 0
166
- },
167
- children: C ? /* @__PURE__ */ e(
168
- ie,
169
- {
170
- resizable: C,
171
- absolutePositioning: !0,
172
- resetKey: G,
173
- maintainAspectRatio: U,
174
- classNames: {
175
- resizeHandle: t?.resizeHandle
176
- },
177
- children: S
178
- }
179
- ) : S
192
+ ...S(ee, $),
193
+ children: B
180
194
  }
181
195
  ) })
182
196
  ]
@@ -184,6 +198,6 @@ const Re = ({
184
198
  );
185
199
  };
186
200
  export {
187
- Re as PopupPanel
201
+ Ie as PopupPanel
188
202
  };
189
203
  //# sourceMappingURL=component.js.map