uikit-react-public 0.50.0 → 0.50.1
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/Button/Button.d.ts +8 -4
- package/dist/components/Button/Button.stories.d.ts +11 -2
- package/dist/components/Button/style/buttonPrimarySubtleStyle.d.ts +1 -1
- 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 +4695 -4630
- package/lib/components/Button/Button.mdx +12 -0
- package/lib/components/Button/Button.stories.tsx +46 -0
- package/lib/components/Button/Button.tsx +48 -25
- package/lib/components/Button/__tests__/Button.test.tsx +120 -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/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
|
@@ -2,16 +2,20 @@ 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';
|
|
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';
|
|
16
20
|
tooltip?: string;
|
|
17
21
|
loading?: boolean;
|
|
@@ -23,6 +27,6 @@ export type ButtonProps<C extends ElementType = 'button'> = {
|
|
|
23
27
|
ref?: PolymorphicRef<C>;
|
|
24
28
|
className?: string;
|
|
25
29
|
} & 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;
|
|
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;
|
|
27
31
|
declare const MemoizedButton: typeof Button;
|
|
28
32
|
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, 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"];
|
|
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";
|
|
@@ -237,6 +244,8 @@ export declare const Secondary: Story;
|
|
|
237
244
|
export declare const Tertiary: Story;
|
|
238
245
|
export declare const Accent: Story;
|
|
239
246
|
export declare const Destructive: Story;
|
|
247
|
+
export declare const DestructiveTertiaryNoPadding: Story;
|
|
248
|
+
export declare const OnDark: Story;
|
|
240
249
|
export declare const PrimarySubtle: Story;
|
|
241
250
|
export declare const Small: Story;
|
|
242
251
|
export declare const Large: 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;
|
|
@@ -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;
|