@lax-wp/design-system 0.3.78 → 0.3.79
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/components/data-display/label-value/LabelValue.d.ts +11 -6
- package/dist/components/layout/CustomScrollbar.d.ts +8 -14
- package/dist/hooks/useEventListener.d.ts +4 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +17852 -16312
- package/dist/index.umd.js +93 -99
- package/package.json +2 -1
|
@@ -42,9 +42,10 @@ export interface MasterDataModalProps {
|
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Risk details card component props
|
|
45
|
+
* Using generic to allow custom risk detail types from consumers
|
|
45
46
|
*/
|
|
46
|
-
export interface RiskDetailsCardProps {
|
|
47
|
-
riskDetails:
|
|
47
|
+
export interface RiskDetailsCardProps<TRisk = any> {
|
|
48
|
+
riskDetails: TRisk;
|
|
48
49
|
maxWidth?: string;
|
|
49
50
|
showAllRisksSuggestions?: boolean;
|
|
50
51
|
}
|
|
@@ -88,6 +89,10 @@ export interface LabelValueProps {
|
|
|
88
89
|
originalValue?: boolean;
|
|
89
90
|
/** Whether to show diff between old and new values */
|
|
90
91
|
showDiff?: boolean;
|
|
92
|
+
/** Whether this is a live field (shows bolt icon) */
|
|
93
|
+
isLiveField?: boolean;
|
|
94
|
+
/** Delta change value for currency fields */
|
|
95
|
+
deltaChange?: number;
|
|
91
96
|
/** Theme mode */
|
|
92
97
|
theme?: ThemeMode;
|
|
93
98
|
/** Upload handler function */
|
|
@@ -96,12 +101,12 @@ export interface LabelValueProps {
|
|
|
96
101
|
acceptsUpload?: boolean;
|
|
97
102
|
/** Master data modal component */
|
|
98
103
|
MasterDataModal?: React.ComponentType<MasterDataModalProps>;
|
|
99
|
-
/** Risk analysis data */
|
|
100
|
-
riskDetails?: RiskDetails;
|
|
104
|
+
/** Risk analysis data - accepts any risk object extending RiskDetails */
|
|
105
|
+
riskDetails?: RiskDetails | any;
|
|
101
106
|
/** Whether risk analysis is open */
|
|
102
107
|
isRiskAnalysisOpen?: boolean;
|
|
103
|
-
/** Custom risk details card component */
|
|
104
|
-
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps
|
|
108
|
+
/** Custom risk details card component - accepts components with custom risk types */
|
|
109
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;
|
|
105
110
|
/** Custom aria-label for accessibility */
|
|
106
111
|
'aria-label'?: string;
|
|
107
112
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Scrollbars } from 'react-custom-scrollbars-2';
|
|
3
|
+
import type { ScrollbarProps } from 'react-custom-scrollbars-2';
|
|
2
4
|
/**
|
|
3
5
|
* Custom scrollbar handle for external control
|
|
4
6
|
*/
|
|
5
7
|
export interface CustomScrollbarHandle {
|
|
8
|
+
/** Get the Scrollbars instance */
|
|
9
|
+
getInstance?: Scrollbars | null;
|
|
6
10
|
/** Scroll to the top of the container */
|
|
7
|
-
scrollToTop
|
|
11
|
+
scrollToTop?: () => void;
|
|
8
12
|
/** Scroll to the right of the container */
|
|
9
|
-
scrollToRight
|
|
10
|
-
/** Get the container element */
|
|
11
|
-
getContainer: () => HTMLDivElement | null;
|
|
13
|
+
scrollToRight?: () => void;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Props for the CustomScrollbar component
|
|
@@ -22,14 +24,6 @@ export interface CustomScrollbarProps {
|
|
|
22
24
|
renderViewClassName?: string;
|
|
23
25
|
/** Whether to use full height */
|
|
24
26
|
fullHeight?: boolean;
|
|
25
|
-
/** Additional CSS classes for the wrapper */
|
|
26
|
-
className?: string;
|
|
27
|
-
/** Custom height for the scrollbar container */
|
|
28
|
-
height?: string | number;
|
|
29
|
-
/** Whether to enable auto-hide for scrollbars */
|
|
30
|
-
autoHide?: boolean;
|
|
31
|
-
/** Custom inline styles */
|
|
32
|
-
style?: React.CSSProperties;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* CustomScrollbar component provides a styled scrollable container
|
|
@@ -49,4 +43,4 @@ export interface CustomScrollbarProps {
|
|
|
49
43
|
* // scrollRef.current?.scrollToTop();
|
|
50
44
|
* ```
|
|
51
45
|
*/
|
|
52
|
-
export declare const CustomScrollbar: React.MemoExoticComponent<React.ForwardRefExoticComponent<CustomScrollbarProps & React.RefAttributes<CustomScrollbarHandle>>>;
|
|
46
|
+
export declare const CustomScrollbar: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<CustomScrollbarProps & ScrollbarProps, "ref"> & React.RefAttributes<CustomScrollbarHandle>>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export declare function useEventListener<K extends keyof WindowEventMap>(eventName: K | null, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
|
|
3
|
+
export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K | null, handler: (event: HTMLElementEventMap[K]) => void, element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
|
|
4
|
+
export declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K | null, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ export type { UseOutsideClickProps } from "./hooks/useOutsideClick";
|
|
|
124
124
|
export { useModalContainer } from "./hooks/useModalContainer";
|
|
125
125
|
export type { UseModalContainerOptions } from "./hooks/useModalContainer";
|
|
126
126
|
export { useScrollToTop } from "./hooks/useScrollToTop";
|
|
127
|
+
export { useEventListener } from "./hooks/useEventListener";
|
|
128
|
+
export { useIsomorphicLayoutEffect } from "./hooks/useIsomorphicLayoutEffect";
|
|
127
129
|
export { PageContainer, HelmetTitle, Helmet, ComponentLoader, LogoLoader, CustomScrollbar } from "./components/layout";
|
|
128
130
|
export type { PageContainerProps, HelmetTitleProps, HelmetProps, ComponentLoaderProps, LogoLoaderProps, CustomScrollbarProps, CustomScrollbarHandle } from "./components/layout";
|
|
129
131
|
export { BreadCrumb, BreadCrumbItem } from "./components/navigation/breadcrumbs";
|