@lax-wp/design-system 0.3.21 → 0.3.23
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/forms/md-input/MdInput.d.ts +46 -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 +12 -0
- package/dist/index.es.js +34441 -43776
- package/dist/index.umd.js +65 -356
- 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 +7 -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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the MdInput component
|
|
3
|
+
*/
|
|
4
|
+
export interface MdInputProps {
|
|
5
|
+
/** Unique identifier for the markdown input */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Current markdown value */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Callback function called when the markdown value changes */
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
/** Placeholder text for the textarea */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Number of visible text lines for the textarea */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** Whether the input is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Additional CSS classes for the wrapper container */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Additional CSS classes for the textarea */
|
|
20
|
+
textareaClassName?: string;
|
|
21
|
+
/** Additional CSS classes for the preview container */
|
|
22
|
+
previewClassName?: string;
|
|
23
|
+
/** Initial mode (markdown or preview) */
|
|
24
|
+
defaultMode?: "markdown" | "preview";
|
|
25
|
+
/** Current mode (markdown or preview) */
|
|
26
|
+
mode?: "markdown" | "preview";
|
|
27
|
+
/** Label text to display above the input */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** Whether the field is required */
|
|
30
|
+
required?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A markdown input component with preview mode support.
|
|
34
|
+
* Features a toggle switch to switch between markdown editing and preview modes.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <MdInput
|
|
39
|
+
* value={markdown}
|
|
40
|
+
* onChange={setMarkdown}
|
|
41
|
+
* placeholder="Enter markdown content..."
|
|
42
|
+
* defaultMode="markdown"
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const MdInput: ({ id, value, onChange, placeholder, rows, disabled, className, textareaClassName, previewClassName, defaultMode, mode: modeProp, label, required, }: MdInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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
|
@@ -22,14 +22,20 @@ export { PercentageInputField } from "./components/forms/percentage-input/Percen
|
|
|
22
22
|
export type { PercentageInputFieldProps } from "./components/forms/percentage-input/PercentageInputField";
|
|
23
23
|
export { Toggle } from "./components/forms/toggle/Toggle";
|
|
24
24
|
export type { ToggleProps, ToggleDirection, } from "./components/forms/toggle/Toggle";
|
|
25
|
+
export { MdInput } from "./components/forms/md-input/MdInput";
|
|
26
|
+
export type { MdInputProps } from "./components/forms/md-input/MdInput";
|
|
25
27
|
export { MultiFileUpload } from "./components/forms/multi-file-upload/MultiFileUpload";
|
|
26
28
|
export type { MultiFileUploadProps, FileUploadResult, FileChangeValue, } from "./components/forms/multi-file-upload/MultiFileUpload";
|
|
27
29
|
export { FileUpload } from "./components/forms/file-upload/FileUpload";
|
|
28
30
|
export type { FileUploadProps, FileUploadSize, FileUploadVariant, } from "./components/forms/file-upload/FileUpload";
|
|
31
|
+
export { IconPicker, IconRenderer } from "./components/forms/icon-picker/IconPicker";
|
|
32
|
+
export type { IconPickerContentProps } from "./components/forms/icon-picker/IconPicker";
|
|
29
33
|
export { StatusColorMapping } from "./components/data-display/status-color-mapping/StatusColorMapping";
|
|
30
34
|
export type { StatusColorMappingProps, StatusColor, } from "./components/data-display/status-color-mapping/StatusColorMapping";
|
|
31
35
|
export { Badge } from "./components/data-display/badge/Badge";
|
|
32
36
|
export type { BadgeProps, BadgeStatus, BadgeAppearance, BadgeSize, } from "./components/data-display/badge/Badge";
|
|
37
|
+
export { Card } from "./components/data-display/card/Card";
|
|
38
|
+
export type { CardProps } from "./components/data-display/card/Card";
|
|
33
39
|
export { Modal } from "./components/data-display/modal/Modal";
|
|
34
40
|
export type { ModalProps, } from "./components/data-display/modal/Modal";
|
|
35
41
|
export { Tag } from "./components/data-display/tag/Tag";
|
|
@@ -62,6 +68,7 @@ export { useTheme } from "./hooks/useTheme";
|
|
|
62
68
|
export { parseJson, filterTopLevelPaths, randomHexString } from "./utils/utilities";
|
|
63
69
|
export { systemMessages } from "./utils/messageConstants";
|
|
64
70
|
export { formatCurrency, formatDate, formatBooleanValue, isISODateString } from "./utils/formatters";
|
|
71
|
+
export { getFlagComponent, getFlagComponentSm, getFlagComponentRectangle, getFlagComponentRectangleSm, getFlagComponentRectangleMd } from "./utils/countryFlags";
|
|
65
72
|
export { LaxIcon } from "./components/icons/LaxIcon";
|
|
66
73
|
export { ComingSoonIcon } from "./components/icons/ComingSoonIcon";
|
|
67
74
|
export { CheckSmallIcon } from "./components/icons/CheckSmallIcon";
|
|
@@ -79,6 +86,7 @@ export type { DynamicDataModalProps, TTabKey as DynamicDataModalTabKey } from ".
|
|
|
79
86
|
export { DeleteModal } from "./components/data-display/delete-modal/DeleteModal";
|
|
80
87
|
export type { DeleteModalProps } from "./components/data-display/delete-modal/DeleteModal";
|
|
81
88
|
export type { JsonValue, JsonObject, JsonArray, Tab as CodeEditorTab, ThemeContextType, PythonError, JsonGridContextType } from "./types";
|
|
89
|
+
export { COUNTRY_CODES, countryNameFromCode } from "./types/icon-picker";
|
|
82
90
|
export { DiffViewer, InlineDiffHighlighter, } from "./components/data-display/diff-viewer/DiffViewer";
|
|
83
91
|
export type { DiffViewerProps, DiffType, DiffTheme, } from "./components/data-display/diff-viewer/DiffViewer";
|
|
84
92
|
export { default as Button } from "./components/button/Button";
|
|
@@ -103,3 +111,7 @@ export { useOutsideClick } from "./hooks/useOutsideClick";
|
|
|
103
111
|
export type { UseOutsideClickProps } from "./hooks/useOutsideClick";
|
|
104
112
|
export { useModalContainer } from "./hooks/useModalContainer";
|
|
105
113
|
export type { UseModalContainerOptions } from "./hooks/useModalContainer";
|
|
114
|
+
export { useScrollToTop } from "./hooks/useScrollToTop";
|
|
115
|
+
export { PageContainer, HelmetTitle } from "./components/layout";
|
|
116
|
+
export type { PageContainerProps, HelmetTitleProps } from "./components/layout";
|
|
117
|
+
export { MODES, OPEN_DURATION_MS } from "./constants/layout";
|