@lax-wp/design-system 0.3.77 → 0.3.78

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.
@@ -0,0 +1,21 @@
1
+ import type { FC, ReactNode } from "react";
2
+ /**
3
+ * Props for the Divider component
4
+ */
5
+ export interface DividerProps {
6
+ /** Optional content to display in the center of the divider */
7
+ children?: ReactNode;
8
+ /** Additional CSS classes */
9
+ className?: string;
10
+ }
11
+ /**
12
+ * Divider component displays a horizontal line with optional centered content
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <Divider />
17
+ * <Divider>OR</Divider>
18
+ * <Divider className="my-4">Section</Divider>
19
+ * ```
20
+ */
21
+ export declare const Divider: FC<DividerProps>;
@@ -0,0 +1,50 @@
1
+ interface DynamicItemsCellItem {
2
+ id?: string | number;
3
+ [key: string]: unknown;
4
+ }
5
+ /**
6
+ * Props for the DynamicItemsCell component
7
+ */
8
+ export interface DynamicItemsCellProps<T extends DynamicItemsCellItem> {
9
+ /** Array of items to display */
10
+ items: T[];
11
+ /** Whether dark mode is enabled */
12
+ isDarkMode: boolean;
13
+ /** Function to extract label from item */
14
+ getLabel: (item: T) => string;
15
+ /** Function to extract color from item */
16
+ getColor: (item: T) => string;
17
+ /** Function to extract unique ID from item */
18
+ getId?: (item: T) => string | number;
19
+ /** Color for the "more" tag */
20
+ moreTagColor?: string;
21
+ /** Whether to use hash color generation */
22
+ useHashColor?: boolean;
23
+ /** Tooltip placement */
24
+ tooltipPlacement?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
25
+ /** Additional CSS classes */
26
+ className?: string;
27
+ /** Container width for calculating visible items */
28
+ containerWidth?: number;
29
+ }
30
+ /**
31
+ * DynamicItemsCell component displays a list of tags that automatically
32
+ * truncates based on container width and shows overflow count
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <DynamicItemsCell
37
+ * items={[{ id: 1, name: "Tag 1", color: "blue" }, { id: 2, name: "Tag 2", color: "green" }]}
38
+ * isDarkMode={false}
39
+ * getLabel={(item) => item.name}
40
+ * getColor={(item) => item.color}
41
+ * containerWidth={300}
42
+ * />
43
+ * ```
44
+ */
45
+ declare const DynamicItemsCellComponent: {
46
+ <T extends DynamicItemsCellItem>({ items, isDarkMode, getLabel, getColor, getId, moreTagColor, useHashColor, tooltipPlacement, className, containerWidth, }: DynamicItemsCellProps<T>): import("react/jsx-runtime").JSX.Element;
47
+ displayName: string;
48
+ };
49
+ export declare const DynamicItemsCell: typeof DynamicItemsCellComponent;
50
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { FC } from "react";
2
+ /**
3
+ * Props for the Skeleton component
4
+ */
5
+ export interface SkeletonProps {
6
+ /** Whether to show animation */
7
+ active?: boolean;
8
+ }
9
+ /**
10
+ * Skeleton component displays a placeholder loading state
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Skeleton />
15
+ * <Skeleton active={false} />
16
+ * ```
17
+ */
18
+ export declare const Skeleton: FC<SkeletonProps>;
@@ -0,0 +1,41 @@
1
+ import type { FC, ReactNode } from "react";
2
+ type TSVG = FC<React.SVGProps<SVGSVGElement>>;
3
+ /**
4
+ * Props for the Text component
5
+ */
6
+ export interface TextProps {
7
+ /** Text content to display (will be passed through i18n translation) */
8
+ text: string;
9
+ /** Whether to render without a wrapper tag */
10
+ emptyTag?: boolean;
11
+ /** Additional CSS classes */
12
+ className?: string;
13
+ /** Click handler for the text element */
14
+ onClick?: () => void;
15
+ /** Icon component to display on the left */
16
+ LeftIcon?: TSVG | null;
17
+ /** Role attribute for accessibility */
18
+ role?: "row" | "button";
19
+ /** Text to prepend before main text */
20
+ LText?: string;
21
+ /** Text to append after main text */
22
+ RText?: string;
23
+ /** Icon component to display on the right */
24
+ RightIcon?: TSVG | null;
25
+ /** HTML tag to render */
26
+ tagName?: "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "button";
27
+ /** Additional children to render */
28
+ children?: ReactNode;
29
+ }
30
+ /**
31
+ * Text component displays translated text with optional icons and customizable tag
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <Text text="Hello World" />
36
+ * <Text text="Click me" tagName="button" onClick={handleClick} />
37
+ * <Text text="Title" tagName="h1" LeftIcon={StarIcon} />
38
+ * ```
39
+ */
40
+ declare const Text: FC<TextProps>;
41
+ export default Text;
@@ -0,0 +1,19 @@
1
+ import type { FC } from "react";
2
+ /**
3
+ * Props for the TextWithStrike component
4
+ */
5
+ export interface TextWithStrikeProps {
6
+ /** Text content that may contain <um></um> tags for highlighting */
7
+ text: string;
8
+ }
9
+ /**
10
+ * TextWithStrike component parses text with <um></um> tags and displays
11
+ * the content between those tags with a highlighted background.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <TextWithStrike text="This is <um>highlighted</um> text" />
16
+ * ```
17
+ */
18
+ declare const TextWithStrike: FC<TextWithStrikeProps>;
19
+ export default TextWithStrike;
@@ -0,0 +1,47 @@
1
+ import type { FC } from "react";
2
+ /**
3
+ * Props for the NumberInputField component
4
+ */
5
+ export interface NumberInputFieldProps {
6
+ /** Label text to display above the input */
7
+ label?: string;
8
+ /** Additional CSS classes for the input */
9
+ className?: string;
10
+ /** Whether the input is disabled */
11
+ disabled?: boolean;
12
+ /** Callback when the value changes */
13
+ onChange?: (value: string | number) => void;
14
+ /** Current value of the input */
15
+ value?: string | number;
16
+ /** Placeholder text */
17
+ placeholder?: string;
18
+ /** Minimum allowed value */
19
+ min?: number;
20
+ /** Maximum allowed value */
21
+ max?: number;
22
+ /** Step increment for number input */
23
+ step?: number;
24
+ /** Number format type: 'comma', 'currency', 'percent' */
25
+ numberFormat?: string;
26
+ /** Number of decimal places */
27
+ precision?: number;
28
+ /** Unique identifier for the input */
29
+ id?: string;
30
+ /** Custom inline styles */
31
+ style?: React.CSSProperties;
32
+ }
33
+ /**
34
+ * NumberInputField component provides a number input with optional formatting
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <NumberInputField
39
+ * label="Amount"
40
+ * value={1000}
41
+ * onChange={setValue}
42
+ * numberFormat="comma"
43
+ * precision={2}
44
+ * />
45
+ * ```
46
+ */
47
+ export declare const NumberInputField: FC<NumberInputFieldProps>;
@@ -0,0 +1,20 @@
1
+ import type { FC } from "react";
2
+ /**
3
+ * Props for the ComponentLoader component
4
+ */
5
+ export interface ComponentLoaderProps {
6
+ /** Additional CSS classes for the wrapper */
7
+ className?: string;
8
+ /** Label text to display above the loader */
9
+ label: string;
10
+ }
11
+ /**
12
+ * ComponentLoader displays a loading indicator with a label
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <ComponentLoader label="Loading..." />
17
+ * <ComponentLoader label="Loading data" className="my-4" />
18
+ * ```
19
+ */
20
+ export declare const ComponentLoader: FC<ComponentLoaderProps>;
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ /**
3
+ * Custom scrollbar handle for external control
4
+ */
5
+ export interface CustomScrollbarHandle {
6
+ /** Scroll to the top of the container */
7
+ scrollToTop: () => void;
8
+ /** Scroll to the right of the container */
9
+ scrollToRight: () => void;
10
+ /** Get the container element */
11
+ getContainer: () => HTMLDivElement | null;
12
+ }
13
+ /**
14
+ * Props for the CustomScrollbar component
15
+ */
16
+ export interface CustomScrollbarProps {
17
+ /** Content to render inside the scrollbar */
18
+ children: React.ReactNode;
19
+ /** Whether to adjust height based on screen size */
20
+ adjustWithScreen?: boolean;
21
+ /** Additional CSS classes for the inner view */
22
+ renderViewClassName?: string;
23
+ /** Whether to use full height */
24
+ 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
+ }
34
+ /**
35
+ * CustomScrollbar component provides a styled scrollable container
36
+ * with custom scrollbar appearance
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <CustomScrollbar>
41
+ * <div>Scrollable content...</div>
42
+ * </CustomScrollbar>
43
+ *
44
+ * // With ref for programmatic control
45
+ * const scrollRef = useRef<CustomScrollbarHandle>(null);
46
+ * <CustomScrollbar ref={scrollRef}>
47
+ * <div>Content...</div>
48
+ * </CustomScrollbar>
49
+ * // scrollRef.current?.scrollToTop();
50
+ * ```
51
+ */
52
+ export declare const CustomScrollbar: React.MemoExoticComponent<React.ForwardRefExoticComponent<CustomScrollbarProps & React.RefAttributes<CustomScrollbarHandle>>>;
@@ -0,0 +1,29 @@
1
+ import type { FC, ReactNode } from "react";
2
+ type TMeta = {
3
+ name: string;
4
+ content: string;
5
+ };
6
+ /**
7
+ * Props for the Helmet component
8
+ */
9
+ export interface HelmetProps {
10
+ /** The document title to set */
11
+ title: string;
12
+ /** Optional meta tag configuration */
13
+ meta?: TMeta;
14
+ /** Additional children to render within Helmet */
15
+ children?: ReactNode;
16
+ }
17
+ /**
18
+ * Helmet component for managing document head metadata
19
+ *
20
+ * Note: Requires react-helmet-async to be installed and configured
21
+ * in the parent application with HelmetProvider.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <Helmet title="Dashboard" meta={{ name: "description", content: "Dashboard page" }} />
26
+ * ```
27
+ */
28
+ export declare const Helmet: FC<HelmetProps>;
29
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { FC } from "react";
2
+ type ClassValue = string | number | boolean | undefined | null | ClassValue[];
3
+ /**
4
+ * Props for the LogoLoader component
5
+ */
6
+ export interface LogoLoaderProps {
7
+ /** Additional CSS classes for the wrapper */
8
+ classValue?: ClassValue;
9
+ /** Whether dark mode is enabled */
10
+ isDarkMode: boolean;
11
+ }
12
+ /**
13
+ * LogoLoader displays an animated LAX logo with a loading bar
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <LogoLoader isDarkMode={false} />
18
+ * <LogoLoader isDarkMode={true} classValue="h-screen" />
19
+ * ```
20
+ */
21
+ export declare const LogoLoader: FC<LogoLoaderProps>;
22
+ export {};
@@ -2,3 +2,11 @@ export { PageContainer } from "./PageContainer";
2
2
  export type { PageContainerProps } from "./PageContainer";
