@pk-design/react-tailwind 1.4.1 → 1.4.3
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/react-tailwind.cjs.js +35 -27
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +35 -27
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +1 -1
- package/dist/types/components/Alert/Alert.types.d.ts +10 -4
- package/dist/types/components/Badge/Badge.types.d.ts +13 -3
- package/dist/types/components/Banner/Banner.types.d.ts +15 -2
- package/package.json +1 -1
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type AlertType = 'success' | 'danger' | 'warning' | 'info';
|
|
3
|
-
export interface BaseAlertProps {
|
|
3
|
+
export interface BaseAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
|
|
4
4
|
/**
|
|
5
5
|
* Defines alert type
|
|
6
6
|
* @default "info"
|
|
7
7
|
*/
|
|
8
8
|
type?: AlertType;
|
|
9
|
-
className?: string;
|
|
10
9
|
/**
|
|
11
10
|
* Defines if alert is removable
|
|
12
11
|
*/
|
|
13
12
|
removable?: boolean;
|
|
14
13
|
/**
|
|
15
14
|
* Handler when closing / dismissing alert
|
|
16
|
-
* @returns void
|
|
17
15
|
*/
|
|
18
16
|
onRemove?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Override the default type icon. Pass null to suppress the icon entirely.
|
|
19
|
+
*/
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Optional bold title rendered above the message
|
|
23
|
+
*/
|
|
24
|
+
title?: ReactNode;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* Alert component used to display important messages.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
export type BadgeTheme = 'success' | 'danger' | 'warning' | 'info' | 'secondary';
|
|
2
|
-
export
|
|
3
|
+
export type BadgeSize = 'sm' | 'md';
|
|
4
|
+
export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
3
5
|
/**
|
|
4
6
|
* Defines theme of the Badge
|
|
5
7
|
* @default "info"
|
|
6
8
|
*/
|
|
7
9
|
theme?: BadgeTheme;
|
|
8
|
-
|
|
9
|
-
children: any;
|
|
10
|
+
children: ReactNode;
|
|
10
11
|
/**
|
|
11
12
|
* Defines if badge is removable
|
|
12
13
|
*/
|
|
@@ -19,4 +20,13 @@ export interface BadgeProps {
|
|
|
19
20
|
* Handler on removing badge
|
|
20
21
|
*/
|
|
21
22
|
onRemove?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Size preset controlling padding
|
|
25
|
+
* @default "md"
|
|
26
|
+
*/
|
|
27
|
+
size?: BadgeSize;
|
|
28
|
+
/**
|
|
29
|
+
* Optional icon rendered before the label
|
|
30
|
+
*/
|
|
31
|
+
icon?: ReactNode;
|
|
22
32
|
}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
export type BannerType = 'info' | 'error' | 'success' | 'warning';
|
|
2
3
|
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
-
export interface BannerProps {
|
|
4
|
+
export interface BannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* Defines banner type
|
|
6
7
|
* @default "info"
|
|
7
8
|
*/
|
|
8
9
|
type?: BannerType;
|
|
9
|
-
children
|
|
10
|
+
children?: ReactNode;
|
|
10
11
|
/**
|
|
11
12
|
* Controls the icon size
|
|
12
13
|
* @default "sm"
|
|
13
14
|
*/
|
|
14
15
|
iconSize?: IconSize;
|
|
16
|
+
/**
|
|
17
|
+
* Override the default type icon. Pass null to suppress the icon entirely.
|
|
18
|
+
*/
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Makes the banner dismissible with a close button
|
|
22
|
+
*/
|
|
23
|
+
removable?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Called when the dismiss button is clicked
|
|
26
|
+
*/
|
|
27
|
+
onRemove?: () => void;
|
|
15
28
|
}
|