ehscan-react-components 0.1.13 → 0.1.14

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.
@@ -1 +1,2 @@
1
1
  export { Button } from './Button';
2
+ export { Window } from './Window';
@@ -2,3 +2,4 @@
2
2
  // return <Button />
3
3
  // }
4
4
  export { Button } from './Button';
5
+ export { Window } from './Window';
package/dist/Window.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export interface WindowProps {
2
+ export interface Props {
3
3
  trackMove?: (args?: any) => void;
4
4
  open: boolean;
5
5
  initialPosition?: {
@@ -13,4 +13,4 @@ export interface WindowProps {
13
13
  footer?: React.ReactNode;
14
14
  onClose?: () => void;
15
15
  }
16
- export default function Window({ trackMove, open, initialPosition, initialWidth, initialBodyPadding, header, body, footer, onClose, }: WindowProps): import("react/jsx-runtime").JSX.Element | null;
16
+ export declare const Window: React.FC<Props>;
package/dist/Window.js CHANGED
@@ -82,7 +82,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
82
82
  // }
83
83
  import { useRef, useEffect, useState } from "react";
84
84
  import { useDraggable } from "./tools/useDraggable"; // adjust path as needed
85
- export default function Window({ trackMove, open, initialPosition = { x: 600, y: 100 }, initialWidth = 400, initialBodyPadding = 20, header, body, footer, onClose, }) {
85
+ export const Window = ({ trackMove, open, initialPosition = { x: 600, y: 100 }, initialWidth = 400, initialBodyPadding = 20, header, body, footer, onClose, }) => {
86
86
  const targetRef = useRef(null);
87
87
  const headerRef = useRef(null);
88
88
  const resizeHandleRef = useRef(null);
@@ -113,4 +113,4 @@ export default function Window({ trackMove, open, initialPosition = { x: 600, y:
113
113
  if (!open)
114
114
  return null;
115
115
  return (_jsxs("div", { ref: targetRef, className: `ext-window${fadeIn ? ' fadein' : ''}`, style: { left: `${initialPosition.x}px`, top: `${initialPosition.y}px`, minWidth: `${windowWidth}px` }, children: [_jsx("div", { ref: headerRef, className: "ext-window-header", children: header !== null && header !== void 0 ? header : (_jsxs(_Fragment, { children: [_jsx("div", { className: "ext-window-drag-handle", children: "||" }), _jsx("div", { className: "ext-window-header-title", children: "Header" }), _jsx("div", { onClick: onClose, children: "close" })] })) }), _jsx("div", { ref: bodyRef, className: "ext-window-body _ewb", style: { padding: `${bodyPadding}px` }, children: body !== null && body !== void 0 ? body : _jsx(_Fragment, { children: "Body" }) }), footer && (_jsx("div", { ref: footerRef, className: "ext-window-footer", children: footer })), _jsx("div", { className: "resize-handle", ref: resizeHandleRef })] }));
116
- }
116
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-components",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",