3
3
  export { HelmetTitle } from "./HelmetTitle";
4
4
  export type { HelmetTitleProps } from "./HelmetTitle";
5
+ export { Helmet } from "./Helmet";
6
+ export type { HelmetProps } from "./Helmet";
7
+ export { ComponentLoader } from "./ComponentLoader";
8
+ export type { ComponentLoaderProps } from "./ComponentLoader";
9
+ export { LogoLoader } from "./LogoLoader";
10
+ export type { LogoLoaderProps } from "./LogoLoader";
11
+ export { CustomScrollbar } from "./CustomScrollbar";
12
+ export type { CustomScrollbarProps, CustomScrollbarHandle } from "./CustomScrollbar";
@@ -0,0 +1,52 @@
1
+ import type { FC, ReactNode } from "react";
2
+ import { type TBreadCrumbItem } from "./BreadCrumbItem";
3
+ /**
4
+ * Arrow icon for breadcrumb separators
5
+ */
6
+ export declare const ArrowBreadCums: ({ fill, size, className, }: {
7
+ fill?: string;
8
+ size?: number;
9
+ className?: string;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ /**
12
+ * Props for the BreadCrumb component
13
+ */
14
+ export interface BreadCrumbProps {
15
+ /** Array of breadcrumb items to display */
16
+ items: TBreadCrumbItem[];
17
+ /** Visual variant of the breadcrumb */
18
+ variant?: "primary" | "secondary";
19
+ /** Click handler when a breadcrumb item is clicked */
20
+ onClick?: (id: string | number) => void;
21
+ /**
22
+ * Custom link renderer for navigation
23
+ * Allows integration with any routing library (react-router, next/link, etc.)
24
+ * If not provided, items will be rendered as clickable divs
25
+ */
26
+ renderLink?: (item: TBreadCrumbItem, children: ReactNode, isLastItem: boolean) => ReactNode;
27
+ }
28
+ /**
29
+ * BreadCrumb component displays a navigation trail with animated items
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * // Basic usage with onClick handler
34
+ * <BreadCrumb
35
+ * items={[
36
+ * { id: "1", title: "Home" },
37
+ * { id: "2", title: "Products" },
38
+ * { id: "3", title: "Product Details" }
39
+ * ]}
40
+ * onClick={(id) => navigate(id)}
41
+ * />
42
+ *
43
+ * // With custom link renderer (e.g., react-router)
44
+ * <BreadCrumb
45
+ * items={items}
46
+ * renderLink={(item, children) => (
47
+ * <Link to={item.link || "/"}>{children}</Link>
48
+ * )}
49
+ * />
50
+ * ```
51
+ */
52
+ export declare const BreadCrumb: FC<BreadCrumbProps>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Breadcrumb item data structure
3
+ */
4
+ export interface TBreadCrumbItem {
5
+ /** Unique identifier for the item */
6
+ id?: string | number;
7
+ /** Display title for the breadcrumb item */
8
+ title: string;
9
+ /** Navigation link URL */
10
+ link?: string;
11
+ /** Optional source for navigation state */
12
+ source?: string;
13
+ }
14
+ /**
15
+ * Props for the BreadCrumbItem component
16
+ */
17
+ export interface BreadCrumbItemProps {
18
+ /** The breadcrumb item data */
19
+ item: TBreadCrumbItem;
20
+ /** Visual variant of the breadcrumb */
21
+ variant?: "primary" | "secondary";
22
+ /** Whether this is the last item in the breadcrumb trail */
23
+ isLastItem?: boolean;
24
+ /** Click handler when the item is clicked */
25
+ onClick?: (id: string | number) => void;
26
+ }
27
+ /**
28
+ * BreadCrumbItem component displays a single breadcrumb item with appropriate styling
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <BreadCrumbItem
33
+ * item={{ id: "1", title: "Home", link: "/" }}
34
+ * variant="primary"
35
+ * isLastItem={false}
36
+ * />
37
+ * ```
38
+ */
39
+ export declare const BreadCrumbItem: import("react").ForwardRefExoticComponent<BreadCrumbItemProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ export { BreadCrumb } from "./BreadCrumb";
2
+ export type { BreadCrumbProps } from "./BreadCrumb";
3
+ export { BreadCrumbItem } from "./BreadCrumbItem";
4
+ export type { BreadCrumbItemProps, TBreadCrumbItem } from "./BreadCrumbItem";
package/dist/index.d.ts CHANGED
@@ -124,6 +124,20 @@ 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 { PageContainer, HelmetTitle } from "./components/layout";
128
- export type { PageContainerProps, HelmetTitleProps } from "./components/layout";
127
+ export { PageContainer, HelmetTitle, Helmet, ComponentLoader, LogoLoader, CustomScrollbar } from "./components/layout";
128
+ export type { PageContainerProps, HelmetTitleProps, HelmetProps, ComponentLoaderProps, LogoLoaderProps, CustomScrollbarProps, CustomScrollbarHandle } from "./components/layout";
129
+ export { BreadCrumb, BreadCrumbItem } from "./components/navigation/breadcrumbs";
130
+ export type { BreadCrumbProps, BreadCrumbItemProps, TBreadCrumbItem } from "./components/navigation/breadcrumbs";
131
+ export { Divider } from "./components/data-display/divider/Divider";
132
+ export type { DividerProps } from "./components/data-display/divider/Divider";
133
+ export { Skeleton } from "./components/data-display/skeleton/Skeleton";
134
+ export type { SkeletonProps } from "./components/data-display/skeleton/Skeleton";
135
+ export { default as Text } from "./components/data-display/text/Text";
136
+ export type { TextProps } from "./components/data-display/text/Text";
137
+ export { default as TextWithStrike } from "./components/data-display/text-with-strike/TextWithStrike";
138
+ export type { TextWithStrikeProps } from "./components/data-display/text-with-strike/TextWithStrike";
139
+ export { DynamicItemsCell } from "./components/data-display/dynamic-items-cell/DynamicItemsCell";
140
+ export type { DynamicItemsCellProps } from "./components/data-display/dynamic-items-cell/DynamicItemsCell";
141
+ export { NumberInputField } from "./components/forms/number-input-field/NumberInputField";
142
+ export type { NumberInputFieldProps } from "./components/forms/number-input-field/NumberInputField";
129
143
  export { MODES, OPEN_DURATION_MS } from "./constants/layout";