uikit-react-public 0.50.1 → 0.50.2
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/components/Alert/Alert.d.ts +4 -2
- package/dist/components/Alert/Alert.stories.d.ts +10 -1
- package/dist/components/Button/Button.d.ts +8 -2
- package/dist/components/Button/Button.stories.d.ts +20 -2
- package/dist/components/Button/style/buttonPrimarySuccessStyle.d.ts +4 -0
- package/dist/index.js +3372 -3325
- package/lib/components/Alert/Alert.mdx +13 -1
- package/lib/components/Alert/Alert.stories.tsx +29 -0
- package/lib/components/Alert/Alert.tsx +32 -1
- package/lib/components/Alert/__tests__/Alert.test.tsx +78 -24
- package/lib/components/Button/Button.mdx +46 -10
- package/lib/components/Button/Button.stories.tsx +26 -0
- package/lib/components/Button/Button.tsx +27 -8
- package/lib/components/Button/__tests__/Button.test.tsx +39 -0
- package/lib/components/Button/style/buttonPrimarySuccessStyle.ts +39 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { IconProps } from '../Icon';
|
|
3
|
+
import { ButtonProps } from '../Button/Button';
|
|
3
4
|
import { default as AlertMessage } from './AlertMessage';
|
|
4
5
|
import { default as AlertTitle } from './AlertTitle';
|
|
5
6
|
import { MarginProps } from '../common/marginsStyle';
|
|
@@ -14,11 +15,12 @@ export interface AlertBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
15
|
type: AlertType;
|
|
15
16
|
iconProps?: Omit<IconProps, 'svg'>;
|
|
16
17
|
contentProps?: HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
actionButton?: ReactElement<ButtonProps>;
|
|
17
19
|
testId?: string;
|
|
18
20
|
}
|
|
19
21
|
export type AlertProps = AlertBaseProps & MarginProps;
|
|
20
22
|
declare const Alert: {
|
|
21
|
-
({ type, iconProps, contentProps, children, testId, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
23
|
+
({ type, iconProps, contentProps, actionButton, children, testId, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
22
24
|
Title: ({ children, testId, className, ...props }: import('./AlertTitle').AlertTitleProps) => import("react").JSX.Element;
|
|
23
25
|
Message: ({ testId, className, children, ...props }: import('./AlertMessage').AlertMessageProps) => import("react").JSX.Element;
|
|
24
26
|
};
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
({ type, iconProps, contentProps, children, testId, className, ...props }: import('./Alert').AlertProps): import("react").JSX.Element;
|
|
5
|
+
({ type, iconProps, contentProps, actionButton, children, testId, className, ...props }: import('./Alert').AlertProps): import("react").JSX.Element;
|
|
6
6
|
Title: ({ children, testId, className, ...props }: import('./AlertTitle').AlertTitleProps) => import("react").JSX.Element;
|
|
7
7
|
Message: ({ testId, className, children, ...props }: import('./AlertMessage').AlertMessageProps) => import("react").JSX.Element;
|
|
8
8
|
} & import('./Alert').IAlertSubComponents;
|
|
@@ -30,6 +30,14 @@ declare const meta: {
|
|
|
30
30
|
children: {
|
|
31
31
|
control: false;
|
|
32
32
|
};
|
|
33
|
+
actionButton: {
|
|
34
|
+
control: false;
|
|
35
|
+
table: {
|
|
36
|
+
type: {
|
|
37
|
+
summary: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
33
41
|
m: {
|
|
34
42
|
table: {
|
|
35
43
|
type: {
|
|
@@ -143,4 +151,5 @@ export declare const Info: Story;
|
|
|
143
151
|
export declare const Success: Story;
|
|
144
152
|
export declare const Warning: Story;
|
|
145
153
|
export declare const Error: Story;
|
|
154
|
+
export declare const WithActionButton: Story;
|
|
146
155
|
export declare const CommonMargins: Story;
|
|
@@ -2,7 +2,7 @@ import { ReactElement, ElementType, ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
import { MarginProps } from '../common/marginsStyle';
|
|
3
3
|
export declare const NAME = "ucl-uikit-button";
|
|
4
4
|
type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
|
5
|
-
export type ButtonVariant = 'accent' | 'primary' | 'secondary' | 'tertiary' | 'primary-subtle' | 'secondary-subtle' | 'tertiary-no-padding' | 'primary-destructive' | 'secondary-destructive' | 'tertiary-destructive' | 'tertiary-destructive-no-padding' | 'primary-warning';
|
|
5
|
+
export type ButtonVariant = 'accent' | 'primary' | 'secondary' | 'tertiary' | 'primary-subtle' | 'secondary-subtle' | 'tertiary-no-padding' | 'primary-destructive' | 'secondary-destructive' | 'tertiary-destructive' | 'tertiary-destructive-no-padding' | 'primary-warning' | 'primary-success';
|
|
6
6
|
type LegacySize = 'default';
|
|
7
7
|
export interface ButtonBaseProps {
|
|
8
8
|
variant?: ButtonVariant;
|
|
@@ -17,6 +17,12 @@ export interface ButtonBaseProps {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
}>;
|
|
19
19
|
iconPosition?: 'left' | 'right';
|
|
20
|
+
leftIcon?: ReactElement<{
|
|
21
|
+
className?: string;
|
|
22
|
+
}>;
|
|
23
|
+
rightIcon?: ReactElement<{
|
|
24
|
+
className?: string;
|
|
25
|
+
}>;
|
|
20
26
|
tooltip?: string;
|
|
21
27
|
loading?: boolean;
|
|
22
28
|
fullWidth?: boolean;
|
|
@@ -27,6 +33,6 @@ export type ButtonProps<C extends ElementType = 'button'> = {
|
|
|
27
33
|
ref?: PolymorphicRef<C>;
|
|
28
34
|
className?: string;
|
|
29
35
|
} & ButtonBaseProps & MarginProps & Omit<ComponentPropsWithRef<C>, keyof ButtonBaseProps | 'as'>;
|
|
30
|
-
declare const Button: <C extends ElementType = "button">({ as, variant, destructive, size, onLight, selected, disabled, icon, iconPosition, tooltip, loading, fullWidth, testId, ref, children, className, ...props }: ButtonProps<C>) => import("react").JSX.Element;
|
|
36
|
+
declare const Button: <C extends ElementType = "button">({ as, variant, destructive, size, onLight, selected, disabled, icon, iconPosition, leftIcon, rightIcon, tooltip, loading, fullWidth, testId, ref, children, className, ...props }: ButtonProps<C>) => import("react").JSX.Element;
|
|
31
37
|
declare const MemoizedButton: typeof Button;
|
|
32
38
|
export default MemoizedButton;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: <C extends import('react').ElementType = "button">({ as, variant, destructive, size, onLight, selected, disabled, icon, iconPosition, tooltip, loading, fullWidth, testId, ref, children, className, ...props }: import('./Button').ButtonProps<C>) => import("react").JSX.Element;
|
|
4
|
+
component: <C extends import('react').ElementType = "button">({ as, variant, destructive, size, onLight, selected, disabled, icon, iconPosition, leftIcon, rightIcon, tooltip, loading, fullWidth, testId, ref, children, className, ...props }: import('./Button').ButtonProps<C>) => import("react").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: {
|
|
10
|
-
options: readonly ["accent", "primary", "secondary", "tertiary", "primary-subtle", "secondary-subtle", "tertiary-no-padding", "primary-destructive", "secondary-destructive", "tertiary-destructive", "tertiary-destructive-no-padding", "primary-warning"];
|
|
10
|
+
options: readonly ["accent", "primary", "secondary", "tertiary", "primary-subtle", "secondary-subtle", "tertiary-no-padding", "primary-destructive", "secondary-destructive", "tertiary-destructive", "tertiary-destructive-no-padding", "primary-warning", "primary-success"];
|
|
11
11
|
control: {
|
|
12
12
|
type: "select";
|
|
13
13
|
};
|
|
@@ -78,6 +78,22 @@ declare const meta: {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
+
leftIcon: {
|
|
82
|
+
control: false;
|
|
83
|
+
table: {
|
|
84
|
+
type: {
|
|
85
|
+
summary: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
rightIcon: {
|
|
90
|
+
control: false;
|
|
91
|
+
table: {
|
|
92
|
+
type: {
|
|
93
|
+
summary: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
81
97
|
children: {
|
|
82
98
|
control: {
|
|
83
99
|
type: "text";
|
|
@@ -245,6 +261,7 @@ export declare const Tertiary: Story;
|
|
|
245
261
|
export declare const Accent: Story;
|
|
246
262
|
export declare const Destructive: Story;
|
|
247
263
|
export declare const DestructiveTertiaryNoPadding: Story;
|
|
264
|
+
export declare const Success: Story;
|
|
248
265
|
export declare const OnDark: Story;
|
|
249
266
|
export declare const PrimarySubtle: Story;
|
|
250
267
|
export declare const Small: Story;
|
|
@@ -270,6 +287,7 @@ export declare const IconOnly: Story & {
|
|
|
270
287
|
};
|
|
271
288
|
};
|
|
272
289
|
};
|
|
290
|
+
export declare const WithTwoIcons: Story;
|
|
273
291
|
export declare const Loading: Story;
|
|
274
292
|
export declare const Link: Story;
|
|
275
293
|
export declare const FullWidth: Story;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ThemeType } from '../../../theme';
|
|
2
|
+
import { ButtonBaseProps } from '../Button';
|
|
3
|
+
declare const buttonPrimarySuccessStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
|
+
export default buttonPrimarySuccessStyle;
|