@lax-wp/design-system 0.3.21 → 0.3.22
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/card/Card.d.ts +31 -0
- package/dist/components/forms/icon-picker/IconPicker.d.ts +20 -0
- package/dist/components/layout/HelmetTitle.d.ts +23 -0
- package/dist/components/layout/PageContainer.d.ts +51 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/constants/layout.d.ts +15 -0
- package/dist/hooks/useScrollToTop.d.ts +5 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +26922 -45049
- package/dist/index.umd.js +41 -360
- package/dist/lib/utils.d.ts +2 -0
- package/dist/types/icon-picker.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/countryFlags.d.ts +5 -0
- package/package.json +5 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type FC, type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Card component
|
|
4
|
+
*/
|
|
5
|
+
export interface CardProps {
|
|
6
|
+
/** Content to render inside the card */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Additional CSS classes to apply */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Title to display in document head (via HelmetTitle) */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Inline styles to apply */
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
/** HTML id attribute */
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Card component for displaying content in a styled container
|
|
19
|
+
*
|
|
20
|
+
* This component provides a consistent card layout with shadow, rounded corners,
|
|
21
|
+
* and proper dark mode support. It can optionally set the document title using
|
|
22
|
+
* the HelmetTitle component.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Card title="My Card">
|
|
27
|
+
* <div>Card content</div>
|
|
28
|
+
* </Card>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const Card: FC<CardProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SvgIconOwnProps } from '@mui/material';
|
|
3
|
+
export interface IconPickerContentProps {
|
|
4
|
+
selectedIcon: string | null;
|
|
5
|
+
onChange: (iconName: string | null) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
allowClear?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
}
|
|
12
|
+
interface IconRendererProps {
|
|
13
|
+
iconName: string;
|
|
14
|
+
sx?: SvgIconOwnProps['sx'];
|
|
15
|
+
className?: string;
|
|
16
|
+
isHovering?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const IconRenderer: ({ iconName, sx, className, isHovering }: IconRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const IconPicker: React.LazyExoticComponent<(props: IconPickerContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the HelmetTitle component
|
|
4
|
+
*/
|
|
5
|
+
export interface HelmetTitleProps {
|
|
6
|
+
/** The title to display (will be used by parent app's Helmet integration) */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Additional children to render */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* HelmetTitle component for managing document title
|
|
13
|
+
*
|
|
14
|
+
* Note: This is a simple wrapper component. The parent application should
|
|
15
|
+
* integrate this with react-helmet-async or similar library for actual
|
|
16
|
+
* document title management.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <HelmetTitle title="Dashboard" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const HelmetTitle: FC<HelmetTitleProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the PageContainer component
|
|
4
|
+
*/
|
|
5
|
+
export interface PageContainerProps {
|
|
6
|
+
/** Page title for document head */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Main content to render */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Current page mode (edit, comparison, etc.) */
|
|
11
|
+
mode?: string | null;
|
|
12
|
+
/** Display ID for edit mode banner */
|
|
13
|
+
displayId?: string | null;
|
|
14
|
+
/** Disable padding on the content area */
|
|
15
|
+
noPadding?: boolean;
|
|
16
|
+
/** Additional CSS classes for the container */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Hide the banner even if mode/displayId would show it */
|
|
19
|
+
noBanner?: boolean;
|
|
20
|
+
/** Additional CSS classes for the content area */
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
/** Callback when banner is clicked */
|
|
23
|
+
onBannerClick?: () => void;
|
|
24
|
+
/** Enable scroll to top on mount */
|
|
25
|
+
scrollToTopOnMount?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* PageContainer component provides a consistent layout wrapper for pages
|
|
29
|
+
*
|
|
30
|
+
* Features:
|
|
31
|
+
* - Automatic height calculation
|
|
32
|
+
* - Mode-based banners (edit/comparison)
|
|
33
|
+
* - Flexible content area
|
|
34
|
+
* - Dark mode support
|
|
35
|
+
* - Smooth transitions
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <PageContainer
|
|
40
|
+
* title="Dashboard"
|
|
41
|
+
* mode="edit"
|
|
42
|
+
* displayId="AGR-123"
|
|
43
|
+
* >
|
|
44
|
+
* <YourContent />
|
|
45
|
+
* </PageContainer>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const PageContainer: {
|
|
49
|
+
({ title, children, mode, displayId, noPadding, className, noBanner, contentClassName, onBannerClick, scrollToTopOnMount, }: PageContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout-related constants
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Available page modes
|
|
6
|
+
*/
|
|
7
|
+
export declare enum MODES {
|
|
8
|
+
COMPARISON = "comparison",
|
|
9
|
+
EDIT = "edit",
|
|
10
|
+
FOCUS_EDIT = "focusEdit"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Animation duration for layout transitions in milliseconds
|
|
14
|
+
*/
|
|
15
|
+
export declare const OPEN_DURATION_MS = 500;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,10 +26,14 @@ export { MultiFileUpload } from "./components/forms/multi-file-upload/MultiFileU
|
|
|
26
26
|
export type { MultiFileUploadProps, FileUploadResult, FileChangeValue, } from "./components/forms/multi-file-upload/MultiFileUpload";
|
|
27
27
|
export { FileUpload } from "./components/forms/file-upload/FileUpload";
|
|
28
28
|
export type { FileUploadProps, FileUploadSize, FileUploadVariant, } from "./components/forms/file-upload/FileUpload";
|
|
29
|
+
export { IconPicker, IconRenderer } from "./components/forms/icon-picker/IconPicker";
|
|
30
|
+
export type { IconPickerContentProps } from "./components/forms/icon-picker/IconPicker";
|
|
29
31
|
export { StatusColorMapping } from "./components/data-display/status-color-mapping/StatusColorMapping";
|
|
30
32
|
export type { StatusColorMappingProps, StatusColor, } from "./components/data-display/status-color-mapping/StatusColorMapping";
|
|
31
33
|
export { Badge } from "./components/data-display/badge/Badge";
|
|
32
34
|
export type { BadgeProps, BadgeStatus, BadgeAppearance, BadgeSize, } from "./components/data-display/badge/Badge";
|
|
35
|
+
export { Card } from "./components/data-display/card/Card";
|
|
36
|
+
export type { CardProps } from "./components/data-display/card/Card";
|
|
33
37
|
export { Modal } from "./components/data-display/modal/Modal";
|
|
34
38
|
export type { ModalProps, } from "./components/data-display/modal/Modal";
|
|
35
39
|
export { Tag } from "./components/data-display/tag/Tag";
|
|
@@ -62,6 +66,7 @@ export { useTheme } from "./hooks/useTheme";
|
|
|
62
66
|
export { parseJson, filterTopLevelPaths, randomHexString } from "./utils/utilities";
|
|
63
67
|
export { systemMessages } from "./utils/messageConstants";
|
|
64
68
|
export { formatCurrency, formatDate, formatBooleanValue, isISODateString } from "./utils/formatters";
|
|
69
|
+
export { getFlagComponent, getFlagComponentSm, getFlagComponentRectangle, getFlagComponentRectangleSm, getFlagComponentRectangleMd } from "./utils/countryFlags";
|
|
65
70
|
export { LaxIcon } from "./components/icons/LaxIcon";
|
|
66
71
|
export { ComingSoonIcon } from "./components/icons/ComingSoonIcon";
|
|
67
72
|
export { CheckSmallIcon } from "./components/icons/CheckSmallIcon";
|
|
@@ -79,6 +84,7 @@ export type { DynamicDataModalProps, TTabKey as DynamicDataModalTabKey } from ".
|
|
|
79
84
|
export { DeleteModal } from "./components/data-display/delete-modal/DeleteModal";
|
|
80
85
|
export type { DeleteModalProps } from "./components/data-display/delete-modal/DeleteModal";
|
|
81
86
|
export type { JsonValue, JsonObject, JsonArray, Tab as CodeEditorTab, ThemeContextType, PythonError, JsonGridContextType } from "./types";
|
|
87
|
+
export { COUNTRY_CODES, countryNameFromCode } from "./types/icon-picker";
|
|
82
88
|
export { DiffViewer, InlineDiffHighlighter, } from "./components/data-display/diff-viewer/DiffViewer";
|
|
83
89
|
export type { DiffViewerProps, DiffType, DiffTheme, } from "./components/data-display/diff-viewer/DiffViewer";
|
|
84
90
|
export { default as Button } from "./components/button/Button";
|
|
@@ -103,3 +109,7 @@ export { useOutsideClick } from "./hooks/useOutsideClick";
|
|
|
103
109
|
export type { UseOutsideClickProps } from "./hooks/useOutsideClick";
|
|
104
110
|
export { useModalContainer } from "./hooks/useModalContainer";
|
|
105
111
|
export type { UseModalContainerOptions } from "./hooks/useModalContainer";
|
|
112
|
+
export { useScrollToTop } from "./hooks/useScrollToTop";
|
|
113
|
+
export { PageContainer, HelmetTitle } from "./components/layout";
|
|
114
|
+
export type { PageContainerProps, HelmetTitleProps } from "./components/layout";
|
|
115
|
+
export { MODES, OPEN_DURATION_MS } from "./constants/layout";
|