@devopness/ui-react 2.155.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/Forms/Input/Input.d.ts +11 -4
- 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 +269 -157
- package/dist/ui-react.js +4828 -4441
- package/package.json +29 -29
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { ErrorMessageProps } from '../../Primitives/ErrorMessage';
|
|
3
2
|
import { LabelProps } from '../../Primitives/Label';
|
|
4
3
|
type SharedProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
@@ -36,6 +35,14 @@ type InputProps = (SharedProps & {
|
|
|
36
35
|
/**
|
|
37
36
|
* Allows users to enter and edit text
|
|
38
37
|
*
|
|
38
|
+
* A flexible input component that supports:
|
|
39
|
+
* - Various input types (text, number, etc.)
|
|
40
|
+
* - Error states with automatic focus
|
|
41
|
+
* - Custom styling
|
|
42
|
+
* - Label and help text
|
|
43
|
+
*
|
|
44
|
+
* When an error state is applied, the input will automatically receive focus to draw the user's attention.
|
|
45
|
+
*
|
|
39
46
|
* @example
|
|
40
47
|
* ```
|
|
41
48
|
* <Input
|
|
@@ -50,7 +57,7 @@ type InputProps = (SharedProps & {
|
|
|
50
57
|
* />
|
|
51
58
|
* ```
|
|
52
59
|
*/
|
|
53
|
-
declare const Input:
|
|
60
|
+
declare const Input: import('react').ForwardRefExoticComponent<(Omit<import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
54
61
|
/** React ref for direct DOM manipulation */
|
|
55
62
|
ref?: React.Ref<HTMLInputElement>;
|
|
56
63
|
/** Error message configuration */
|
|
@@ -75,7 +82,7 @@ declare const Input: React.ForwardRefExoticComponent<(Omit<React.InputHTMLAttrib
|
|
|
75
82
|
} & {
|
|
76
83
|
/** HTML input type (text, number, email, etc) */
|
|
77
84
|
type: Exclude<React.HTMLInputTypeAttribute, "number">;
|
|
78
|
-
}, "ref"> | Omit<
|
|
85
|
+
}, "ref"> | Omit<import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
79
86
|
/** React ref for direct DOM manipulation */
|
|
80
87
|
ref?: React.Ref<HTMLInputElement>;
|
|
81
88
|
/** Error message configuration */
|
|
@@ -102,6 +109,6 @@ declare const Input: React.ForwardRefExoticComponent<(Omit<React.InputHTMLAttrib
|
|
|
102
109
|
type: "number";
|
|
103
110
|
/** Removes increment/decrement arrows from number inputs */
|
|
104
111
|
removeArrows?: boolean;
|
|
105
|
-
}, "ref">) &
|
|
112
|
+
}, "ref">) & import('react').RefAttributes<HTMLInputElement>>;
|
|
106
113
|
export type { InputProps };
|
|
107
114
|
export { Input };
|
|
@@ -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 };
|