uikit-react-public 0.50.0 → 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 +14 -4
- package/dist/components/Button/Button.stories.d.ts +29 -2
- package/dist/components/Button/style/buttonPrimarySubtleStyle.d.ts +1 -1
- package/dist/components/Button/style/buttonPrimarySuccessStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondaryStyle.d.ts +1 -1
- package/dist/components/Button/style/buttonSecondarySubtleStyle.d.ts +1 -1
- package/dist/components/Button/style/buttonTertiaryDestructiveNoPaddingStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryDestructiveStyle.d.ts +1 -1
- package/dist/components/Button/style/buttonTertiaryNoPaddingStyle.d.ts +1 -1
- package/dist/components/Button/style/buttonTertiaryStyle.d.ts +1 -1
- package/dist/index.js +4485 -4373
- 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 +57 -9
- package/lib/components/Button/Button.stories.tsx +72 -0
- package/lib/components/Button/Button.tsx +68 -26
- package/lib/components/Button/__tests__/Button.test.tsx +159 -1
- package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +11 -11
- package/lib/components/Button/style/buttonAccentStyle.ts +2 -0
- package/lib/components/Button/style/buttonPrimaryDestructiveStyle.ts +2 -0
- package/lib/components/Button/style/buttonPrimaryStyle.ts +2 -0
- package/lib/components/Button/style/buttonPrimarySubtleStyle.ts +10 -11
- package/lib/components/Button/style/buttonPrimarySuccessStyle.ts +39 -0
- package/lib/components/Button/style/buttonPrimaryWarningStyle.ts +2 -0
- package/lib/components/Button/style/buttonSecondaryDestructiveStyle.ts +13 -7
- package/lib/components/Button/style/buttonSecondaryStyle.ts +49 -16
- package/lib/components/Button/style/buttonSecondarySubtleStyle.ts +15 -13
- package/lib/components/Button/style/buttonTertiaryDestructiveNoPaddingStyle.ts +34 -0
- package/lib/components/Button/style/buttonTertiaryDestructiveStyle.ts +9 -8
- package/lib/components/Button/style/buttonTertiaryNoPaddingStyle.ts +13 -15
- package/lib/components/Button/style/buttonTertiaryStyle.ts +10 -9
- package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +1 -1
- 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,17 +2,27 @@ 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' | '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;
|
|
9
|
-
/** @deprecated Use
|
|
9
|
+
/** @deprecated Use a destructive variant directly */
|
|
10
10
|
destructive?: boolean;
|
|
11
11
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | LegacySize;
|
|
12
|
+
/** Whether the button is rendered on a light background */
|
|
13
|
+
onLight?: boolean;
|
|
12
14
|
selected?: boolean;
|
|
13
15
|
disabled?: boolean;
|
|
14
|
-
icon?: ReactElement
|
|
16
|
+
icon?: ReactElement<{
|
|
17
|
+
className?: string;
|
|
18
|
+
}>;
|
|
15
19
|
iconPosition?: 'left' | 'right';
|
|
20
|
+
leftIcon?: ReactElement<{
|
|
21
|
+
className?: string;
|
|
22
|
+
}>;
|
|
23
|
+
rightIcon?: ReactElement<{
|
|
24
|
+
className?: string;
|
|
25
|
+
}>;
|
|
16
26
|
tooltip?: string;
|
|
17
27
|
loading?: boolean;
|
|
18
28
|
fullWidth?: boolean;
|
|
@@ -23,6 +33,6 @@ export type ButtonProps<C extends ElementType = 'button'> = {
|
|
|
23
33
|
ref?: PolymorphicRef<C>;
|
|
24
34
|
className?: string;
|
|
25
35
|
} & ButtonBaseProps & MarginProps & Omit<ComponentPropsWithRef<C>, keyof ButtonBaseProps | 'as'>;
|
|
26
|
-
declare const Button: <C extends ElementType = "button">({ as, variant, destructive, size, 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;
|
|
27
37
|
declare const MemoizedButton: typeof Button;
|
|
28
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, 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", "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
|
};
|
|
@@ -52,6 +52,13 @@ declare const meta: {
|
|
|
52
52
|
};
|
|
53
53
|
type: "boolean";
|
|
54
54
|
};
|
|
55
|
+
onLight: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
};
|
|
59
|
+
type: "boolean";
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
55
62
|
disabled: {
|
|
56
63
|
control: {
|
|
57
64
|
type: "boolean";
|
|
@@ -71,6 +78,22 @@ declare const meta: {
|
|
|
71
78
|
};
|
|
72
79
|
};
|
|
73
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
|
+
};
|
|
74
97
|
children: {
|
|
75
98
|
control: {
|
|
76
99
|
type: "text";
|
|
@@ -237,6 +260,9 @@ export declare const Secondary: Story;
|
|
|
237
260
|
export declare const Tertiary: Story;
|
|
238
261
|
export declare const Accent: Story;
|
|
239
262
|
export declare const Destructive: Story;
|
|
263
|
+
export declare const DestructiveTertiaryNoPadding: Story;
|
|
264
|
+
export declare const Success: Story;
|
|
265
|
+
export declare const OnDark: Story;
|
|
240
266
|
export declare const PrimarySubtle: Story;
|
|
241
267
|
export declare const Small: Story;
|
|
242
268
|
export declare const Large: Story;
|
|
@@ -261,6 +287,7 @@ export declare const IconOnly: Story & {
|
|
|
261
287
|
};
|
|
262
288
|
};
|
|
263
289
|
};
|
|
290
|
+
export declare const WithTwoIcons: Story;
|
|
264
291
|
export declare const Loading: Story;
|
|
265
292
|
export declare const Link: Story;
|
|
266
293
|
export declare const FullWidth: Story;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonPrimarySubtleStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]
|
|
3
|
+
declare const buttonPrimarySubtleStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
4
|
export default buttonPrimarySubtleStyle;
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonSecondaryStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
3
|
+
declare const buttonSecondaryStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"], onLight: ButtonBaseProps["onLight"]) => string;
|
|
4
4
|
export default buttonSecondaryStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonSecondarySubtleStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]
|
|
3
|
+
declare const buttonSecondarySubtleStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
4
|
export default buttonSecondarySubtleStyle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ThemeType } from '../../../theme';
|
|
2
|
+
import { ButtonBaseProps } from '../Button';
|
|
3
|
+
declare const buttonTertiaryDestructiveNoPaddingStyle: (theme: ThemeType, disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
|
+
export default buttonTertiaryDestructiveNoPaddingStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonTertiaryDestructiveStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]
|
|
3
|
+
declare const buttonTertiaryDestructiveStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
4
|
export default buttonTertiaryDestructiveStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonTertiaryNoPaddingStyle: (theme: ThemeType, disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"],
|
|
3
|
+
declare const buttonTertiaryNoPaddingStyle: (theme: ThemeType, disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"], onLight: ButtonBaseProps["onLight"]) => string;
|
|
4
4
|
export default buttonTertiaryNoPaddingStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ThemeType } from '../../../theme';
|
|
2
2
|
import { ButtonBaseProps } from '../Button';
|
|
3
|
-
declare const buttonTertiaryStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]
|
|
3
|
+
declare const buttonTertiaryStyle: (theme: ThemeType, selected: ButtonBaseProps["selected"], disabled: ButtonBaseProps["disabled"], loading: ButtonBaseProps["loading"]) => string;
|
|
4
4
|
export default buttonTertiaryStyle;
|