uikit-react-public 0.50.4 → 0.50.6
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 +14 -5
- package/dist/components/Alert/Alert.stories.d.ts +10 -2
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +5 -3
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +2 -2
- package/dist/components/ToggleGroup/ToggleGroupContext.d.ts +2 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -2
- package/dist/components/ToggleGroup/subcomponents/ToggleGroupItem.d.ts +13 -0
- package/dist/components/ToggleGroup/subcomponents/{Item.stories.d.ts → ToggleGroupItem.stories.d.ts} +2 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/index.js +7146 -7061
- package/lib/components/Alert/Alert.mdx +4 -0
- package/lib/components/Alert/Alert.stories.tsx +17 -11
- package/lib/components/Alert/Alert.tsx +41 -19
- package/lib/components/Alert/__tests__/Alert.test.tsx +40 -12
- package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +4 -4
- package/lib/components/Alert/index.ts +1 -1
- package/lib/components/ToggleGroup/ToggleGroup.tsx +51 -10
- package/lib/components/ToggleGroup/ToggleGroupContext.tsx +2 -0
- package/lib/components/ToggleGroup/__tests__/ToggleGroup.test.tsx +105 -6
- package/lib/components/ToggleGroup/index.ts +1 -2
- package/lib/components/ToggleGroup/subcomponents/{Item.stories.tsx → ToggleGroupItem.stories.tsx} +2 -3
- package/lib/components/ToggleGroup/subcomponents/{Item.tsx → ToggleGroupItem.tsx} +126 -52
- package/lib/components/ToggleGroup/subcomponents/__tests__/{Item.test.tsx → ToggleGroupItem.test.tsx} +50 -6
- package/lib/components/index.ts +2 -2
- package/package.json +1 -1
- package/dist/components/ToggleGroup/subcomponents/Item.d.ts +0 -11
- /package/dist/components/ToggleGroup/subcomponents/__tests__/{Item.test.d.ts → ToggleGroupItem.test.d.ts} +0 -0
|
@@ -5,22 +5,31 @@ import { default as AlertMessage } from './AlertMessage';
|
|
|
5
5
|
import { default as AlertTitle } from './AlertTitle';
|
|
6
6
|
import { MarginProps } from '../common/marginsStyle';
|
|
7
7
|
export declare const NAME = "ucl-uikit-alert";
|
|
8
|
-
export type
|
|
8
|
+
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
9
|
+
/** @deprecated Use AlertVariant instead. */
|
|
10
|
+
export type AlertType = AlertVariant;
|
|
9
11
|
export interface AlertContextProps {
|
|
10
|
-
type:
|
|
12
|
+
type: AlertVariant;
|
|
11
13
|
}
|
|
12
14
|
export declare const AlertContext: import('react').Context<AlertContextProps | null>;
|
|
13
15
|
export declare function useAlertContext(): AlertContextProps;
|
|
14
16
|
export interface AlertBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
-
|
|
17
|
+
variant?: AlertVariant;
|
|
18
|
+
/** @deprecated Use variant instead. */
|
|
19
|
+
type?: AlertVariant;
|
|
16
20
|
iconProps?: Omit<IconProps, 'svg'>;
|
|
17
21
|
contentProps?: HTMLAttributes<HTMLDivElement>;
|
|
18
22
|
actionButton?: ReactElement<ButtonProps>;
|
|
19
23
|
testId?: string;
|
|
20
24
|
}
|
|
21
|
-
export type AlertProps = AlertBaseProps & MarginProps
|
|
25
|
+
export type AlertProps = AlertBaseProps & MarginProps & ({
|
|
26
|
+
variant: AlertVariant;
|
|
27
|
+
} | {
|
|
28
|
+
variant?: undefined;
|
|
29
|
+
type: AlertVariant;
|
|
30
|
+
});
|
|
22
31
|
declare const Alert: {
|
|
23
|
-
({ type, iconProps, contentProps, actionButton, children, testId, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
32
|
+
({ variant, type: deprecatedType, iconProps, contentProps, actionButton, children, testId, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
24
33
|
Title: ({ children, testId, className, ...props }: import('./AlertTitle').AlertTitleProps) => import("react").JSX.Element;
|
|
25
34
|
Message: ({ testId, className, children, ...props }: import('./AlertMessage').AlertMessageProps) => import("react").JSX.Element;
|
|
26
35
|
};
|
|
@@ -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, actionButton, children, testId, className, ...props }: import('./Alert').AlertProps): import("react").JSX.Element;
|
|
5
|
+
({ variant, type: deprecatedType, 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;
|
|
@@ -10,12 +10,20 @@ declare const meta: {
|
|
|
10
10
|
layout: string;
|
|
11
11
|
};
|
|
12
12
|
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
options: string[];
|
|
15
|
+
control: {
|
|
16
|
+
type: "select";
|
|
17
|
+
};
|
|
18
|
+
type: "string";
|
|
19
|
+
};
|
|
13
20
|
type: {
|
|
14
21
|
options: string[];
|
|
15
22
|
control: {
|
|
16
23
|
type: "select";
|
|
17
24
|
};
|
|
18
25
|
type: "string";
|
|
26
|
+
description: string;
|
|
19
27
|
};
|
|
20
28
|
className: {
|
|
21
29
|
control: {
|
|
@@ -140,7 +148,7 @@ declare const meta: {
|
|
|
140
148
|
};
|
|
141
149
|
};
|
|
142
150
|
args: {
|
|
143
|
-
|
|
151
|
+
variant: "info";
|
|
144
152
|
testId: string;
|
|
145
153
|
};
|
|
146
154
|
tags: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default } from './Alert';
|
|
2
2
|
export { default as AlertTitle } from './AlertTitle';
|
|
3
3
|
export { default as AlertMessage } from './AlertMessage';
|
|
4
|
-
export type { AlertProps } from './Alert';
|
|
4
|
+
export type { AlertProps, AlertVariant, AlertType } from './Alert';
|
|
5
5
|
export type { AlertTitleProps } from './AlertTitle';
|
|
6
6
|
export type { AlertMessageProps } from './AlertMessage';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NonClearableSelectProps } from '../Select';
|
|
3
|
-
import {
|
|
3
|
+
import { ToggleGroupItemProps } from './subcomponents/ToggleGroupItem';
|
|
4
|
+
export declare const NAME = "ucl-uikit-toggle-group";
|
|
4
5
|
export interface ToggleGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
value?: string;
|
|
7
8
|
defaultValue?: string;
|
|
8
9
|
onValueChange?: (value: string) => void;
|
|
10
|
+
testId?: string;
|
|
9
11
|
selectProps?: Omit<NonClearableSelectProps<string>, 'options' | 'value' | 'onValueChange'>;
|
|
10
12
|
}
|
|
11
13
|
declare const ToggleGroup: {
|
|
12
|
-
({ children, value, defaultValue, onValueChange, selectProps, }: ToggleGroupProps): React.JSX.Element;
|
|
13
|
-
Item: ({ value, label, sublabel, icon, disabled, }:
|
|
14
|
+
({ children, value, defaultValue, onValueChange, selectProps, className, onKeyDown, testId, ...htmlAttributes }: ToggleGroupProps): React.JSX.Element;
|
|
15
|
+
Item: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: ToggleGroupItemProps) => React.JSX.Element;
|
|
14
16
|
};
|
|
15
17
|
export default ToggleGroup;
|
|
@@ -2,8 +2,8 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
({ children, value, defaultValue, onValueChange, selectProps, }: import('./ToggleGroup').ToggleGroupProps): import("react").JSX.Element;
|
|
6
|
-
Item: ({ value, label, sublabel, icon, disabled, }: import('.').
|
|
5
|
+
({ children, value, defaultValue, onValueChange, selectProps, className, onKeyDown, testId, ...htmlAttributes }: import('./ToggleGroup').ToggleGroupProps): import("react").JSX.Element;
|
|
6
|
+
Item: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: import('.').ToggleGroupItemProps) => import("react").JSX.Element;
|
|
7
7
|
};
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
@@ -2,6 +2,8 @@ export interface ToggleGroupContextType {
|
|
|
2
2
|
value: string | undefined;
|
|
3
3
|
setValue: (value: string) => void;
|
|
4
4
|
name: string;
|
|
5
|
+
tabbableValue: string | undefined;
|
|
6
|
+
hasSublabel: boolean;
|
|
5
7
|
}
|
|
6
8
|
declare const ToggleGroupContext: import('react').Context<ToggleGroupContextType | undefined>;
|
|
7
9
|
export declare const useToggleGroupContext: () => ToggleGroupContextType;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default } from './ToggleGroup';
|
|
2
2
|
export type { ToggleGroupProps } from './ToggleGroup';
|
|
3
|
-
export {
|
|
4
|
-
export type { ItemProps } from './subcomponents/Item';
|
|
3
|
+
export type { ToggleGroupItemProps } from './subcomponents/ToggleGroupItem';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SpecificIconsType } from '../../Icon/Icon';
|
|
3
|
+
export declare const NAME = "ucl-uikit-toggle-group__item";
|
|
4
|
+
export interface ToggleGroupItemProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: keyof SpecificIconsType;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
sublabel?: string;
|
|
10
|
+
testId?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ToggleGroupItem: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: ToggleGroupItemProps) => React.JSX.Element;
|
|
13
|
+
export default ToggleGroupItem;
|
package/dist/components/ToggleGroup/subcomponents/{Item.stories.d.ts → ToggleGroupItem.stories.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ value, label, sublabel, icon, disabled, }: import('./
|
|
4
|
+
component: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: import('./ToggleGroupItem').ToggleGroupItemProps) => import("react").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -12,6 +12,7 @@ declare const meta: {
|
|
|
12
12
|
icon?: keyof import('../../Icon/Icon').SpecificIconsType | undefined;
|
|
13
13
|
disabled?: boolean | undefined;
|
|
14
14
|
sublabel?: string | undefined;
|
|
15
|
+
testId?: string | undefined;
|
|
15
16
|
accept?: string | undefined | undefined;
|
|
16
17
|
alt?: string | undefined | undefined;
|
|
17
18
|
autoComplete?: import('react').HTMLInputAutoCompleteAttribute | undefined;
|
|
@@ -77,7 +77,7 @@ export type { CheckboxProps, LabelledCheckboxProps } from './Checkbox';
|
|
|
77
77
|
export { default as Toggle } from './Toggle';
|
|
78
78
|
export type { ToggleProps } from './Toggle';
|
|
79
79
|
export { default as ToggleGroup } from './ToggleGroup';
|
|
80
|
-
export type {
|
|
80
|
+
export type { ToggleGroupItemProps, ToggleGroupProps } from './ToggleGroup';
|
|
81
81
|
export { default as Chip } from './Chip';
|
|
82
82
|
export type { ChipProps } from './Chip';
|
|
83
83
|
export { default as AppMenu } from './AppMenu';
|
|
@@ -108,7 +108,7 @@ export type { HeaderDraftProps } from './HeaderDraft';
|
|
|
108
108
|
export { default as Table } from './Table';
|
|
109
109
|
export type { TableProps } from './Table';
|
|
110
110
|
export { default as Alert } from './Alert';
|
|
111
|
-
export type { AlertProps } from './Alert';
|
|
111
|
+
export type { AlertProps, AlertVariant, AlertType } from './Alert';
|
|
112
112
|
export { default as Tabs } from './Tabs';
|
|
113
113
|
export type { TabsActivationMode, TabsListProps, TabsOrientation, TabsPanelProps, TabsProps, } from './Tabs';
|
|
114
114
|
export type { TabProps } from './Tabs/Tab';
|