@bioturing/components 0.32.1 → 0.32.3

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/README.md CHANGED
@@ -64,6 +64,35 @@ Each component can be imported individually:
64
64
  import { Button } from '@bioturing/components/Button';
65
65
  ```
66
66
 
67
+ ## Tree-Shaking Support
68
+
69
+ This package is fully optimized for tree-shaking, allowing you to import only the components you need:
70
+
71
+ ### ✅ Recommended (Fully Tree-Shakable)
72
+ ```jsx
73
+ import { Button, Modal } from '@bioturing/components'
74
+ import '@bioturing/components/style.css'
75
+ ```
76
+
77
+ ### Bundle Analysis
78
+ To analyze your bundle and verify tree-shaking effectiveness:
79
+
80
+ ```bash
81
+ # Build the package
82
+ npm run build
83
+
84
+ # Open generated bundle analysis
85
+ open dist/stats.html
86
+ ```
87
+
88
+ The component library uses:
89
+ - **ESM format** for optimal tree-shaking
90
+ - **Preserved modules** for granular chunking
91
+ - **Side-effects configuration** for CSS handling
92
+ - **External dependencies** to minimize bundle size
93
+
94
+ Modern bundlers (Vite, Webpack 5+, Next.js) will automatically eliminate unused components from your final bundle.
95
+
67
96
  ## Styles
68
97
 
69
98
  The package includes two CSS files:
@@ -1,21 +1,18 @@
1
1
  "use client";
2
- import s from "antd/es/theme";
3
- import o from "antd/es/app/useApp";
2
+ import o from "antd/es/theme";
3
+ import s from "antd/es/app/useApp";
4
4
  import { default as c } from "antd/es/app/useApp";
5
- import { useForm as l, useWatch as d } from "antd/es/form/Form";
6
- const u = s.useToken, m = () => {
7
- const { message: e } = o();
5
+ const n = o.useToken, u = () => {
6
+ const { message: e } = s();
8
7
  return e;
9
- }, n = () => {
10
- const { modal: e } = o();
8
+ }, m = () => {
9
+ const { modal: e } = s();
11
10
  return e;
12
11
  };
13
12
  export {
14
13
  c as useApp,
15
- l as useForm,
16
- m as useMessage,
17
- n as useModal,
18
- u as useToken,
19
- d as useWatch
14
+ u as useMessage,
15
+ m as useModal,
16
+ n as useToken
20
17
  };
21
18
  //# sourceMappingURL=antd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"antd.js","sources":["../../../src/components/hooks/antd.ts"],"sourcesContent":["\"use client\";\nimport theme from \"antd/es/theme\";\n// import Grid from \"antd/es/grid\";\nimport useApp from \"antd/es/app/useApp\";\n\nexport const useToken = theme.useToken;\n// export const useBreakpoint = Grid.useBreakpoint;\n\nexport { useForm, useWatch } from \"antd/es/form/Form\";\n\nexport const useMessage = () => {\n const { message } = useApp();\n return message;\n};\n\nexport const useModal = () => {\n const { modal } = useApp();\n return modal;\n};\n\nexport { useApp };\n"],"names":["useToken","theme","useMessage","message","useApp","useModal","modal"],"mappings":";;;;;AAKO,MAAMA,IAAWC,EAAM,UAKjBC,IAAa,MAAM;AAC9B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA;AACpB,SAAOD;AACT,GAEaE,IAAW,MAAM;AAC5B,QAAM,EAAE,OAAAC,EAAA,IAAUF,EAAA;AAClB,SAAOE;AACT;"}
1
+ {"version":3,"file":"antd.js","sources":["../../../src/components/hooks/antd.ts"],"sourcesContent":["\"use client\";\nimport theme from \"antd/es/theme\";\n// import Grid from \"antd/es/grid\";\nimport useApp from \"antd/es/app/useApp\";\n\nexport const useToken = theme.useToken;\n// export const useBreakpoint = Grid.useBreakpoint;\n\nexport { useForm, useWatch } from \"antd/es/form/Form\";\n\nexport const useMessage = () => {\n const { message } = useApp();\n return message;\n};\n\nexport const useModal = () => {\n const { modal } = useApp();\n return modal;\n};\n\nexport { useApp };\n"],"names":["useToken","theme","useMessage","message","useApp","useModal","modal"],"mappings":";;;;AAKO,MAAMA,IAAWC,EAAM,UAKjBC,IAAa,MAAM;AAC9B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA;AACpB,SAAOD;AACT,GAEaE,IAAW,MAAM;AAC5B,QAAM,EAAE,OAAAC,EAAA,IAAUF,EAAA;AAClB,SAAOE;AACT;"}
@@ -11,7 +11,7 @@ import { clsx as c, cn as se } from "../utils/cn.js";
11
11
  import { WithRenderProp as ne } from "../utils/WithRenderProp.js";
12
12
  const be = ({
13
13
  children: u,
14
- resizable: h = !1,
14
+ resizable: a = !1,
15
15
  handles: o = { bottom: !0, right: !0, left: !0, top: !0 },
16
16
  absolutePositioning: E = !1,
17
17
  classNames: i,
@@ -87,7 +87,7 @@ const be = ({
87
87
  if (!e.current || !E) return;
88
88
  const { heightDiff: P } = t;
89
89
  e.current.style.top = `${parseInt(e.current.style.top || "0") - P}px`;
90
- }, Z = h ? [
90
+ }, Z = a ? [
91
91
  o.top && !r && /* @__PURE__ */ l(
92
92
  "div",
93
93
  {
@@ -210,27 +210,26 @@ const be = ({
210
210
  },
211
211
  "top-left-corner"
212
212
  )
213
- ] : [], a = u, m = {
214
- className: C(a, "className"),
215
- style: C(a, "style"),
216
- children: C(a, "children"),
217
- ref: a.ref
213
+ ] : [], h = u, m = {
214
+ className: C(h, "className"),
215
+ style: C(h, "style"),
216
+ children: C(h, "children")
218
217
  }, K = {
219
218
  className: se(
220
- h && s("resizable"),
219
+ a && s("resizable"),
221
220
  i?.root,
222
221
  m.className,
223
222
  D
224
223
  ),
225
224
  ref: oe(
226
- h ? X : void 0,
225
+ a ? X : void 0,
227
226
  U,
228
227
  // Always need this for dimension measurement
229
- a?.ref
228
+ h?.ref
230
229
  ),
231
230
  style: { ...m.style, ...S },
232
231
  ...v ? { "data-resizing": !0 } : {},
233
- ...h ? { "data-resizable": !0 } : {},
232
+ ...a ? { "data-resizable": !0 } : {},
234
233
  children: W ? [
235
234
  ...Array.isArray(m.children) ? m.children : [m.children],
236
235
  ...Z.filter(Boolean)
@@ -243,9 +242,9 @@ const be = ({
243
242
  const t = le(
244
243
  e,
245
244
  K,
246
- h ? Y : {}
245
+ a ? Y : {}
247
246
  );
248
- return W ? A.cloneElement(a, t) : /* @__PURE__ */ l("div", { ...t, children: u });
247
+ return W ? A.cloneElement(h, t) : /* @__PURE__ */ l("div", { ...t, children: u });
249
248
  },
250
249
  ...Q
251
250
  }
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/resizable/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useCallback, useEffect, useState, isValidElement } from \"react\";\nimport {\n useResizable,\n type MoveValues,\n ResizableProps as UseResizableProps,\n} from \"react-use-resizable\";\nimport mergeRefs from \"merge-refs\";\nimport {\n useCls,\n clsx,\n WithRenderProp,\n WithRenderPropProps,\n cn,\n getReactElementProp,\n} from \"../utils\";\nimport { mergeProps } from \"@base-ui-components/react\";\n\nimport \"./style.css\";\nimport { on } from \"node:stream\";\n\nexport interface ResizableProps\n extends Omit<WithRenderPropProps, keyof UseResizableProps>,\n UseResizableProps {\n /**\n * Single React element child that will be enhanced with resize handles\n */\n children: React.ReactNode;\n /**\n * Whether the component should be resizable\n * @default false\n */\n resizable?: boolean;\n /**\n * Configure which resize handles to show\n * @default { bottom: true, right: true, left: true, top: true }\n */\n handles?: {\n bottom?: boolean;\n right?: boolean;\n left?: boolean;\n top?: boolean;\n };\n /**\n * Whether to use absolute positioning for left handle resizing\n * Set to true when used in absolutely positioned containers like PopupPanel\n * @default false\n */\n absolutePositioning?: boolean;\n /**\n * Custom class names for different parts of the resizable component\n */\n classNames?: {\n root?: string;\n resizeHandle?: string;\n };\n /**\n * Key to reset dimensions to current element size\n * When this value changes, the component will recalculate its dimensions\n * Similar to React's key prop pattern for forcing component resets\n */\n resetKey?: React.Key;\n /**\n * Maximum width the component can be resized to\n */\n maxWidth?: number;\n /**\n * Maximum height the component can be resized to\n */\n maxHeight?: number;\n /**\n * Minimum width the component can be resized to\n */\n minWidth?: number;\n /**\n * Minimum height the component can be resized to\n */\n minHeight?: number;\n /**\n * Callback fired during resize operations\n */\n onResize?: (values: MoveValues) => void;\n /**\n * Whether to maintain aspect ratio during resize\n * @default false\n */\n maintainAspectRatio?: boolean;\n}\n\nexport const Resizable = ({\n children,\n resizable = false,\n handles = { bottom: true, right: true, left: true, top: true },\n absolutePositioning = false,\n classNames,\n className: containerClassName,\n style: containerStyle,\n resetKey,\n\n // Use Resizable Props\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd: onDragEndProp,\n onDragStart: onDragStartProp,\n disabled,\n maintainAspectRatio = false,\n interval,\n initialHeight: initialHeightProp,\n initialWidth: initialWidthProp,\n // other With Render Props\n ...rest\n}: ResizableProps) => {\n // Validate that children is a single React element\n // if (!isValidElement(children)) {\n // throw new Error(\n // \"Resizable component expects a single React element as children\"\n // );\n // }\n\n const cls = useCls();\n const [panelRef, setPanelRef] = useState<HTMLDivElement | null>(null);\n const [width, setWidth] = useState<number>();\n const [height, setHeight] = useState<number>();\n const [resizing, setResizing] = useState(false);\n\n const callbackRef = useCallback(\n (node: HTMLDivElement) => {\n setPanelRef(node);\n\n // Get initial dimensions only once when ref is set\n // For aspect ratio maintenance, we need initial dimensions immediately\n // Otherwise, preserve natural width/height behavior\n if (node && !width && !height) {\n const rect = node.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // Need dimensions for aspect ratio calculation\n setWidth(rect.width);\n setHeight(rect.height);\n }\n // For non-aspect-ratio cases, don't set dimensions to preserve natural behavior\n }\n }\n },\n [width, height, maintainAspectRatio],\n );\n\n // Reset dimensions when resetKey changes\n useEffect(() => {\n if (resetKey !== undefined && panelRef) {\n // Clear the hook's inline styles to reset to natural size\n panelRef.style.width = \"\";\n panelRef.style.height = \"\";\n\n // Force a reflow to get natural dimensions\n const rect = panelRef.getBoundingClientRect();\n\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // For aspect ratio maintenance, re-measure and set dimensions\n setWidth(rect.width);\n setHeight(rect.height);\n } else {\n // Reset state to allow natural dimensions again\n setWidth(undefined);\n setHeight(undefined);\n }\n\n // Don't apply any explicit dimensions - let them remain natural\n // panelRef.style.width = `${rect.width}px`;\n // panelRef.style.height = `${rect.height}px`;\n }\n }\n }, [resetKey, panelRef, maintainAspectRatio]);\n\n // Initialize useResizable with current dimensions (or undefined if not ready)\n // For aspect ratio maintenance, we need initial dimensions\n // Otherwise, preserve natural width/height behavior until user starts resizing\n const resizableHook = useResizable({\n initialWidth: maintainAspectRatio ? width : initialWidthProp,\n initialHeight: maintainAspectRatio ? height : initialHeightProp,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n disabled,\n maintainAspectRatio,\n interval,\n onDragStart: (values) => {\n setResizing(true);\n // Capture natural dimensions when user starts resizing\n if (panelRef) {\n const rect = panelRef.getBoundingClientRect();\n if (rect.width > 0 && !width) {\n setWidth(rect.width);\n }\n if (rect.height > 0 && !height) {\n setHeight(rect.height);\n }\n }\n if (onDragStartProp) onDragStartProp(values);\n },\n onDragEnd: (values) => {\n setResizing(false);\n if (onDragEndProp) onDragEndProp(values);\n },\n });\n\n const isChildrenValidElement = isValidElement(children);\n\n useEffect(() => {\n if (resizing) {\n document.body.style.userSelect = \"none\";\n } else {\n document.body.style.userSelect = \"\";\n }\n }, [resizing]);\n\n // Get resizable props - useResizable hook handles cases where dimensions aren't ready\n const { ref: rootRefProp, ...rootPropsWithoutRef } =\n resizableHook.getRootProps();\n const getHandleProps = resizableHook.getHandleProps;\n const rootRef = resizableHook.rootRef;\n\n // Handle reverse handle change for horizontal resizing (only for absolute positioning)\n const onReverseHandleChangeHorizontal = (\n parent: React.RefObject<HTMLDivElement>,\n values: MoveValues,\n ) => {\n if (!parent.current || !absolutePositioning) return;\n const { widthDiff } = values;\n parent.current.style.left = `${\n parseInt(parent.current.style.left || \"0\") - widthDiff\n }px`;\n };\n\n // Handle reverse handle change for vertical resizing (only for absolute positioning)\n const onReverseHandleChangeVertical = (\n parent: React.RefObject<HTMLDivElement>,\n values: MoveValues,\n ) => {\n if (!parent.current || !absolutePositioning) return;\n const { heightDiff } = values;\n parent.current.style.top = `${\n parseInt(parent.current.style.top || \"0\") - heightDiff\n }px`;\n };\n\n const resizeHandles = resizable\n ? [\n handles.top && !maintainAspectRatio && (\n <div\n key=\"top\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-center\"\n {...getHandleProps({\n reverse: true,\n lockHorizontal: true,\n onResize: (values) =>\n onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.bottom && !maintainAspectRatio && (\n <div\n key=\"bottom\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left\"\n {...getHandleProps({\n lockHorizontal: true,\n })}\n />\n ),\n handles.left && !maintainAspectRatio && (\n <div\n key=\"left\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left\"\n {...getHandleProps({\n reverse: true,\n lockVertical: true,\n onResize: (values) =>\n onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n handles.right && !maintainAspectRatio && (\n <div\n key=\"right\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right\"\n {...getHandleProps({\n lockVertical: true,\n })}\n />\n ),\n // For aspect ratio maintenance, add corner handles that can resize both dimensions\n handles.right && handles.bottom && (\n <div\n key=\"bottom-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-right-corner\"\n {...getHandleProps({\n // No locks - allow both horizontal and vertical resizing\n })}\n />\n ),\n maintainAspectRatio && handles.left && handles.bottom && (\n <div\n key=\"bottom-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) =>\n onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n maintainAspectRatio && handles.right && handles.top && (\n <div\n key=\"top-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) =>\n onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.left && handles.top && (\n <div\n key=\"top-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) => {\n onReverseHandleChangeHorizontal(rootRef, values);\n onReverseHandleChangeVertical(rootRef, values);\n },\n })}\n />\n ),\n ]\n : [];\n\n const childElement = children as React.ReactElement & {\n ref?: React.Ref<HTMLDivElement>;\n };\n\n const childElementProps = {\n className: getReactElementProp<string>(childElement, \"className\"),\n style: getReactElementProp<React.CSSProperties>(childElement, \"style\"),\n children: getReactElementProp<React.ReactNode>(childElement, \"children\"),\n ref: childElement.ref,\n };\n\n const childProps = {\n className: cn(\n resizable && cls(\"resizable\"),\n classNames?.root,\n childElementProps.className,\n containerClassName,\n ),\n ref: mergeRefs(\n resizable ? rootRefProp : undefined,\n callbackRef, // Always need this for dimension measurement\n childElement?.ref,\n ),\n style: { ...childElementProps.style, ...containerStyle },\n ...(resizing ? { \"data-resizing\": true } : {}),\n ...(resizable ? { \"data-resizable\": true } : {}),\n children: isChildrenValidElement\n ? [\n ...(Array.isArray(childElementProps.children)\n ? childElementProps.children\n : [childElementProps.children]),\n ...resizeHandles.filter(Boolean),\n ]\n : children,\n };\n\n return (\n <WithRenderProp\n render={(props) => {\n // Merge the props from WithRenderProp with our childProps\n const mergedProps = mergeProps(\n props,\n childProps,\n resizable ? rootPropsWithoutRef : {},\n );\n if (isChildrenValidElement) {\n return React.cloneElement(childElement, mergedProps);\n } else {\n return <div {...mergedProps}>{children}</div>;\n }\n }}\n {...rest}\n />\n );\n};\n"],"names":["Resizable","children","resizable","handles","absolutePositioning","classNames","containerClassName","containerStyle","resetKey","maxHeight","maxWidth","minHeight","minWidth","lockHorizontal","lockVertical","onResize","onDragEndProp","onDragStartProp","disabled","maintainAspectRatio","interval","initialHeightProp","initialWidthProp","rest","cls","useCls","panelRef","setPanelRef","useState","width","setWidth","height","setHeight","resizing","setResizing","callbackRef","useCallback","node","rect","useEffect","resizableHook","useResizable","values","isChildrenValidElement","isValidElement","rootRefProp","rootPropsWithoutRef","getHandleProps","rootRef","onReverseHandleChangeHorizontal","parent","widthDiff","onReverseHandleChangeVertical","heightDiff","resizeHandles","jsx","clsx","childElement","childElementProps","getReactElementProp","childProps","cn","mergeRefs","WithRenderProp","props","mergedProps","mergeProps","React"],"mappings":";;;;;;;;;;;AAyFO,MAAMA,KAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,EAAE,QAAQ,IAAM,OAAO,IAAM,MAAM,IAAM,KAAK,GAAA;AAAA,EACxD,qBAAAC,IAAsB;AAAA,EACtB,YAAAC;AAAA,EACA,WAAWC;AAAA,EACX,OAAOC;AAAA,EACP,UAAAC;AAAA;AAAA,EAGA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAWC;AAAA,EACX,aAAaC;AAAA,EACb,UAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,UAAAC;AAAA,EACA,eAAeC;AAAA,EACf,cAAcC;AAAA;AAAA,EAEd,GAAGC;AACL,MAAsB;AAQpB,QAAMC,IAAMC,GAAA,GACN,CAACC,GAAUC,CAAW,IAAIC,EAAgC,IAAI,GAC9D,CAACC,GAAOC,CAAQ,IAAIF,EAAA,GACpB,CAACG,GAAQC,CAAS,IAAIJ,EAAA,GACtB,CAACK,GAAUC,CAAW,IAAIN,EAAS,EAAK,GAExCO,IAAcC;AAAA,IAClB,CAACC,MAAyB;AAMxB,UALAV,EAAYU,CAAI,GAKZA,KAAQ,CAACR,KAAS,CAACE,GAAQ;AAC7B,cAAMO,IAAOD,EA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ACAsB,GAAc;AAAA,IAAA;AAAA,IAEhB,OAAO,EAAE,GAAGC,EAAkB,OAAO,GAAGnD,EAAA;AAAA,IACxC,GAAI0B,IAAW,EAAE,iBAAiB,GAAA,IAAS,CAAA;AAAA,IAC3C,GAAI/B,IAAY,EAAE,kBAAkB,GAAA,IAAS,CAAA;AAAA,IAC7C,UAAUyC,IACN;AAAA,MACE,GAAI,MAAM,QAAQe,EAAkB,QAAQ,IACxCA,EAAkB,WAClB,CAACA,EAAkB,QAAQ;AAAA,MAC/B,GAAGJ,EAAc,OAAO,OAAO;AAAA,IAAA,IAEjCrD;AAAA,EAAA;AAGN,SACE,gBAAAsD;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,QAAQ,CAACC,MAAU;AAEjB,cAAMC,IAAcC;AAAA,UAClBF;AAAA,UACAJ;AAAA,UACA1D,IAAY4C,IAAsB,CAAA;AAAA,QAAC;AAErC,eAAIH,IACKwB,EAAM,aAAaV,GAAcQ,CAAW,IAE5C,gBAAAV,EAAC,OAAA,EAAK,GAAGU,GAAc,UAAAhE,EAAA,CAAS;AAAA,MAE3C;AAAA,MACC,GAAGsB;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/resizable/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useCallback, useEffect, useState, isValidElement } from \"react\";\nimport {\n useResizable,\n type MoveValues,\n ResizableProps as UseResizableProps,\n} from \"react-use-resizable\";\nimport mergeRefs from \"merge-refs\";\nimport {\n useCls,\n clsx,\n WithRenderProp,\n WithRenderPropProps,\n cn,\n getReactElementProp,\n} from \"../utils\";\nimport { mergeProps } from \"@base-ui-components/react\";\n\nimport \"./style.css\";\nimport { on } from \"node:stream\";\n\nexport interface ResizableProps\n extends Omit<WithRenderPropProps, keyof UseResizableProps>,\n UseResizableProps {\n /**\n * Single React element child that will be enhanced with resize handles\n */\n children: React.ReactNode;\n /**\n * Whether the component should be resizable\n * @default false\n */\n resizable?: boolean;\n /**\n * Configure which resize handles to show\n * @default { bottom: true, right: true, left: true, top: true }\n */\n handles?: {\n bottom?: boolean;\n right?: boolean;\n left?: boolean;\n top?: boolean;\n };\n /**\n * Whether to use absolute positioning for left handle resizing\n * Set to true when used in absolutely positioned containers like PopupPanel\n * @default false\n */\n absolutePositioning?: boolean;\n /**\n * Custom class names for different parts of the resizable component\n */\n classNames?: {\n root?: string;\n resizeHandle?: string;\n };\n /**\n * Key to reset dimensions to current element size\n * When this value changes, the component will recalculate its dimensions\n * Similar to React's key prop pattern for forcing component resets\n */\n resetKey?: React.Key;\n /**\n * Maximum width the component can be resized to\n */\n maxWidth?: number;\n /**\n * Maximum height the component can be resized to\n */\n maxHeight?: number;\n /**\n * Minimum width the component can be resized to\n */\n minWidth?: number;\n /**\n * Minimum height the component can be resized to\n */\n minHeight?: number;\n /**\n * Callback fired during resize operations\n */\n onResize?: (values: MoveValues) => void;\n /**\n * Whether to maintain aspect ratio during resize\n * @default false\n */\n maintainAspectRatio?: boolean;\n}\n\nexport const Resizable = ({\n children,\n resizable = false,\n handles = { bottom: true, right: true, left: true, top: true },\n absolutePositioning = false,\n classNames,\n className: containerClassName,\n style: containerStyle,\n resetKey,\n\n // Use Resizable Props\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd: onDragEndProp,\n onDragStart: onDragStartProp,\n disabled,\n maintainAspectRatio = false,\n interval,\n initialHeight: initialHeightProp,\n initialWidth: initialWidthProp,\n // other With Render Props\n ...rest\n}: ResizableProps) => {\n // Validate that children is a single React element\n // if (!isValidElement(children)) {\n // throw new Error(\n // \"Resizable component expects a single React element as children\"\n // );\n // }\n\n const cls = useCls();\n const [panelRef, setPanelRef] = useState<HTMLDivElement | null>(null);\n const [width, setWidth] = useState<number>();\n const [height, setHeight] = useState<number>();\n const [resizing, setResizing] = useState(false);\n\n const callbackRef = useCallback(\n (node: HTMLDivElement) => {\n setPanelRef(node);\n\n // Get initial dimensions only once when ref is set\n // For aspect ratio maintenance, we need initial dimensions immediately\n // Otherwise, preserve natural width/height behavior\n if (node && !width && !height) {\n const rect = node.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // Need dimensions for aspect ratio calculation\n setWidth(rect.width);\n setHeight(rect.height);\n }\n // For non-aspect-ratio cases, don't set dimensions to preserve natural behavior\n }\n }\n },\n [width, height, maintainAspectRatio],\n );\n\n // Reset dimensions when resetKey changes\n useEffect(() => {\n if (resetKey !== undefined && panelRef) {\n // Clear the hook's inline styles to reset to natural size\n panelRef.style.width = \"\";\n panelRef.style.height = \"\";\n\n // Force a reflow to get natural dimensions\n const rect = panelRef.getBoundingClientRect();\n\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // For aspect ratio maintenance, re-measure and set dimensions\n setWidth(rect.width);\n setHeight(rect.height);\n } else {\n // Reset state to allow natural dimensions again\n setWidth(undefined);\n setHeight(undefined);\n }\n\n // Don't apply any explicit dimensions - let them remain natural\n // panelRef.style.width = `${rect.width}px`;\n // panelRef.style.height = `${rect.height}px`;\n }\n }\n }, [resetKey, panelRef, maintainAspectRatio]);\n\n // Initialize useResizable with current dimensions (or undefined if not ready)\n // For aspect ratio maintenance, we need initial dimensions\n // Otherwise, preserve natural width/height behavior until user starts resizing\n const resizableHook = useResizable({\n initialWidth: maintainAspectRatio ? width : initialWidthProp,\n initialHeight: maintainAspectRatio ? height : initialHeightProp,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n disabled,\n maintainAspectRatio,\n interval,\n onDragStart: (values) => {\n setResizing(true);\n // Capture natural dimensions when user starts resizing\n if (panelRef) {\n const rect = panelRef.getBoundingClientRect();\n if (rect.width > 0 && !width) {\n setWidth(rect.width);\n }\n if (rect.height > 0 && !height) {\n setHeight(rect.height);\n }\n }\n if (onDragStartProp) onDragStartProp(values);\n },\n onDragEnd: (values) => {\n setResizing(false);\n if (onDragEndProp) onDragEndProp(values);\n },\n });\n\n const isChildrenValidElement = isValidElement(children);\n\n useEffect(() => {\n if (resizing) {\n document.body.style.userSelect = \"none\";\n } else {\n document.body.style.userSelect = \"\";\n }\n }, [resizing]);\n\n // Get resizable props - useResizable hook handles cases where dimensions aren't ready\n const { ref: rootRefProp, ...rootPropsWithoutRef } =\n resizableHook.getRootProps();\n const getHandleProps = resizableHook.getHandleProps;\n const rootRef = resizableHook.rootRef;\n\n // Handle reverse handle change for horizontal resizing (only for absolute positioning)\n const onReverseHandleChangeHorizontal = (\n parent: React.RefObject<HTMLDivElement>,\n values: MoveValues,\n ) => {\n if (!parent.current || !absolutePositioning) return;\n const { widthDiff } = values;\n parent.current.style.left = `${\n parseInt(parent.current.style.left || \"0\") - widthDiff\n }px`;\n };\n\n // Handle reverse handle change for vertical resizing (only for absolute positioning)\n const onReverseHandleChangeVertical = (\n parent: React.RefObject<HTMLDivElement>,\n values: MoveValues,\n ) => {\n if (!parent.current || !absolutePositioning) return;\n const { heightDiff } = values;\n parent.current.style.top = `${\n parseInt(parent.current.style.top || \"0\") - heightDiff\n }px`;\n };\n\n const resizeHandles = resizable\n ? [\n handles.top && !maintainAspectRatio && (\n <div\n key=\"top\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-center\"\n {...getHandleProps({\n reverse: true,\n lockHorizontal: true,\n onResize: (values) =>\n onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.bottom && !maintainAspectRatio && (\n <div\n key=\"bottom\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left\"\n {...getHandleProps({\n lockHorizontal: true,\n })}\n />\n ),\n handles.left && !maintainAspectRatio && (\n <div\n key=\"left\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left\"\n {...getHandleProps({\n reverse: true,\n lockVertical: true,\n onResize: (values) =>\n onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n handles.right && !maintainAspectRatio && (\n <div\n key=\"right\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right\"\n {...getHandleProps({\n lockVertical: true,\n })}\n />\n ),\n // For aspect ratio maintenance, add corner handles that can resize both dimensions\n handles.right && handles.bottom && (\n <div\n key=\"bottom-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-right-corner\"\n {...getHandleProps({\n // No locks - allow both horizontal and vertical resizing\n })}\n />\n ),\n maintainAspectRatio && handles.left && handles.bottom && (\n <div\n key=\"bottom-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) =>\n onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n maintainAspectRatio && handles.right && handles.top && (\n <div\n key=\"top-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) =>\n onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.left && handles.top && (\n <div\n key=\"top-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left-corner\"\n {...getHandleProps({\n reverse: true,\n onResize: (values) => {\n onReverseHandleChangeHorizontal(rootRef, values);\n onReverseHandleChangeVertical(rootRef, values);\n },\n })}\n />\n ),\n ]\n : [];\n\n const childElement = children as React.ReactElement & {\n ref?: React.Ref<HTMLDivElement>;\n };\n\n const childElementProps = {\n className: getReactElementProp<string>(childElement, \"className\"),\n style: getReactElementProp<React.CSSProperties>(childElement, \"style\"),\n children: getReactElementProp<React.ReactNode>(childElement, \"children\"),\n ref: childElement.ref,\n };\n\n const childProps = {\n className: cn(\n resizable && cls(\"resizable\"),\n classNames?.root,\n childElementProps.className,\n containerClassName,\n ),\n ref: mergeRefs(\n resizable ? rootRefProp : undefined,\n callbackRef, // Always need this for dimension measurement\n childElement?.ref,\n ),\n style: { ...childElementProps.style, ...containerStyle },\n ...(resizing ? { \"data-resizing\": true } : {}),\n ...(resizable ? { \"data-resizable\": true } : {}),\n children: isChildrenValidElement\n ? [\n ...(Array.isArray(childElementProps.children)\n ? childElementProps.children\n : [childElementProps.children]),\n ...resizeHandles.filter(Boolean),\n ]\n : children,\n };\n\n return (\n <WithRenderProp\n render={(props) => {\n // Merge the props from WithRenderProp with our childProps\n const mergedProps = mergeProps(\n props,\n childProps,\n resizable ? rootPropsWithoutRef : {},\n );\n if (isChildrenValidElement) {\n return React.cloneElement(childElement, mergedProps);\n } else {\n return <div {...mergedProps}>{children}</div>;\n }\n }}\n {...rest}\n />\n );\n};\n"],"names":["Resizable","children","resizable","handles","absolutePositioning","classNames","containerClassName","containerStyle","resetKey","maxHeight","maxWidth","minHeight","minWidth","lockHorizontal","lockVertical","onResize","onDragEndProp","onDragStartProp","disabled","maintainAspectRatio","interval","initialHeightProp","initialWidthProp","rest","cls","useCls","panelRef","setPanelRef","useState","width","setWidth","height","setHeight","resizing","setResizing","callbackRef","useCallback","node","rect","useEffect","resizableHook","useResizable","values","isChildrenValidElement","isValidElement","rootRefProp","rootPropsWithoutRef","getHandleProps","rootRef","onReverseHandleChangeHorizontal","parent","widthDiff","onReverseHandleChangeVertical","heightDiff","resizeHandles","jsx","clsx","childElement","childElementProps","getReactElementProp","childProps","cn","mergeRefs","WithRenderProp","props","mergedProps","mergeProps","React"],"mappings":";;;;;;;;;;;AAyFO,MAAMA,KAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,EAAE,QAAQ,IAAM,OAAO,IAAM,MAAM,IAAM,KAAK,GAAA;AAAA,EACxD,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