lkd-web-kit 0.5.3 → 0.5.4

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.
@@ -7,7 +7,7 @@ const jsxRuntime = require('react/jsx-runtime');
7
7
  const React = require('react');
8
8
 
9
9
  const withModalManager = (WrappedComponent) => {
10
- const Component = ({ removeModal, ...props }) => {
10
+ const Wrapper = ({ removeModal, ...props }) => {
11
11
  const [isOpen, setIsOpen] = React.useState(false);
12
12
  const onClose = () => {
13
13
  setIsOpen(false);
@@ -30,8 +30,8 @@ const withModalManager = (WrappedComponent) => {
30
30
  }
31
31
  );
32
32
  };
33
- Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;
34
- return Component;
33
+ Wrapper.displayName = `WithModalManager(${WrappedComponent.displayName})`;
34
+ return Wrapper;
35
35
  };
36
36
 
37
37
  exports.withModalManager = withModalManager;
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { useState, useEffect } from 'react';
4
4
 
5
5
  const withModalManager = (WrappedComponent) => {
6
- const Component = ({ removeModal, ...props }) => {
6
+ const Wrapper = ({ removeModal, ...props }) => {
7
7
  const [isOpen, setIsOpen] = useState(false);
8
8
  const onClose = () => {
9
9
  setIsOpen(false);
@@ -26,8 +26,8 @@ const withModalManager = (WrappedComponent) => {
26
26
  }
27
27
  );
28
28
  };
29
- Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;
30
- return Component;
29
+ Wrapper.displayName = `WithModalManager(${WrappedComponent.displayName})`;
30
+ return Wrapper;
31
31
  };
32
32
 
33
33
  export { withModalManager };
package/dist/index.d.ts CHANGED
@@ -339,10 +339,15 @@ export declare interface LayoutProps {
339
339
  params: Promise<PageParams>;
340
340
  }
341
341
 
342
- export declare type ModalManagerWrappedComponentProps<T extends object> = T & {
342
+ export declare type ModalManagerWrappedComponentProps<T extends object = object> = T & {
343
343
  modalProps: ModalProps;
344
344
  };
345
345
 
346
+ export declare type ModalManagerWrapperProps<T extends object = object> = T & {
347
+ modalProps: ModalProps;
348
+ removeModal: () => void;
349
+ };
350
+
346
351
  export declare const MyDateInput: (props: MyDateInputProps) => JSX.Element;
347
352
 
348
353
  export declare interface MyDateInputProps extends DateInputProps {
@@ -571,13 +576,7 @@ export declare interface WithControllerProps {
571
576
  disabled?: boolean;
572
577
  }
573
578
 
574
- export declare const withModalManager: <CustomProps extends object>(WrappedComponent: React.ComponentType<ModalManagerWrappedComponentProps<CustomProps>>) => FC<CustomProps & {
575
- modalProps: ModalProps;
576
- } & WithModalManagerProps>;
577
-
578
- declare interface WithModalManagerProps {
579
- removeModal: () => void;
580
- }
579
+ export declare const withModalManager: <CustomProps extends object>(WrappedComponent: React.ComponentType<ModalManagerWrappedComponentProps<CustomProps>>) => FC<ModalManagerWrapperProps<CustomProps>>;
581
580
 
582
581
  export declare const zodValidator: (schema: ZodType) => (values: any) => string | undefined;
583
582
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",