@devopness/ui-react 2.181.0 → 2.182.0
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/src/components/Primitives/ViewDetails/ViewDetails.d.ts +27 -0
- package/dist/src/components/Primitives/ViewDetails/ViewDetails.styled.d.ts +11 -0
- package/dist/src/components/Primitives/ViewDetails/ViewDetailsContent.d.ts +72 -0
- package/dist/src/components/Primitives/ViewDetails/ViewDetailsLoading.d.ts +10 -0
- package/dist/src/components/Primitives/ViewDetails/index.d.ts +3 -0
- package/dist/src/components/Primitives/index.d.ts +1 -0
- package/dist/src/components/type-guards.d.ts +13 -0
- package/dist/src/utils/QuestionIcon.d.ts +7 -0
- package/dist/src/utils/getTextContent.d.ts +18 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/ui-react.cjs +412 -349
- package/dist/ui-react.js +5182 -4833
- package/package.json +3 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { DetailsContentProps } from './ViewDetailsContent';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the `ViewDetails` component.
|
|
5
|
+
*/
|
|
6
|
+
type ViewDetailsProps = {
|
|
7
|
+
/** Array of sections, each containing a label and items */
|
|
8
|
+
data: {
|
|
9
|
+
label: string | undefined;
|
|
10
|
+
items: Exclude<DetailsContentProps, 'navigationComponent'>[];
|
|
11
|
+
}[];
|
|
12
|
+
navigationComponent: DetailsContentProps['navigationComponent'];
|
|
13
|
+
};
|
|
14
|
+
type DetailsDataProps = ComponentPropsWithoutRef<typeof ViewDetails>['data'][number];
|
|
15
|
+
/**
|
|
16
|
+
* Component to display multiple sections with details.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ViewDetails data={[
|
|
21
|
+
* { label: 'User Info', items: [{ label: 'Name', value: 'John', navigationComponent: NavigationLink }] }
|
|
22
|
+
* ]} />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const ViewDetails: ({ data, navigationComponent }: ViewDetailsProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export { ViewDetails };
|
|
27
|
+
export type { DetailsDataProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const LoadingContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
declare const Section: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
declare const Row: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
declare const Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
declare const DetailViewSection: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
declare const LineWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
declare const Title: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
8
|
+
declare const Paragraph: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
|
+
declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
10
|
+
declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
11
|
+
export { Container, Section, Row, Title, Text, LoadingContainer, Paragraph, Label, DetailViewSection, LineWrapper, };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { Icon } from '../../../icons';
|
|
3
|
+
/** Props for the icon component */
|
|
4
|
+
type IconProps = (Icon | Omit<string, Icon>) | {
|
|
5
|
+
name: Omit<string, Icon>;
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Props for the navigation component
|
|
12
|
+
*/
|
|
13
|
+
type NavigationComponentProps = {
|
|
14
|
+
/** URL string for the navigation component */
|
|
15
|
+
to: string | undefined;
|
|
16
|
+
/** Target attribute for the navigation component */
|
|
17
|
+
target?: '_blank' | '_self' | undefined;
|
|
18
|
+
/** Node to render */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Indicates if the URL should be opened in a new tab */
|
|
21
|
+
isExternalUrl?: boolean;
|
|
22
|
+
/** Style to apply to the navigation component */
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
type DetailsContentProps = {
|
|
26
|
+
/** Label for the detail item */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Value for the detail item */
|
|
29
|
+
value: ReactNode;
|
|
30
|
+
/** Icon to display alongside the label */
|
|
31
|
+
icon?: IconProps;
|
|
32
|
+
/** URL string or props object for the navigation component */
|
|
33
|
+
url?: string | Partial<NavigationComponentProps>;
|
|
34
|
+
/** If true, the URL is a resource within the application */
|
|
35
|
+
isResourceUrl?: boolean;
|
|
36
|
+
/** If true, adds copy-to-clipboard functionality */
|
|
37
|
+
isCopyToClipboard?: boolean;
|
|
38
|
+
/** If true, hides sensitive content */
|
|
39
|
+
isHidden?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* When true, long text will show an ellipsis
|
|
42
|
+
* when it overflows the container and show
|
|
43
|
+
* full content in tooltip on hover
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
shouldDisableTextWrap?: boolean;
|
|
47
|
+
/** Tooltip content to display */
|
|
48
|
+
tooltip?: string | {
|
|
49
|
+
label?: string;
|
|
50
|
+
value?: string;
|
|
51
|
+
};
|
|
52
|
+
statusIcon?: IconProps;
|
|
53
|
+
/**
|
|
54
|
+
* Component to use for navigation links
|
|
55
|
+
*/
|
|
56
|
+
navigationComponent?: ComponentType<NavigationComponentProps>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Component to display a single detail row with optional icon, link, copy-to-clipboard, and tooltip.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <DetailsContent
|
|
64
|
+
* label="Username"
|
|
65
|
+
* value="johndoe"
|
|
66
|
+
* navigationComponent={NavigationLink}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const ViewDetailsContent: ({ label, value, url, icon, isCopyToClipboard, isHidden, isResourceUrl, statusIcon, tooltip, shouldDisableTextWrap, navigationComponent, }: DetailsContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export { ViewDetailsContent };
|
|
72
|
+
export type { IconProps, DetailsContentProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A component that renders a structured skeleton UI for the ViewDetails component.
|
|
3
|
+
*
|
|
4
|
+
* Includes placeholders for title, paragraphs, a separator line, and buttons.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <ViewDetailsLoading ariaLabel="loading" />
|
|
8
|
+
*/
|
|
9
|
+
declare const ViewDetailsLoading: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { ViewDetailsLoading };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given data is defined (i.e. it is not null or undefined).
|
|
3
|
+
*
|
|
4
|
+
* @template T The type of the data.
|
|
5
|
+
* @param data The data to check.
|
|
6
|
+
* @returns {boolean} True if the data is defined, false otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* isDefined(5); // true
|
|
10
|
+
* isDefined(null); // false
|
|
11
|
+
*/
|
|
12
|
+
declare function isDefined<T>(data: T | null | undefined): data is T;
|
|
13
|
+
export { isDefined };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuestionIcon component that displays a help icon with hover interaction.
|
|
3
|
+
* Used to indicate additional information or help is available.
|
|
4
|
+
* @returns A question mark icon that changes color on hover
|
|
5
|
+
*/
|
|
6
|
+
declare const QuestionIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { QuestionIcon };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts text content from a React node or component.
|
|
4
|
+
*
|
|
5
|
+
* @param node - Any valid React node (element, string, number, array of nodes, etc.)
|
|
6
|
+
* @returns The combined text content of the node and its children
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Simple text
|
|
10
|
+
* getTextContent("Hello") // Returns: "Hello"
|
|
11
|
+
*
|
|
12
|
+
* // React element with children
|
|
13
|
+
* getTextContent(<div>Hello <span>World</span></div>) // Returns: "Hello World"
|
|
14
|
+
*
|
|
15
|
+
* // Array of elements
|
|
16
|
+
* getTextContent([<span>Hello</span>, " ", <span>World</span>]) // Returns: "Hello World"
|
|
17
|
+
*/
|
|
18
|
+
export declare const getTextContent: (node: ReactNode) => string;
|