@devopness/ui-react 2.180.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/Review/Review.d.ts +46 -0
- package/dist/src/components/Primitives/Review/Review.styled.d.ts +24 -0
- package/dist/src/components/Primitives/Review/ReviewBox.d.ts +24 -0
- package/dist/src/components/Primitives/Review/index.d.ts +2 -0
- package/dist/src/components/Primitives/ToggleContent/ToggleContent.d.ts +40 -0
- package/dist/src/components/Primitives/ToggleContent/ToggleContentButton.d.ts +28 -0
- package/dist/src/components/Primitives/ToggleContent/index.d.ts +2 -0
- 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 +3 -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 +453 -351
- package/dist/ui-react.js +5563 -5025
- package/package.json +4 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Icon } from '../../../icons';
|
|
3
|
+
type ReviewProps = {
|
|
4
|
+
/** Content text or JSX element */
|
|
5
|
+
content: string | React.JSX.Element;
|
|
6
|
+
/** Make content bold
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
isBoldFontWeight?: boolean;
|
|
10
|
+
/** Optional icon to display */
|
|
11
|
+
icon?: Icon | Omit<string, Icon>;
|
|
12
|
+
/** Background color for the icon */
|
|
13
|
+
iconBackgroundColor?: string;
|
|
14
|
+
/** Icon color */
|
|
15
|
+
iconColor?: string;
|
|
16
|
+
/** Icon size in pixels */
|
|
17
|
+
iconSize?: number;
|
|
18
|
+
/** Optional prefix before the label */
|
|
19
|
+
prefix?: string;
|
|
20
|
+
/** Background color for the review box */
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
/** Apply margin for prefix
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
hasPrefixMargin?: boolean;
|
|
26
|
+
/** Show icon after label instead of before
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
isIconAfterLabel?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Review component displays a label/value pair with optional icon and prefix.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```jsx
|
|
36
|
+
* <Review
|
|
37
|
+
* content="Status: Approved"
|
|
38
|
+
* icon="check"
|
|
39
|
+
* prefix="Info"
|
|
40
|
+
* backgroundColor="#f5f5f5"
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare const Review: ({ content, icon, iconBackgroundColor, iconColor, iconSize, isBoldFontWeight, prefix, backgroundColor, hasPrefixMargin, isIconAfterLabel, }: ReviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export type { ReviewProps };
|
|
46
|
+
export { Review };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type DetailContentValueProps = {
|
|
2
|
+
isBoldFontWeight?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type DetailContentInformationProps = {
|
|
5
|
+
noIcon?: boolean;
|
|
6
|
+
isIconAfterLabel?: boolean;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
};
|
|
9
|
+
type ContentDetailProps = {
|
|
10
|
+
type?: 'default' | 'warning';
|
|
11
|
+
};
|
|
12
|
+
type StyledProps = {
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const DetailContentInformation: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, DetailContentInformationProps>> & string;
|
|
17
|
+
declare const DetailContentValue: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, DetailContentValueProps>> & string;
|
|
18
|
+
declare const PrefixWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
19
|
+
showMarginRight?: boolean;
|
|
20
|
+
}>> & string;
|
|
21
|
+
declare const ContentIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
|
|
22
|
+
declare const ContentDetail: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, ContentDetailProps>> & string;
|
|
23
|
+
export type { DetailContentInformationProps, DetailContentValueProps, ContentDetailProps, };
|
|
24
|
+
export { DetailContentInformation, DetailContentValue, PrefixWrapper, ContentIcon, ContentDetail, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the `ReviewBox` component.
|
|
4
|
+
*/
|
|
5
|
+
type ReviewBoxProps = {
|
|
6
|
+
/** Child `Review` components to be displayed inside this container */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** The type of the review box, which affects its background color */
|
|
9
|
+
type?: 'default' | 'warning';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A container component for displaying a group of `Review` components.
|
|
13
|
+
*
|
|
14
|
+
* Pass any number of `Review` components as children to this component.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <ReviewBox type="default">
|
|
18
|
+
* <Review content="Status: Approved" icon="check" prefix="Info" />
|
|
19
|
+
* <Review content="Score: 85%" icon="star" isIconAfterLabel />
|
|
20
|
+
* </ReviewBox>
|
|
21
|
+
*/
|
|
22
|
+
declare const ReviewBox: ({ children, type }: ReviewBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export type { ReviewBoxProps };
|
|
24
|
+
export { ReviewBox };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { ToggleContentButtonProps } from './ToggleContentButton';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the `ToggleContent` component.
|
|
5
|
+
*/
|
|
6
|
+
type ToggleContentProps = {
|
|
7
|
+
/** Whether the content is sensitive (hides by default)
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
isSensitiveContent?: boolean;
|
|
11
|
+
/** Show warning when revealing sensitive content
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
showWarning?: boolean;
|
|
15
|
+
/** Placeholder to show when content is hidden */
|
|
16
|
+
hiddenContentPlaceholder?: ReactNode;
|
|
17
|
+
/** Whether to show the hidden content placeholder
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
showHiddenContentPlaceholder?: boolean;
|
|
21
|
+
/** Optional container props */
|
|
22
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
/** Props for the toggle button */
|
|
24
|
+
buttonProps?: ToggleContentButtonProps;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Component to show/hide sensitive content with a toggle button.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <ToggleContent
|
|
31
|
+
* isSensitiveContent
|
|
32
|
+
* showWarning
|
|
33
|
+
* hiddenContentPlaceholder="*****"
|
|
34
|
+
* >
|
|
35
|
+
* <span>Secret value</span>
|
|
36
|
+
* </ToggleContent>
|
|
37
|
+
*/
|
|
38
|
+
declare const ToggleContent: ({ isSensitiveContent, showWarning, hiddenContentPlaceholder, showHiddenContentPlaceholder, containerProps, buttonProps, children, }: PropsWithChildren<ToggleContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export { ToggleContent };
|
|
40
|
+
export type { ToggleContentProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { Button } from '../../Buttons';
|
|
3
|
+
import { Icon } from '../../../icons';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the `ToggleContentButton` component.
|
|
6
|
+
*/
|
|
7
|
+
type ToggleContentButtonProps = ComponentPropsWithoutRef<typeof Button> & {
|
|
8
|
+
/** Whether the content is currently visible
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
showContent?: boolean;
|
|
12
|
+
/** Optional props when hiding the content */
|
|
13
|
+
hideContentProps?: {
|
|
14
|
+
text?: string;
|
|
15
|
+
icon?: Icon;
|
|
16
|
+
};
|
|
17
|
+
/** Optional props when revealing the content */
|
|
18
|
+
revealContentProps?: {
|
|
19
|
+
text?: string;
|
|
20
|
+
icon?: Icon;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Button to toggle visibility of sensitive content.
|
|
25
|
+
*/
|
|
26
|
+
declare const ToggleContentButton: ({ showContent, hideContentProps, revealContentProps, ...props }: ToggleContentButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { ToggleContentButton };
|
|
28
|
+
export type { ToggleContentButtonProps };
|
|
@@ -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;
|