@devopness/ui-react 2.156.0 → 2.157.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/Templates/Card/Card.d.ts +98 -0
- package/dist/src/components/Templates/Card/Card.styled.d.ts +38 -0
- package/dist/src/components/Templates/Card/index.d.ts +1 -0
- package/dist/src/components/Templates/index.d.ts +1 -0
- package/dist/src/components/types.d.ts +12 -1
- package/dist/ui-react.cjs +263 -151
- package/dist/ui-react.js +3722 -3481
- package/package.json +13 -13
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Color } from '../../../colors';
|
|
2
|
+
import { IconProps } from '../../Primitives/Icon';
|
|
3
|
+
import { TooltipProps } from '../../Primitives/Tooltip';
|
|
4
|
+
type CardProps = React.PropsWithChildren<{
|
|
5
|
+
/**
|
|
6
|
+
* Props for the avatar wrapper
|
|
7
|
+
*/
|
|
8
|
+
avatarProps: {
|
|
9
|
+
backgroundColor: Color;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Array of footer items to be rendered at the bottom of the card
|
|
13
|
+
*/
|
|
14
|
+
footer?: {
|
|
15
|
+
/**
|
|
16
|
+
* Icon to display next to the label
|
|
17
|
+
*/
|
|
18
|
+
icon?: IconProps['name'] | IconProps;
|
|
19
|
+
/**
|
|
20
|
+
* Text to display in the footer item
|
|
21
|
+
*/
|
|
22
|
+
label?: string | {
|
|
23
|
+
content: string;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Tooltip text to show on hover
|
|
28
|
+
*/
|
|
29
|
+
tooltip?: string | Omit<TooltipProps, 'children'>;
|
|
30
|
+
/**
|
|
31
|
+
* URL to navigate to when footer item is clicked
|
|
32
|
+
*/
|
|
33
|
+
url?: string;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Props for the header
|
|
37
|
+
*/
|
|
38
|
+
headerProps?: {
|
|
39
|
+
backgroundColor?: Color;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Icon to display in the card
|
|
43
|
+
*/
|
|
44
|
+
icon?: IconProps['name'] | IconProps;
|
|
45
|
+
/**
|
|
46
|
+
* Unique identifier for the card
|
|
47
|
+
*/
|
|
48
|
+
id?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Indicator to display in the card
|
|
51
|
+
*/
|
|
52
|
+
indicator?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Subtitle to display in the card
|
|
55
|
+
*/
|
|
56
|
+
subtitle?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Title to display in the card
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/**
|
|
62
|
+
* Props for the title
|
|
63
|
+
*/
|
|
64
|
+
titleProps?: Pick<React.HTMLProps<HTMLSpanElement>, 'style'>;
|
|
65
|
+
/**
|
|
66
|
+
* URL to navigate to when card is clicked
|
|
67
|
+
*/
|
|
68
|
+
url?: string;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* A flexible and customizable card component for displaying content
|
|
72
|
+
* with a consistent, structured layout.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* // Basic usage
|
|
76
|
+
* <Card
|
|
77
|
+
* title="Environment"
|
|
78
|
+
* subtitle="Overview of current environments"
|
|
79
|
+
* avatarProps={{ backgroundColor: 'blue.500' }}
|
|
80
|
+
* icon="cubes"
|
|
81
|
+
* />
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* // Card with footer and navigation
|
|
85
|
+
* <Card
|
|
86
|
+
* title="Teams"
|
|
87
|
+
* url="/teams"
|
|
88
|
+
* footer={[
|
|
89
|
+
* {
|
|
90
|
+
* label: 'View All',
|
|
91
|
+
* url: '/teams'
|
|
92
|
+
* }
|
|
93
|
+
* ]}
|
|
94
|
+
* />
|
|
95
|
+
*/
|
|
96
|
+
declare const Card: ({ children, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export type { CardProps };
|
|
98
|
+
export { Card };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CardProps } from './Card';
|
|
2
|
+
import { TransientProps } from '../../types';
|
|
3
|
+
type StyledContainerProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Disable the minimum height of the container
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
$disableMinHeight?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const StyledContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledContainerProps>> & string;
|
|
12
|
+
declare const StyledAvatar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TransientProps<{
|
|
13
|
+
backgroundColor: import('../../../colors').Color;
|
|
14
|
+
}>>> & string;
|
|
15
|
+
declare const StyledTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
16
|
+
declare const StyledSubtitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
17
|
+
declare const StyledIndicator: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
18
|
+
type StyledHeaderProps = TransientProps<CardProps['headerProps']> & {
|
|
19
|
+
/**
|
|
20
|
+
* Hide the border of the header
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
$hideBorder?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare const StyledHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledHeaderProps>> & string;
|
|
27
|
+
type StyledFooterProps = {
|
|
28
|
+
/**
|
|
29
|
+
* Show the footer border
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
$showBorder?: boolean;
|
|
34
|
+
};
|
|
35
|
+
declare const StyledFooter: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledFooterProps>> & string;
|
|
36
|
+
declare const StyledFooterLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
37
|
+
declare const StyledLetterAvatar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
38
|
+
export { StyledAvatar, StyledContainer, StyledFooter, StyledFooterLabel, StyledHeader, StyledIndicator, StyledLetterAvatar, StyledSubtitle, StyledTitle, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps props to styled component transient props
|
|
3
|
+
*
|
|
4
|
+
* Adds a `$` prefix to the prop name to prevent it from being passed to the
|
|
5
|
+
* underlying React node or rendered to the DOM element
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://styled-components.com/docs/api#transient-props | Styled Components - Transient props}
|
|
8
|
+
*/
|
|
9
|
+
type TransientProps<T extends object | undefined> = {
|
|
10
|
+
[Key in keyof NonNullable<T> as `$${string & Key}`]: NonNullable<T>[Key];
|
|
11
|
+
};
|
|
1
12
|
/**
|
|
2
13
|
* Unwrap<T>
|
|
3
14
|
*
|
|
@@ -24,4 +35,4 @@
|
|
|
24
35
|
type Unwrap<T> = {
|
|
25
36
|
[K in keyof T]: T[K];
|
|
26
37
|
} & {};
|
|
27
|
-
export type { Unwrap };
|
|
38
|
+
export type { TransientProps, Unwrap };
|