@lax-wp/design-system 0.3.78 → 0.3.80
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/banner/Banner.d.ts +11 -15
- package/dist/components/data-display/label-value/LabelValue.d.ts +11 -6
- package/dist/components/icons/ArchivedIcon.d.ts +7 -0
- package/dist/components/icons/CheckCircle.d.ts +7 -0
- package/dist/components/icons/InfoAlert.d.ts +7 -0
- package/dist/components/icons/InfoCircleIcon.d.ts +7 -0
- 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 +10 -0
- package/dist/index.es.js +22258 -17785
- package/dist/index.umd.js +152 -104
- package/package.json +2 -1
|
@@ -1,31 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* Available banner status options
|
|
3
4
|
*/
|
|
4
|
-
export type BannerStatus = "success" | "error" | "warning" | "info" | "archived" | "canceled" | "queued" | "paused" | "awaiting_action" | "skipped" | "pending";
|
|
5
|
+
export type BannerStatus = "success" | "error" | "warning" | "info" | "infoGrey" | "archived" | "canceled" | "queued" | "paused" | "awaiting_action" | "skipped" | "pending";
|
|
5
6
|
/**
|
|
6
7
|
* Props for the Banner component
|
|
7
8
|
*/
|
|
8
9
|
export interface BannerProps {
|
|
9
|
-
/** The banner status/color variant */
|
|
10
|
-
status: BannerStatus;
|
|
11
10
|
/** The main content to display */
|
|
12
11
|
children: React.ReactNode;
|
|
12
|
+
/** The banner status/color variant */
|
|
13
|
+
status: BannerStatus;
|
|
13
14
|
/** Additional content to display on the right side */
|
|
14
15
|
additionalChildren?: React.ReactNode;
|
|
15
|
-
/** Component to render when expanded (for error status) */
|
|
16
|
+
/** Component to render when expanded (for error status). Receives executionId as prop. */
|
|
16
17
|
ExpandedComponent?: React.ComponentType<{
|
|
17
|
-
|
|
18
|
+
executionId?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
18
20
|
}>;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/** Custom icon to override default status icon */
|
|
22
|
-
icon?: React.ReactNode;
|
|
21
|
+
/** Execution ID to pass to the ExpandedComponent */
|
|
22
|
+
executionId?: string;
|
|
23
23
|
/** Additional CSS classes for the wrapper */
|
|
24
24
|
className?: string;
|
|
25
|
-
/** Callback when banner is clicked (if expandable) */
|
|
26
|
-
onClick?: () => void;
|
|
27
|
-
/** Custom aria-label for accessibility */
|
|
28
|
-
"aria-label"?: string;
|
|
29
25
|
}
|
|
30
26
|
/**
|
|
31
27
|
* Banner component displays important information with status-based styling
|
|
@@ -33,9 +29,9 @@ export interface BannerProps {
|
|
|
33
29
|
* @example
|
|
34
30
|
* ```tsx
|
|
35
31
|
* <Banner status="success">Operation completed successfully</Banner>
|
|
36
|
-
* <Banner status="error"
|
|
32
|
+
* <Banner status="error" ExpandedComponent={FlowErrorBanner} executionId="123">
|
|
37
33
|
* Error occurred
|
|
38
34
|
* </Banner>
|
|
39
35
|
* ```
|
|
40
36
|
*/
|
|
41
|
-
export declare const Banner:
|
|
37
|
+
export declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -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
|
@@ -93,8 +93,16 @@ export { LaxIcon } from "./components/icons/LaxIcon";
|
|
|
93
93
|
export { ComingSoonIcon } from "./components/icons/ComingSoonIcon";
|
|
94
94
|
export { CheckSmallIcon } from "./components/icons/CheckSmallIcon";
|
|
95
95
|
export { EditIcon } from "./components/icons/EditIcon";
|
|
96
|
+
export { CheckCircle } from "./components/icons/CheckCircle";
|
|
97
|
+
export { InfoAlert } from "./components/icons/InfoAlert";
|
|
98
|
+
export { ArchivedIcon } from "./components/icons/ArchivedIcon";
|
|
99
|
+
export { InfoCircleIcon } from "./components/icons/InfoCircleIcon";
|
|
96
100
|
export type { IconProps } from "./components/icons/LaxIcon";
|
|
97
101
|
export type { EditIconProps } from "./components/icons/EditIcon";
|
|
102
|
+
export type { CheckCircleProps } from "./components/icons/CheckCircle";
|
|
103
|
+
export type { InfoAlertProps } from "./components/icons/InfoAlert";
|
|
104
|
+
export type { ArchivedIconProps } from "./components/icons/ArchivedIcon";
|
|
105
|
+
export type { InfoCircleIconProps } from "./components/icons/InfoCircleIcon";
|
|
98
106
|
export { AccessDeniedModal } from "./components/data-display/access-denied-modal/AccessDeniedModal";
|
|
99
107
|
export type { AccessDeniedModalProps } from "./components/data-display/access-denied-modal/AccessDeniedModal";
|
|
100
108
|
export { InProgress } from "./components/data-display/in-progress/InProgress";
|
|
@@ -124,6 +132,8 @@ export type { UseOutsideClickProps } from "./hooks/useOutsideClick";
|
|
|
124
132
|
export { useModalContainer } from "./hooks/useModalContainer";
|
|
125
133
|
export type { UseModalContainerOptions } from "./hooks/useModalContainer";
|
|
126
134
|
export { useScrollToTop } from "./hooks/useScrollToTop";
|
|
135
|
+
export { useEventListener } from "./hooks/useEventListener";
|
|
136
|
+
export { useIsomorphicLayoutEffect } from "./hooks/useIsomorphicLayoutEffect";
|
|
127
137
|
export { PageContainer, HelmetTitle, Helmet, ComponentLoader, LogoLoader, CustomScrollbar } from "./components/layout";
|
|
128
138
|
export type { PageContainerProps, HelmetTitleProps, HelmetProps, ComponentLoaderProps, LogoLoaderProps, CustomScrollbarProps, CustomScrollbarHandle } from "./components/layout";
|
|
129
139
|
export { BreadCrumb, BreadCrumbItem } from "./components/navigation/breadcrumbs";
|